Learn how to use the ArcGIS Static Maps service to generate a static map with GET requests.

Examples of static maps with a point, multiple points, a polyline, and a polygon graphic.

In this tutorial, you use the /with-point, /with-many-points, /with-polyline, and /with-polygon endpoints from the ArcGIS Static Maps service to generate four simple static maps. You also learn how to use default marker symbols and customize the image size and output format.

Prerequisites

You need an ArcGIS Location Platform account to get an access token to access the Static Maps service.

Steps

Get an access token

Create a new API key credential with privileges to access the resources used in this tutorial.

  1. If you are familiar with API keys, create an API key credential with the following configurations:

    • Type of application: Public application
    • Required privileges: Location services > Static maps

    If you are new to API keys, go to the Create an API key tutorial for full step-by-step instructions.

  2. When prompted, copy and paste the API key to a safe location. It will be used in the next step.

Display a static map with a point

The /with-point endpoint supports GET operations to generate a static map with a point with a default symbol.

  1. Define the /with-point endpoint and set the basemap style to arcgis/navigation-night. The URL should look like this:

    Use dark colors for code blocksCopy
    1
    https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/navigation-night/with-point
  2. Send a GET request to generate the static map, including the following query parameters:

    • x to -0.127758.
    • y to 51.507351.
    • radius to 1000.
    • symbolStyle to pin.
    • symbolColor to FFFFFF.
    • symbolScale to 2.
    • symbolLabel to A.
    • padding to [0,20,0,0].
    • width and height to 600.
    • format to jpeg.
    • token to your access token.
    HTTPHTTPcURL
    Use dark colors for code blocksCopy
    1
    2
    GET /arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/navigation-night/with-point?x=-0.127758&y=51.507351&radius=1000&symbolStyle=pin&symbolColor=FFFFFF&symbolScale=2&symbolLabel=A&width=600&height=600&format=jpeg&padding=[0,20,0,0]&token=YOUR_ACCESS_TOKEN HTTP/1.1
    Host: static-maps-api.arcgis.com
  3. You should see a static map centered on Central London, with a white pin symbol labeled A and 20 pixels of padding on the right. You can also view the static map in a browser and replace YOUR_ACCESS_TOKEN with your access token.

Display a static map with multiple points

The /with-many-points endpoint supports GET operations to generate a static map with multiple points (up to 10 points) with default symbols.

  1. Define the /with-many-points endpoint and set the basemap style to arcgis/streets. The URL should look like this:

    Use dark colors for code blocksCopy
    1
    https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/streets/with-many-points
  2. Send a GET request to generate the static map, including the following query parameters:

    • points to [[-117.1601,32.7055],[-117.1570,32.7076],[-117.1643,32.7039],[-117.1643,32.7099]]
    • symbolStyle to circle
    • labelOption to number
    • symbolScale to 1
    • symbolColor to 007AC2
    • width and height to 400
    • format to png
    • padding to [10]
    • token to your access token.
    HTTPHTTPcURL
    Use dark colors for code blocksCopy
    1
    2
    GET /arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/streets/with-many-points?points=[[-117.1601,32.7055],[-117.1570,32.7076],[-117.1643,32.7039],[-117.1643,32.7099]]&symbolStyle=circle&labelOption=number&symbolScale=1&symbolColor=007AC2&width=400&height=400&format=png&padding=[10]&token=YOUR_ACCESS_TOKEN HTTP/1.1
    Host: static-maps-api.arcgis.com
  3. You should see a static map centered on several points in San Diego, California, with numbered circular markers displayed at each location. You can also view the static map in a browser and replace YOUR_ACCESS_TOKEN with your access token.

Display a static map with a polyline

The /with-polyline endpoint supports GET operations to generate a static map with a polyline with up to 10 vertices and default symbols for the start and end points.

  1. Define the /with-polyline endpoint and set the basemap style to arcgis/navigation. The URL should look like this:

    Use dark colors for code blocksCopy
    1
    https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/navigation/with-polyline
  2. Send a GET request to generate the static map, including the following query parameters:

    • polyline to [[-117.1604,32.7067],[-117.1642,32.7090],[-117.1637,32.7096],[-117.1637,32.7115],[-117.1556,32.7115],[-117.1556,32.7085]]
    • startSymbolStyle to circle
    • endSymbolStyle to pin
    • width to 400
    • height to 400
    • format to png
    • padding to [25]
    • lineColor to 007AC2
    • symbolScale to 0.75
    • startSymbolColor to 35AB46
    • endSymbolColor to F36F21
    • token to your access token.
    HTTPHTTPcURL
    Use dark colors for code blocksCopy
    1
    2
    GET /arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/navigation/with-polyline?polyline=[[-117.1604,32.7067],[-117.1642,32.7090],[-117.1637,32.7096],[-117.1637,32.7115],[-117.1556,32.7115],[-117.1556,32.7085]]&startSymbolStyle=circle&endSymbolStyle=pin&width=400&height=400&format=png&padding=[25]&lineColor=007AC2&symbolScale=0.75&startSymbolColor=35AB46&endSymbolColor=F36F21&token=YOUR_ACCESS_TOKEN HTTP/1.1
    Host: static-maps-api.arcgis.com
  3. You should see a static map with a line that represents a route in San Diego, California. The route is drawn as a blue line with a green circle marking the start and an orange pin marking the end. You can also view the static map in a browser and replace YOUR_ACCESS_TOKEN with your access token.

Display a static map with a polygon

The /with-polygon endpoint supports GET operations to generate a static map with a single-part polygon with up to 10 vertices.

  1. Define the /with-polygon endpoint and set the basemap style to arcgis/imagery. The URL should look like this:

    Use dark colors for code blocksCopy
    1
    https://static-maps-api.arcgis.com/arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/imagery/with-polygon
  2. Send a GET request to generate the static map, including the following query parameters:

    • polygon to [[-117.1999995,34.0592131],[-117.1999781,34.0556133],[-117.1940236,34.0556666],[-117.192425,34.0573377],[-117.1915345,34.0572843],[-117.191513,34.0576488],[-117.1956114,34.0593998],[-117.1956222,34.0592131],[-117.1999995,34.0592131]]
    • fillColor to d2b600b8
    • fillStyle to solid
    • outlineColor to f0d000fc
    • outlineStyle to solid
    • outlineWidth to 3
    • width to 400
    • height to 400
    • format to png
    • zoom to 14
    • token to your access token.
    HTTPHTTPcURL
    Use dark colors for code blocksCopy
    1
    2
    GET /arcgis/rest/services/static-maps-service/v1/static-maps/arcgis/imagery/with-polygon?fillColor=d2b600b8&fillStyle=solid&format=png&height=400&width=400&outlineColor=f0d000fc&outlineStyle=solid&outlineWidth=3&polygon=[[-117.1999995,34.0592131],[-117.1999781,34.0556133],[-117.1940236,34.0556666],[-117.192425,34.0573377],[-117.1915345,34.0572843],[-117.191513,34.0576488],[-117.1956114,34.0593998],[-117.1956222,34.0592131],[-117.1999995,34.0592131]]&zoom=14&token=YOUR_ACCESS_TOKEN HTTP/1.1
    Host: static-maps-api.arcgis.com
  3. You should see a static map with a polygon in the Esri Headquarters in Redlands, California. The polygon is filled with a semi-transparent color and outlined with a solid border. You can also view the static map in a browser and replace YOUR_ACCESS_TOKEN with your access token.

What's next

Display a complex static map

Display a static map with multiple geometries and custom marker symbols.


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