Summary of your scenario based on comments: You have an interactive Azure Maps experience where the user pans/zooms the map. When they get to where they want there is a button that generates a static image of the map. This is done using the V1 static map API. The observed issue is that the static map image includes points of interests that are part of the basemap. In the interactive map experience these would usually be hidden when user data overlaps, keeping the map clear, but when using the static map API, the points of interest are always rendered, and thus clutter the map.
Answer specific to the asked question:
Looking at your query you are using v1 of the static map service, there is a newer version called "2024-04-01" which is documented here: https://learn.microsoft.com/en-us/rest/api/maps/render/get-map-static-image?view=rest-maps-2025-01-01&tabs=HTTP
The map style in the newer API is much more aligned with the interactive map control and has few points of interest displayed.
https://atlas.microsoft.com/map/static?api-version=2024-04-01&subscription-key=<API_KEY>¢er=-122.4194,37.7749&zoom=14&width=800&height=600&tilesetId=microsoft.base.road
V1 Service | Latest Service |
---|---|
For comparison, here is what the interactive map looks like for the same center and zoom level.
As you can see, using the latest Static Map API generates an image that is nearly identical (if not identical) to that of the interactive map with few points of interest icons in the way
Another approach:
Using a static map API for this scenario works, but you may encounter limitations. For example, the interactive map control has a lot more map styles, as well as options to turn of certain data layers (style overrides). It also has a lot more rendering capabilities that aren't possible in the static map API.
If you want to generate and screenshot of the interactive map it is possible do this without the static map service. The map uses WebGL Canvas for rendering and it's possible to use this to export an image of the map. There is a sample of how to do this here: https://samples.azuremaps.com/?sample=export-map-as-image As an added bonus, this doesn't generate any additional transactions since all the map data (tiles) would have already been downloaded by the interactive map control and used to generate the static image. This is achieved using the following open-source module for Azure Maps: https://github.com/Azure-Samples/azure-maps-image-exporter