Closed jupiterkenji closed 8 years ago
Hey @stewiegaribaldi that's right you'll need to use that function to check whether the library has loaded before interacting with it. Typically you might attach it to the template that displays the map.
Template.myMap.onCreated(function() {
this.autorun(() => {
if (GoogleMaps.loaded()) {
ContextMenu.prototype = new google.maps.OverlayView();
ContextMenu.prototype.onAdd = function() {
// ...
}
}
});
});
Thank you @dburles , it works great!
I try to create context-menu by inheriting from google.maps.OverlayView() like so:
But it keeps saying google is not defined. I have been googling and people suggesting: if (GoogleMaps.loaded()) {..} But sounds a bit weird.
Does anyone have any knowledge on this?
Thank you. Great package!