To display multiple points on a static map/with-many-points endpoint from the ArcGIS Static Maps servicex,y coordinate pairs in the points parameter. All points use the same pin, square, or circle marker style. You can also specify the image width and height in pixels, along with the output format (png, jpeg, or webp).
How to display a static map with multiple points
The typical workflow to display a static map with multiple points is:
- Map: Define the
basemapand map area withStyle centerandX center, andY zoomorradius. - Geometry: Define the
pointsarray containing the point coordinates andsymbolfor the symbol style.Style - Image: Specify the image
heightandwidthin pixels,format, andattributionstyle. - Request: Send a
GETrequest to the/with-many-pointsendpoint to generate the static map.
Service URL
https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-mapsPath parameters
These are required parameters to specify the style to access.
https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/{basemapStyle}/with-many-points| Name | Description | Example |
|---|---|---|
{version} | Required: The API version. | v1 |
{basemap | Required: The basemap style for the static map. | arcgis/navigation, arcgis/navigation-night, arcgis/imagery, arcgis/streets-night, or arcgis/streets |
Query parameters
| Name | Type | Required | Default value | Description |
|---|---|---|---|---|
token | string | | An access token with the static maps service privilege. To pass the token as an authorization header, see HTTP authorization headers. | |
points | ManyPointsGet | | An array of x,y coordinate pairs in the WGS84 spatial reference. X values range from -179.99 to 179.99 and Y values range from -85.05 to 85.05. Accepts up to 10 coordinate pairs. | |
labelOption | string | none | Type of label displayed on point symbols, such as letters or numbers. Supported values include | |
format | ImageFormat | webp | Output image format of the map. Supported formats include | |
height | ImageDimensionHeight | 400 | Height of the map image in pixels. Values must be between | |
width | ImageDimensionWidth | 400 | Width of the map image in pixels. Values must be between | |
padding | ImagePadding | 10 | Padding percentages around the map extent. Accepts an array of 1–4 values; default is | |
symbolColor | HexColor | 007 | Point symbol color in hexadecimal format with an optional alpha value. | |
symbolScale | SymbolScale | 1 | Scale factor applied to the point symbol size. Values range from | |
symbolStyle | SymbolStyle | pin | Style applied to the point symbol. Supported values include | |
centerX | number(double) | | X-coordinate of the map center in WGS84 decimal degrees. Values range from | |
centerY | number(double) | | Y-coordinate of the map center in WGS84 decimal degrees. Values range from | |
zoom | ZoomLevel | | A number that defines the level of detail of the map. Values range from | |
radius | RadiusDistance | | 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 | |
attribution | string | auto | Attribution footer style. To learn more about attribution requirements for static maps, see Esri and data attribution. | |
referenceDetails | string | all | A basemap option that controls the visibility of labels and feature symbology. This parameter is currently supported only for the |
Code examples
Display a map with default symbols
Use the Static Maps service to display properties for sale in Texas. Each property is represented as a point geometry using the default pin symbol. A panel on the left provides additional information about each property. The map uses the ArcGIS Imagery basemap style.
Steps
- Reference the service.
- Set the API key in the
Authorizationrequest header using theBearerauthentication scheme. - Define the coordinates, symbol style, and other parameters for the request.
fetch(
`https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/${basemapStyle}/with-many-points?points=${JSON.stringify(points)}&symbolStyle=pin&labelOption=number&symbolScale=1&symbolColor=007AC2&width=${width}&height=${height}&padding=[15]`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
)
.then((response) => response.blob())
.then((blob) => {
const img = document.createElement("img");
img.src = URL.createObjectURL(blob);
img.alt = "Real estate map showing multiple properties";
mapEl.innerHTML = "";
mapEl.appendChild(img);
});
const legendDiv = document.getElementById("legend");
properties.forEach((p, i) => {
const item = document.createElement("div");
item.className = "legend-item";
item.innerHTML = `
<div class="legend-number">${i + 1}</div>
<div>
<b>House for sale</b> <br />
${p.address} <br />
<em>${p.bedrooms} bed, ${p.bathrooms} bath</em> | ${p.sqft} sqft <br />
${p.price}
</div>
`;
legendDiv.appendChild(item);
});
REST API
curl -X GET "https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/imagery/with-many-points?points=[[-98.426,29.364],[-98.4296,29.3632],[-98.4276,29.359],[-98.4226,29.3607]]&symbolColor=007AC2&labelOption=number&symbolScale=1&symbolColor=ffffff&width=600&height=400&padding=[10]&token=<ACCESS_TOKEN>"Tutorials
