To get a map that looks exactly like the screenshot using Azure Maps isn't that easy. Here are some things we have to consider to match your screenshot:
- Looks like labels are under polygons which actually makes things a bit easier as it means the base map is just standard static map tiles, and we don't need a separate layer for labels (can be done if needed).
- Base map appears to be a flat light green. The road map style in Azure maps at a similar zoom level does have a lot of green, but there is some texture, so not a flat appearance. If you are fine with this, then that map style would be a good base to use. With the web SDK it is possible to modify the base map styles and get a much closer base map.
- There are no borders displayed. The road maps in Azure Maps show boarders. The static map API will always show them, so there is no way to remove them. In the web SDK it is possible to modify the vector map styles and hide things like this. That said, having no boarders greatly simplifies things and removes a lot of geopolitical risk since you are just showing all land. With this in mind, another option is to have a polygon of all land mass and draw that as a base, then add a label layer on top. This gives you the added benefit of showing labels above polygons too. You will likely want to use Azure Maps for the labels to support multiple languages and also handle geopolitical issues related to place names.
- Your polygons represent a group of countries/areas, and is not a stock polygon in Azure Maps. They appear to also have an outline, so they need to be a solid polygon, not a bunch of individual polygons per region. So you would need to either provide this if you already have it, or retrieve the countries boundaries for each region, and merge them together (union). Then you can render these on the map. The static map API does let you render polygons from a GeoJSON file, but it requires uploading the file first and may not be ideal if you need to generate unique maps frequently. The Web SDK of course can easily do this.
- A bunch of points displayed using custom icons.
The best path for you would depend on your application needs. So far we know you want to work in .NET core. Other considerations:
- Is the end app a desktop app, web app, web service, cross platform Maui app?
- You show one screenshot. Do you only need the one image, or be able to programmatically generate a new image with different data overlaid? centered on a different area? with a different zoom level? If you only need one or a small number of map images, then pre-creating them ahead of time offline using a desktop tool like QGIS would be the best solution. I doubt that's the case here but calling it just in case. I'll assume you need to be able to generate a map of any place on the globe.
- Do you need want to the map to be interactive within the app and just have the option to export an image of the map?
I would likely not use the Azure Maps static image API for this scenario for the following reasons:
- Requires multiple calls to Azure Maps (upload GeoJSON, render image, delete GeoJSON file), which would likely generate multiple transaction per map.
- There isn't enough customization options to match your screenshot.
Solution 1: If creating a desktop, web, or Maui app
- Use the Azure Maps Web SDK. This will allow you to create an interactive experience, and you can still export a screenshot of the map. Additionally, the web sdk uses map tiles that get automatically cached in the browser. This will result in the interactive map experience and static map export generating less than one transaction combined on average, and thus be multiple times cheaper than the static map API. There is a lot more customization and styling capabilities in the web SDK too. If you don't want the map to be interactive, you can still use this approach and disable the users ability to pan and zoom the map.
- In a web app you can easily display the Azure Maps web sdk, and when you want to export the map, you can simply generate a static image from the map canvas, either on your own or using this library here is a code sample
- In a desktop or Maui app you can load a simple web app in a WebView control. There are a couple of ways to do this. The first is to use the same approach as the web app option above. The second is to use the native methods on the WebView to generate a screenshot, like CapturePreviewAsync
- Overall, this approach would provide the most customization, lowest cost, and richest end user experience.
Solution 2: Create a custom rendering solution
- This approach is a lot more work, but can be just as cheap as solution 1, and provide a similar level of customization. I would only consider this approach if you only want a static map and need the ability to generate it without a display (e.g. backend service). I've worked with several companies over the years who took this approach, often as part of an automated system that generated PDF reports in response to some trigger (like an earthquake, and a report of impacted assets).
- With this approach you would use a drawing library like System.Drawing or SkiaSharp and manually create you image. You can download map tiles as needed from Azure Maps and overlay them on your custom image. I have an older code sample of this approach here: https://1drv.ms/u/s!AgFqp4QkIjUNqKgZa1YIIIQj5BbFMw?e=PcT0U4 It's not .NET core, but likely wouldn't take much to port over.
Solution 3: Consider a partner solution
Companies like ESRI have more robust web services for generating custom map images. There is a lot more ramp up and cost involved however, but would likely require less custom development.
Side note, these are developer forums, the whole dev community is here to help, not just the Azure support team. I haven't worked in a support team in at least 15 years but love helping others in the dev community :)