Question

Couple days ago markermanager stopped working properly with google maps. I have no error in console view.

It's breaking on line:

var div = this.getProjection().fromLatLngToDivPixel(latlng)

this is whole method:

ProjectionHelperOverlay.prototype.LatLngToPixel = function (latlng, zoom) {
alert('p1');//displays alert
var map = this._map;//object
alert('p2');//displays alert
alert(latlng);//displays object
var div = this.getProjection().fromLatLngToDivPixel(latlng);
alert('p3');//NO ALERT and NO error in console
var abs = {x: ~~(0.5 + this.LngToX_(latlng.lng()) * (2 << (zoom + 6))), y: ~~(0.5 + this.LatToY_(latlng.lat()) * (2 << (zoom + 6)))};
alert('p4');//never gets to that line
return abs;
};

Everything was fine before and I didn't make any changes. Could it be error with new google maps API code? I can't find newer version of markermanager. Is there any replacement for this script?

Was it helpful?

Solution

Are you either using the nightly/experimental version (v3.exp), v3 or an old version?

Versioning

If so the version of the maps API could have changed underneath your page. The Google Maps API team recommends you hardcode the version number on production pages and test newer versions before going live with them.

OTHER TIPS

I was having the same error, adding a listener to the loaded event did it for me:

 var mgr = new MarkerManager(map)
 google.maps.event.addListener(mgr, 'loaded', function(){
    mgr.addMarkers(markers, 5,6)
  });   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top