Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google static map is not displaying

I am listing lots of businesses and their static google maps in my page (with a pagination). While going through the pages, sometimes Im getting the following image instead of maps. And if I refresh the page again, I will get the correct maps.

enter image description here

I am sure that I have not reached the usage limit (because Im getting the same maps on page refresh).

My sample request is given below . (Note: I am not passing any API key. Is it really required ? )

<img src="//maps.googleapis.com/maps/api/staticmap?center=168 Palmers Lane Pokolbin,POKOLBIN,NSW,2320,Australia&zoom=11&size=240x180&maptype=roadmap&sensor=false" />
like image 473
binoy Avatar asked Oct 15 '25 04:10

binoy


1 Answers

Pass encodeURI-ed urls to src:

<img src="//maps.googleapis.com/maps/api/staticmap?center=168%20Palmers%20Lane%20Pokolbin,POKOLBIN,NSW,2320,Australia&zoom=11&size=240x180&maptype=roadmap&sensor=false" />
like image 91
Engineer Avatar answered Oct 17 '25 00:10

Engineer