Created
January 22, 2015 10:20
-
-
Save jojoob/1f8f35b95d075b82c4e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M.block_geolocation = M.block_geolocation || {}; | |
M.block_geolocation.leaflet = { | |
load: function(fn) { | |
if (!this.inited) { | |
this.inited = true; | |
var leafletpath = M.cfg.wwwroot + '/lib/leaflet-0.7.3/'; | |
Y.Get.css(leafletpath + '/leaflet.css', function (err) { | |
if(!err) { | |
Y.Get.js([leafletpath + '/leaflet.js'], function (err) { | |
if (!err) { | |
console.log("leaflet-for-yui Info: leaflet loaded"); | |
L.Icon.Default.imagePath = leafletpath + '/images'; | |
if (typeof(fn) === 'function') { | |
fn(); | |
} | |
} else { | |
Y.Array.each(err, function (error) { | |
Y.log(error, 'error', 'leaflet-for-yui'); | |
}); | |
} | |
}); | |
} else { | |
Y.log(err, 'error', 'leaflet-for-yui'); | |
} | |
}); | |
} else { | |
if (typeof(fn) === 'function') { | |
fn(); | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment