Google Static Map occasionally maps the path differently to the dynamic google map

156 Views Asked by At

I extract coordinates on google maps by plotting an overlay (exhibit A). I then reuse these same coordinates as the path variable in the google static map (exhibit B) and for some locations, it does not plot to the same location.

I then typed out a CSV file that I can import into the google maps web app to add a new overlay and it mapped correctly, which tells me there is something strange happening in the google maps static map.

Sample CSV import for testing overlay

lat,lon,title,
-26.052937841371918,28.060764598707202,Test 1,
-26.052994468511443,28.060752528766635,Test 2,
-26.05304868595982,28.06076996312523,Test 3,
-26.053040252136153,28.061060982803347,Test 4,
-26.052978805688355,28.060979845980647,Test 5,
-26.052934226872722,28.06093357787514,Test 6,

Exhibit A:

enter image description here

Exhibit B: enter image description here

Exhibit B in terms of the google static map:

https://maps.googleapis.com/maps/api/staticmap?scale=2&zoom=20&size=500x500&maptype=satellite&geodesic=true&path=color%3A0x00000000%7Cweight%3A1%7Cfillcolor%3Aorange%7C-26.052950%2C28.060751%7C-26.052940%2C28.060928%7C-26.053038%2C28.061048%7C-26.053054%2C28.060762&key=[input your google API key here]

The exact same code generates the following output also (correct output)

Sample 1:

enter image description here

Sample 2:

enter image description here

So it isn't an issue of the code, as most outputs are correct, but rather something strange occurs on specific instances that as you can see in Exhibit B, there is a non-negligible shift in the points of latitude.

0

There are 0 best solutions below