A graphic is a vector representation of real-world geographic phenomena. It can contain geometry and a symbol. Add a graphic to ArcGIS Earth and return the graphic ID and its information.
Request URL
<baseUrl>/arcgisearth/graphics(POST only)
Request parameters
Parameter | Description |
---|---|
ID (optional) | Specifies the ID of a graphic. Type: string |
geometry (required) | The position and geometry type of a graphic. It defines the JSON formats of the geometry and spatial reference objects. Supports point, polyline, and polygon geometry. Point parameters:
JSON syntax: Polyline parameters:
JSON syntax: Polygon parameters:
JSON syntax: |
symbol (optional) | The symbol for the graphic. Choosing a symbol for a graphic depends on the geometry type of the graphic. Type: double
|
Example usage
The following is a sample input for adding a point graphic:
{
"id": " 4b75ea4a-e10f-d676-307d-aa945e2a0719",
"geometry": {
"type": "polygon",
"rings": [[
[-96.06138,32.837],
[-97.06133,34.836],
[-98.06124,34.834],
[-97.06127,32.832],
[-97.06138,32.837]
]],
"spatialReference": {"wkid": 4326}
},
"symbol": {
"type": "simple-fill",
"color": [76,115,0,255],
"outline":{
"color": [110,110,110,255],
"width": 1
}
}
}
The following is a sample input for adding a line graphic:
{
"id": "polyline-simple-line-graphic",
"geometry": {
"type": "polyline",
"paths": [
[
-118,
34
],
[
-100,
40
],
[
-82,
34
]
]
},
"symbol": {
"type": "simple-line",
"color": "#33cc33",
"width": "2px"
}
}
The following is a sample input for adding a polygon graphic:
{
"id": " 4b75ea4a-e10f-d676-307d-aa945e2a0719",
"geometry": {
"type": "polygon",
"rings": [
[
[-96.06138,32.837],
[-97.06133,34.836],
[-98.06124,34.834],
[-97.06127,32.832],
[-97.06138,32.837]
]
],
"spatialReference": {"wkid": 4326}
},
"symbol": {
"type": "simple-fill",
"color": [76,115,0,255],
"outline":
{
"color": [110,110,110,255],
"width": 1
}
}
}
JSON Response example
The following is a JSON response example for adding a point graphic:
{
"id": "point-picture-marker-graphic",
"geometry": {
"x": -100,
"y": 40,
"type": "point"
},
"symbol": {
"angle": 0,
"height": 48,
"type": "picture-marker",
"url": "https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png",
"width": 48,
"xoffset": 7.5,
"yoffset": 7.5
}
}
The following is a JSON response example for adding a line graphic:
{
"id": "polyline-simple-line-graphic",
"geometry": {
"paths": [
[
[
-118,
34
],
[
-100,
40
],
[
-82,
34
]
]
],
"type": "polyline"
},
"symbol": {
"color": [
51,
204,
51,
255
],
"type": "simple-line",
"width": 1.5
}
}
The following is a JSON response example for adding a polygon graphic:
{
"id": " 4b75ea4a-e10f-d676-307d-aa945e2a0719",
"geometry": {
"rings": [
[
[
-96.06138,
32.837
],
[
-97.06133,
34.836
],
[
-98.06124,
34.834
],
[
-97.06127,
32.832
],
[
-97.06138,
32.837
],
[
-96.06138,
32.837
]
]
],
"spatialReference": {
"wkid": 4326
},
"type": "polygon"
},
"symbol": {
"color": [
76,
115,
0,
255
],
"outline": {
"color": [
110,
110,
110,
255
],
"width": 1
},
"type": "simple-fill",
"width": 1.5
}
}