Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An async require.js declaration of Bing Maps, requires jQuery deferreds.
define('bingMaps',['async!//!OnScriptLoad'], function() {
var mapReadyDfd = $.Deferred(),
mapReadyTest = function () {
if (window.Microsoft && window.Microsoft.Maps && window.Microsoft.Maps.Location) {
else {
setTimeout(mapReadyTest, 100);
return mapReadyDfd.promise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment