hpneo / gmaps

the easiest way to use Google Maps
https://hpneo.dev/gmaps/
7.02k stars 1.28k forks source link

Dynamically loading along with Gmaps #557

Open jarodium opened 7 years ago

jarodium commented 7 years ago

Hello.

I was looking at this code

`

document.addEventListener('DOMContentLoaded', function () { var element = document.createElement('script'); element.src = 'http://maps.google.com/maps/api/js?sensor=true&callback=Initialize'; element.type = 'text/javascript'; var scripts = document.getElementsByTagName('script')[0]; scripts.parentNode.insertBefore(element, scripts); }, false); ` And was wondering how to link Gmaps after it. The "Initialize" callback should load Gmaps and after Gmaps another "Init..." function should be there. That's what I infer from this snippet.

Is there any way to load Google Maps and Gmaps and use only one callback for init?

Best regards

wrabit commented 6 years ago

+1