Custom marker icon not working. Maps displaying default marker image instead

211 views Asked by At

I have a google static map where I am adding 4 markers with 4 different custom icons. Three of the icons work, but the fourth does not. Instead, one of the markers displays as the default orange pin. I also get Map error: g.co/staticmaperror in the top right corner.

I checked all of the icon urls in my browser, and they all returned proper images. If I randomly choose any three of the four icons, they will all display correctly.

I suspect that Google has a timeout when grabbing the icon images, and that if all of the image requests don't finish it a set amount of time, Google will just fallback to the default icon.

I have two questions.

  1. Is it possible to increase the timeout for generating the static map image?

  2. If not, is it possible to hide the marker when the custom image isn't available?

1

There are 1 answers

0
Dave On

This was my fault for not reading the documentation. There is currently a limit to 5 custom icons per static map request.