I am trying to executing the following code using steal.js (from javascriptmvc extention):
steal("http://maps.google.com/maps/api/js?sensor=true");
This is working for all other scripts. But, in case of google map api url, its saying "'sensor' parameter isn't set" type error message. How to get rid of this please?
If you can show some other way to load this script asynchronously, that will be ok as well. Like, I tried with google js api loader, but that support for loading google map api up to version 2, no support for 3. Thanks in advance.
You don't typically steal external scripts. steal wont be able to build them into your production file.
Regardless, the current Google Maps API is not intended to be loaded asynchronously. If you examine the source, you'll see it usesdocument.write
, which wont work properly after the page has loaded without the help of a 3rd party library.Per the comment below, I was wrong. You can load Google Maps asynchronously using the callback parameter: