-
Notifications
You must be signed in to change notification settings - Fork 137
Support the asynchronous maps API. #1
Comments
I think we can just add
@brendankenny wdyt? |
Wait no, that would override all of the other methods we've added already. Hm. |
Assigning the prototype like that would happen too late. When you assign the prototype within the constructor, it's assigned after first instantiation. Copying the OverlayView properties to extend MapLabel is the simplest method I can think of. |
JimBobSquarePants: Your solution works, thanks. Perhaps open a pull request? |
I'm experiencing the same issue as @JimBobSquarePants |
I experienced the same error.
In routeMain.js: function initMap() { |
Any solution on this issue. |
At present the script requires the core map code to be already present in the page which prevents asynchronous loading of maps whilst using the MapLabel function.
https://github.com/googlemaps/js-map-label/blob/gh-pages/src/maplabel.js#L44
It would be better, in my opinion, if the prototypical properties were copied from
OverlayView
on firstinstance of the constructor getting initialised. That would allow someone to asynchronously load the map script and instantiate inheritance when calling
new MapLabel
for the first time.The text was updated successfully, but these errors were encountered: