MarkerWithLabel stopped working correctly

2019-02-21 21:46发布

问题:

All of a sudden yesterday 3/4/2014 my MarkerWithLabel (Google map API application) is only showing the last marker but the labels all show up. It had been working just fine. The Google Example at: https://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.0.1/examples/basic.html is not working at all and I based my code on this example that used to work just fine.

In link below I placed 2 markers with labels on a map. Only marker 2 displays while both labels display. Reversing the markers causes marker 2 to display but not marker 1. Both labels display.

What changed or what am I doing wrong?

You can see my problem first hand at http://qsomap.org/QSOmapProduction/labeltest.htm . This was working correctly 2 days ago.

回答1:

It appears as if the latest google maps update broke something that markerwithlabel code relies on. The same thing happend to some of my maps. We'll have to wait until a fix is available.

The current solution is to set the google maps API version to 3.15 or lower: https://code.google.com/p/google-maps-utility-library-v3/issues/detail?id=296&sort=-id&colspec=ID%20Type%20Status%20Priority%20Fixed%20Owner%20Summary%20Stars

  • Using ...maps.google.com/maps/api/js?sensor=false&v=3.15 works
  • Using ...maps.google.com/maps/api/js?sensor=false&v=3.16 goes wrong
  • Using ...maps.google.com/maps/api/js?sensor=false goes wrong as well


回答2:

The most recent Google API update (4th APR 2018) has broken my version of MarkerWithLabel. I have not yet tested MarkerWithLabel 1.9.1, but it is still the current and most recent update (I was on an older build). Here is a link to the latest version:

https://github.com/googlemaps/v3-utility-library/tree/master/markerwithlabel

I have reverted to an older version by including &v=3.31 in the URL and this has restored functionality, many thanks to @Mikrohard for the tip.

I'm not moving until I've investigated if the update has broken other libraries such as map clusters.



标签: api maps