Hi @Richard Kooijman Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
I am just wondering if you have tried the async approach to get the static image. Please find the implementation for this through the link sample_get_map_static_image_async.py. Here is the code sample for your reference.
"""
FILE: sample_get_map_static_image_async.py
DESCRIPTION:
This sample demonstrates how to the static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20.
USAGE:
python sample_get_map_static_image_async.py
Set the environment variables with your own values before running the sample:
- AZURE_SUBSCRIPTION_KEY - your subscription key
"""
import asyncio
import os
subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY")
async def get_map_static_image_async():
# [START get_map_static_image_async]
from azure.core.credentials import AzureKeyCredential
from azure.maps.render.aio import MapsRenderClient
maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))
async with maps_render_client:
result = await maps_render_client.get_map_static_image(img_format="png", center=(52.41064,4.84228))
# [END get_map_static_image_async]
if __name__ == '__main__':
asyncio.run(get_map_static_image_async())
Please give it a try and let us know if this helps.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.