scottdejonge / map-icons

An icon font for use with Google Maps API and Google Places API using SVG markers and icon labels
http://map-icons.com/
MIT License
1.05k stars 198 forks source link

Google Maps Async #42

Closed tiarebalbi closed 8 years ago

tiarebalbi commented 8 years ago

Hi,

I'm was trying to use map-icons, but i'm having a problem when i try to use the icons lib in a page with async loader.

As we know async call can have some time to have your content loaded and in the code of map-icons.js we have a method loading in the initialization.

https://github.com/scottdejonge/map-icons/blob/master/dist/js/map-icons.js#L41-L42

Error:

Uncaught ReferenceError: google is not defined(anonymous function) @ map-icons.js:42 util.js:32 Google Maps API warning: SensorNotRequired: https://developers.google.com/maps/documentation/javascript/error-messages

Loader Timeline

scottdejonge commented 8 years ago

Map Icons must be loaded after the Google Maps API. These function errors are a result of Map Icons extending the Google Map Marker Class allowing for the label to be added.

georgiosgeorgiadis commented 8 years ago

Just in case anyone else has the same problem, try to load google maps synchronously. This was causing the problem for me

otr-tomek commented 7 years ago

+1