Вопрос

Beginning today, my Static Maps are showing a new behavior. My custom markers no longer display their shadows, and as a result their positions are wrong. I remember something like this happened with the introduction of 'visual refresh', however I am not using that parameter.

I tried adding shadow:true (shouldn't be necessary) and this seems to be ignored.

I realise that today (19 November 2013) is the day that v2 of the Google Maps API will be retired, so maybe my problem is related to that.

Can anyone shed light on this mystery?

Это было полезно?

Решение

As of today (20 November 2013), the Google Static Maps API documentation has not been updated to reflect a change in the display of custom icons that appears to be linked with the retirement of Google Maps API v2.

Prior to the v2 retirement, static maps custom icons displayed a shadow (shadow:true was the default); their "anchor point" was set at the bottom center of the custom icon image, from where the shadow was cast. Now, shadows are turned off by default (a bug?) and the anchor point is set at the center of the custom icon image. The image effectively obscures the point, making my maps "pointless".

To remedy this, I added visual_refresh=false to my URLs. The visual_refresh parameter was introduced earlier this year as a way for developers to opt-in to the new, beautified maps. See: http://googlegeodevelopers.blogspot.ch/2013/05/a-fresh-new-look-for-maps-api-for-all.html

The example image illustrating Google Static Maps custom icons (see: https://developers.google.com/maps/documentation/staticmaps/index#CustomIcons) no longer displays as it should (shadows on by default). Adding visual_refresh=false to the image src URL returns the map to its intended state.

I don't know for how long this solution will be necessary. It would be great if someone from Google would update this question when the Static Maps API is corrected!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top