dburles / meteor-google-maps

🗺 Meteor package for the Google Maps Javascript API v3
https://atmospherejs.com/dburles/google-maps
MIT License
196 stars 49 forks source link

Issues setting up geolocation-marker utility #60

Closed DevanB closed 9 years ago

DevanB commented 9 years ago

I'm having issues getting geolocation-marker utility working. I've put the file in client/lib. After then add GoogleMaps.loadUtilityLibrary('client/lib/geolocationmarker-compiled.js'); to Template.map.onCreated just before GoogleMaps.ready function and I see an error in the console:

Uncaught ReferenceError: google is not defined

I'm new to Meteor, so struggling through getting the geolocation-marker utility working. Thanks for any help!

dburles commented 9 years ago

Hey place the library in your public directory.

DevanB commented 9 years ago

Doing that yields a new error:

Uncaught ReferenceError: GeolocationMarker is not defined

Here is a gist of my map.js: https://gist.github.com/DevanB/1b2f0437c9040b7a3a9a I have also tried it with the GoogleMaps.loadUtilityLibrary('/public/geolocationmarker-compiled.js'); just above the GoogleMaps.ready() function and it yields the same error and another:

Uncaught SyntaxError: Unexpected token < in geolocationmarker-compiled.js

dburles commented 9 years ago

@DevanB make sure that geolocationmarker-compiled.js only lives in the public directory and not elsewhere within your Meteor application. Assuming it's at the root of the public directory (public/geolocationmarker-compiled.js). Load it like so: GoogleMaps.loadUtilityLibrary('geolocationmarker-compiled.js');.

Also place the loadUtilityLibrary method alongside the load method, rather than inside the ready callback.