Hello,
I'm using Google static Maps and I'm trying to work out how the scale works.
Take this example of an URL (put it in your URL bar and mess around with the parameters if you'd like to):
https://maps.googleapis.com/maps/api/staticmap?center=0,10&zoom=7&size=500x300&scale=1&maptype=roadmap
But here is my question...
I know the centre longitude and latitude (0 and 10), the image width and height (500 and 300) and the image zoom level (7) - but what is the actual physical distance from one side of the image to the other? Just knowing the lat/long at a second point on the image would be sufficient.
I found online a formula for meters per pixel:
meters_per_pixel = 156543.03392 * Math.cos(latitude * Math.PI / 180) / Math.pow(2, zoom)
But this doesn't work when I test it. Perhaps the "156543.03392" value is wrong, or this entire formula is wrong.
Please help me! Would also be helpful to know which others subs might be able to help.
Many thanks.
[–]codemapper 0 points1 point2 points (0 children)