You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get "OverlappingMarkerSpiderfier is not a constructor" with my Google Maps web application. When this happens, naturally everything and anything after this is royally screwed up and ceases functioning on the page.
At first I was initializing OMS at the end after the map init, after having set all events. From a quick Google, the rule of thumb seems to be that Google Maps must be fully loaded before initializing or using OMS. So I tried the following.
What I've tried:
Using $(document).ready()
// Initialize OMS after the DOM tree is ready$(document).ready(function(){// Initializing OMSoms=newwindow.OverlappingMarkerSpiderfier(map,{markersWontMove: true,keepSpiderfied: true,nearbyDistance: 10,circleFootSeparation: 60,legWeight: 1.5});});
Using window.onload
functioninitOMS(){// Initializing OMSoms=newwindow.OverlappingMarkerSpiderfier(map,{markersWontMove: true,keepSpiderfied: true,nearbyDistance: 10,circleFootSeparation: 60,legWeight: 1.5});}// Initialize OMS after the Window is fully loadedwindow.onload=initOMS();
Neither of these seem to work though. Sometimes OMS will be fine, sometimes it will give out the console error "OverlappingMarkerSpiderfier is not a constructor".
This is on: Chrome Version 60.0.3112.113
The text was updated successfully, but these errors were encountered:
Ok, I seem to have found a working solution. Initialize OMS in Google Map's IDLE event. This seems to be the exact time Google Map's first registers that it's fully loaded and ready to go (as far as Google can tell me).
Hopefully this helps anyone else who attempts to Google this problem similar to mine. To the developers, if there is a better way, I'm all ears! I appreciate the library, it's very cool.
I get "OverlappingMarkerSpiderfier is not a constructor" with my Google Maps web application. When this happens, naturally everything and anything after this is royally screwed up and ceases functioning on the page.
At first I was initializing OMS at the end after the map init, after having set all events. From a quick Google, the rule of thumb seems to be that Google Maps must be fully loaded before initializing or using OMS. So I tried the following.
What I've tried:
Neither of these seem to work though. Sometimes OMS will be fine, sometimes it will give out the console error "OverlappingMarkerSpiderfier is not a constructor".
This is on:
Chrome Version 60.0.3112.113
The text was updated successfully, but these errors were encountered: