We have a Qt program written in C++ to request wms tiles and display them. This works fine.

Now we want to display imaginery from Google Maps and due to some restrictions in our program, we can't use javascript and we have to directly manage the url. For example, in the wms case:


So I think the right choice for Google Maps would be the static API.

Now, reading it I didn't find anything regarding querying by bounding box. Only querying via a center and a zoom level.

Is that the only way to retrieve an image? Wouldn't it possible to query with a bounding box without specifying a center and the zoom level and retrieve an image representing that extension? Just like with the wms case before.

NOTE: I would like and url example if possible. We can't use javascript for this.

1 Answer 1


Google Static map api requires centre,lat/lng and pixel size as well as zoom level

This is a non-JavaScript version (but python) for working out the pixel dimensions.

You will need to modify to suit your needs but the key point is that it contains


Which take a cluster of points and calculate the zoom level and centre of the map required.

This method is used to take in a bounding box (southwest and northeast
bounds of the map view we want) and a map size and it will return us a zoom
level for our map.  We use this because if we take the bottom left and
upper right on the map we want to show, and calculate what pixels they
would be on the map for a given zoom level, then we can see how many pixels
it will take to display the map at this zoom level.  If our map size is
within this many pixels, then we have the right zoom level.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.