jawj / OverlappingMarkerSpiderfier

Deals with overlapping markers in Google Maps JS API v3, Google Earth-style
http://blog.mackerron.com
838 stars 237 forks source link

Infinite setZIndex with OverlayView marker #134

Closed crerem closed 7 years ago

crerem commented 7 years ago

Hi, I''m creating a custom google map marker with OverlayView. Everything works fine on my code until i try to spiderfy. First error i had was oms.min.js?ver=1.0:23 Uncaught TypeError: g.setZIndex is not a function , screencapture : http://prntscr.com/fe5zfx

which was normal because i did not defined the setZIndex method for my new marker.

After i defined the method - this is the code CustomMarker.prototype.setZIndex = function(value) { console.log("set z index "+value); this.setZIndex(value); return; };

The code enters into in infinite loop and the browser eventually crash. This is a screencapture from console: http://prntscr.com/fe61qg

Any ideea why this is happening ? Do i need to set something else beside the zIndex ? Thanks

jawj commented 7 years ago

Your setZIndex function appears to call itself?

crerem commented 7 years ago

Yes, I'm sorry for posting such silly mistake :) Thanks