I load google maps api using the async tag provided (below). I want to load a javascript file (that contains some class definitions that extend google maps api). How can I make sure the javascript is loaded after the Google Maps API JS is loaded?
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=***************&callback=initMap">
</script>
I tried putting this in the initMap function to load the javascript but it still loaded the js too quickly and consequently the "google is not defined" errors still occurred
$.getScript("/assets/js/ContextMenu.js");
&callback=initMap?initMapfunction to initiate your other plugin as well, or set the callback to something else that initiates your plugin and then callsinitMap