I have to load a JS file
requirejs([
MyCode/mapview
],
function () {
});
Now this depends on google maps as I also do
require( ["http://maps.google.com/maps/api/js?v=3.2&sensor=false"],
function() {
var gm = document.createElement('script');
gm.type = 'text/javascript'; gm.async = true;
gm.src = document.location.protocol + "//maps.google.com/maps/api/js?v=3.2&sensor=false";
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gm, s);
}
);
just before that in my reuqire js include file. I have used shim command to load other local JS dependencies, but I am confused as to how to assign this dependency (google maps, http accessed file) to my MyCode/mapview.
How should I do this in shim? and also run the function before I load mapview.js?
requirejs.config({
shim:
{
'MyCode/mapview': ['????'],
}
});
I know of the dependency as I get this error, which is a google maps type Uncaught TypeError: Cannot read property 'HYBRID' of undefined