OverlappingMarkerSpiderfier icon indicating copy to clipboard operation
OverlappingMarkerSpiderfier copied to clipboard

OverlappingMarkerSpiderfier is not defined

Open ludal74 opened this issue 9 years ago • 8 comments

Hi,

I dowloaded the min js file lib and include the code directly in my JS file ( on top ). But when I tried to instanciate the OverlappingMarkerSpiderfier Object I have the following error :

Uncaught ReferenceError: OverlappingMarkerSpiderfier is not defined

Thanks in advance

ludal74 avatar Feb 11 '15 08:02 ludal74

Solved by changing the init test in contructor : this.google in google.

Thanks for your work !

Very usefull tool for map

ludal74 avatar Feb 11 '15 09:02 ludal74

Would you mind explaining your fix? I was able to solve the issue on my side by loading the script after Google Maps.

nicbou avatar Apr 08 '15 13:04 nicbou

I just replaced in minify file A=this.google by A=google and i worked for me.

Keep in mind to load google map API "before" ( to have the google variable defined ) injecting" overlapping lib

ludal74 avatar Apr 08 '15 19:04 ludal74

The important thing here is getting the google maps API to load before the OMS library. At least for me, the line change is not necessary. Thanks for the tip it helped me solve the issue.

codedgeass avatar Jul 27 '15 07:07 codedgeass

I tried to replace file A=this.google by A=google, but it doesnt work for me. I still have "OverlappingMarkerSpiderfier is not defined"

tenznhok avatar Sep 30 '16 21:09 tenznhok

Google maps must load before OMS, and this can be a problem if using async defer. This is what I did to resolve the issue - first, load the Google Maps API in the head:

<script async defer src="https://maps.googleapis.com/maps/api/js?library=places"></script>

Then load OMS with just defer in the footer or before the closing body tag:

<script defer src="[your_url]/oms.min.js"></script>

This solved the OMS undefined problem for me by deferring the loading of OMS until after all preceding scripts have been loaded.

ImpactMind avatar Oct 03 '16 14:10 ImpactMind

I know why i have the problem. I actually have Google Map loads before OMS for sure, but it didnt solve my problem. The problem occurs when I put the OverlappingMarkerSpdierfier inside function initMap() {}. I change function initMap() {} to window.onload = function(){} and it works. I dont know why it doesnt work eventhough I have the script such as:

tenznhok avatar Oct 05 '16 13:10 tenznhok

tenznhok, thank you so much for your correct resolution. It is work perfectly with google mas v3.28.7 in all browsers (ie11, FF, Ch, Edge).

AngelTs avatar Mar 28 '17 11:03 AngelTs