Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Marker Manager doesnt work in Maps API 3.10 [closed]

Marker Manager doesn't work on Google Maps API v3.10 and in current.

If you check it's example page http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0/examples/google_northamerica_offices.html you'll see that map is not changed by zoom control, and there is no any marker. And you will see the following JavaScript error:

Uncaught TypeError: Cannot call method 'substr' of undefined

But if you load Maps API for version v=3.9, then all will be OK (I checked it on my test page).

I think there is a bug in manager's script file.

like image 650
Dmitry Zhuk Avatar asked Nov 12 '22 17:11

Dmitry Zhuk


1 Answers

Marker Manager is not compatible with Google Maps API v 3.10 and above. Either specify the version when including Google Maps or change line 98 in markermanager.js (version 1.0) from

if (typeof map.mapTypes.get(sType) === 'object' && typeof map.mapTypes.get(sType).maxZoom === 'number') {

to

if (sType != "constructor" && typeof map.mapTypes.get(sType) === 'object' && typeof map.mapTypes.get(sType).maxZoom === 'number') {
like image 129
Emil Rasmussen Avatar answered Nov 15 '22 13:11

Emil Rasmussen