Yankovsky / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

On goole map v3.10 marker manager error. #211

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Last time I use marker manage on google map V3.9 and everything is ok.
But when google map update to version 3.10, I see JS error in file marker 
manage.

JS error:

Error: TypeError: bounds is undefined
Source File: http://localhost:88/google_map_v3/js/markermanager_packed.js
Line: 769

I'm using marker manage version 1.1

Everybody, please help me. 
Thanks so much!!

Original issue reported on code.google.com by le.thanh...@greensun.com.vn on 21 Nov 2012 at 8:09

GoogleCodeExporter commented 9 years ago
Having the same problem here. 

Looks like an issue in the MarkerManager at line 97 because sType will throw an 
error for the "constructor" property:

  for (var sType in mapTypes ) {
      if (typeof map.mapTypes.get(sType) …

We have to add `mapTypes.hasOwnProperty(sType)` to the condition:

  for (var sType in mapTypes ) {
    if (mapTypes.hasOwnProperty(sType) && typeof map.mapTypes.get(sType) === 'object' && typeof map.mapTypes.get(sType).maxZoom === 'number') {
      var mapTypeMaxZoom = map.mapTypes.get(sType).maxZoom;
      if (mapTypeMaxZoom > mapMaxZoom) {
        mapMaxZoom = mapTypeMaxZoom;
      }
    }
  }

Hope this fixes your issue!

– Martin

Original comment by kleppe on 21 Nov 2012 at 10:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
yes it works.
Thanks Martin.

Original comment by le.thanh...@greensun.com.vn on 21 Nov 2012 at 11:08

GoogleCodeExporter commented 9 years ago
it worked for me too.
Thanks Martin

Original comment by JCA...@gmail.com on 21 Nov 2012 at 8:46