I’m working on a project where i have to use dojo (i’m doing a custom widget) and the google map api (v3)
For some technical reason, i have to include the google map api through my js file and not through my html file, so i can’t use
<script type='text/javascript' src='http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places'></script>
The load have to be done synchronously.
I’ve tried some things, first adding the script using
document.write("<script type='text/javascript' src='http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places'></script>");
But that’s not working, i get a blank page instead, using firebug i can see that the panel “Network” is clearing and the page make an infinite loading of google map api script.
I think i can’t do it using dojo.io.script (which allow to make cross domain request), because we can’t make synchronous request with dojo.io.script
Any help will be appreciated 😉
Well, solution was to use google map callback :
Then make the function “mapLoaded” which execute the code
Thanks for those who taked time to answer me