Build a URL to create a static map with a point.

To display a point on a static map, use the /with-point endpoint from the ArcGIS Static Maps service. Provide the x and y parameters to define the point location. You can also specify the marker style using a pin, square, or circle marker, with optional color and label. Additionally, specify the image width and height in pixels, along with the output format (png, jpeg, or webp).

How to display a static map with a point

The typical workflow to display a static map with a point is:

  1. Map: Define the basemapStyle and map area with centerX andcenterY, and zoom or radius.
  2. Geometry: Define point location with x and y coordinates and the symbolStyle.
  3. Image: Specify the image height, width, format, and attribution style.
  4. Request: Send a GET request to the /with-point endpoint to generate the static map.

Service URL

Use dark colors for code blocksCopy
1
https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps

Path parameters

These are required parameters to specify the style to access.

Use dark colors for code blocksCopy
1
https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/{version}/static-maps/{basemapStyle}/with-point
NameDescriptionExample
{version}Required: The API version.v1
{basemapStyle}Required: The basemap style for the static map.arcgis/navigation, arcgis/navigation-night, arcgis/imagery, arcgis/streets-night, or arcgis/streets

Query parameters

NameTypeRequiredDefault valueDescription
tokenstring

An access token with the static maps service privilege. To pass the token as an authorization header, see HTTP authorization headers.

xnumber(double)

X-coordinate of a point in WGS84 decimal degrees. Values range from -179.99 to 179.99.

ynumber(double)

Y-coordinate of a point in WGS84 decimal degrees. Values range from -85.05 to 85.05.

formatImageFormatwebp

Output image format of the map. Supported formats include png, jpeg, and webp.

heightImageDimensionHeight400

Height of the map image in pixels. Values must be between 128 and 1024.

widthImageDimensionWidth400

Width of the map image in pixels. Values must be between 128 and 1024.

paddingImagePadding10

Padding percentages around the map extent. Accepts an array of 1–4 values; default is 10 on all sides, maximum is 25.

symbolColorHexColor007AC2

Point symbol color in hexadecimal format with an optional alpha value.

symbolScaleSymbolScale1

Scale factor applied to the point symbol size. Values range from 0.1 to 4.0.

symbolStyleSymbolStylepin

Style applied to the point symbol. Supported values include pin, circle, square, and none.

symbolLabelSymbolLabel

Label displayed on the point symbol. Accepts 1–2 alphanumeric characters (A-Z, a-z, 0-9).

centerXnumber(double)

X-coordinate of the map center in WGS84 decimal degrees. Values range from -179.99 to 179.99.

centerYnumber(double)

Y-coordinate of the map center in WGS84 decimal degrees. Values range from -85.05 to 85.05.

zoomZoomLevel

A number that defines the level of detail of the map. Values range from 0 to 22.

radiusRadiusDistance

A number (in meters) that defines the minimum geographic area around a center point of the map. If no center point is supplied, the radius is applied to the geometry. Values range from 10 to 20,000,000.

attributionstringauto

Attribution footer style. To learn more about attribution requirements for static maps, see Esri and data attribution.

referenceDetailsstringall

A basemap option that controls the visibility of labels and feature symbology. This parameter is currently supported only for the arcgis/imagery style. Supported values include all and none.

Code examples

Display a point with a default symbol

Use the Static Maps service to generate a static map with the location of the Esri headquarters in Redlands, California. The map uses the ArcGIS Navigation basemap style and has the default blue pin symbol at the center.

Steps

  1. Reference the service.
  2. Set the API key in the Authorization request header using the Bearer authentication scheme.
  3. Define the coordinate, symbol style, and other parameters for the request.
  4. Send the request to the Static Maps service to generate the static map.
JavaScript
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
      const basemapStyle = "arcgis/navigation";
      const accessToken = "YOUR_ACCESS_TOKEN";

      const lat = 34.0567;
      const lon = -117.1956;
      const width = 350;
      const height = 500;

      fetch(
        `https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/${basemapStyle}/with-point?x=${lon}&y=${lat}&symbolStyle=pin&symbolColor=007AC2&zoom=11&width=${width}&height=${height}`,
        {
          headers: {
            Authorization: `Bearer ${accessToken}`,
          },
        }
      )
        .then((response) => response.blob())
        .then((blob) => {
          document.getElementById("staticMap").src = URL.createObjectURL(blob);
        });
Expand

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
curl -X GET 'https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/navigation/with-point?x=-117.1956&y=34.0567&symbolStyle=pin&symbolColor=007AC2&zoom=11&width=350&height=500&token=<ACCESS_TOKEN>'

Display a map without a point

Use the Static Maps service to generate a static map centered in Yuma City, California using the ArcGIS Imagery basemap style. The map will not display a point symbol at the center.

Steps

  1. Reference the service.
  2. Set the API key in the Authorization request header using the Bearer authentication scheme.
  3. Define the coordinate and set symbolStyle parameter to none to display the map without a point.
  4. Send the request to the Static Maps service to generate the static map.
JavaScript
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
      fetch(
        `https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/${basemapStyle}/with-point?x=${x}&y=${y}&format=jpeg&height=400&width=600&symbolStyle=none&zoom=14`,
        {
          headers: {
            Authorization: `Bearer ${accessToken}`,
          },
        }
      )
        .then((response) => response.blob())
        .then((blob) => {
          document.getElementById("map").src = URL.createObjectURL(blob);
        });
Expand

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
curl -X GET 'https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/imagery/with-point?format=jpeg&height=400&width=600&symbolStyle=none&zoom=14&x=-121.67579933611826&y=39.17655859425453&token=<ACCESS_TOKEN>'

Display a geocoded point

Use the Static Maps service together with the Geocoding service to display a location from a geocoding result. First, create a search box with autosuggest to help users select an address. Then, geocode the selected address to obtain its coordinates, and pass those coordinates to the Static Maps service to generate a static map centered on the location.

Steps

  1. Reference the Static Maps service and the Geocoding service endpoints.
  2. Set the API key in the Authorization request header using the Bearer authentication scheme. Your API key needs both the Geocoding and Static Maps services privileges.
  3. Use user input to call /suggest and display address suggestions.
  4. Get the coordinates of the selected location with /findAddressCandidates.
  5. Pass the coordinates to the Static Maps service to generate the static map centered at the location.
JavaScript
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
      async function showStaticMap(lon, lat) {
        const width = Math.max(64, Math.min(mapDiv.clientWidth, 1024));
        const height = Math.max(64, Math.min(mapDiv.clientHeight, 1024));
        const symbolColor = "007AC2";

        const response = await fetch(
          `https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/${basemapStyle}/with-point?x=${lon}&y=${lat}&symbolStyle=pin&symbolColor=${symbolColor}&radius=2500&width=${width}&height=${height}`,
          {
            headers: {
              Authorization: `Bearer ${accessToken}`,
            },
          }
        );
        const blob = await response.blob();

        const img = document.createElement("img");
        img.src = URL.createObjectURL(blob);
        img.alt = "Static map showing selected location";

        img.onload = () => {
          mapContainer.style.width = width + "px";
          mapContainer.style.height = height + "px";
        };

        mapDiv.innerHTML = "";
        mapDiv.appendChild(img);
      }
Expand

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
curl -X GET "https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/navigation/with-point?x=-105.121300465018&y=39.970184671679&symbolStyle=pin&symbolColor=007AC2&radius=2500&width=800&height=300&token=<ACCESS_TOKEN>"

Tutorials

Display a simple static map

Display a static map with a point, polyline, or polygon.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.