Leaflet/src/Leaflet.js

24 lines
565 B
JavaScript
Raw Normal View History

/*
* Leaflet namespace config, allows using any global variable instead of L & restoring the original value
*/
L = {
2010-09-17 16:01:49 +08:00
VERSION: '0.0.2',
2010-09-17 00:38:58 +08:00
ROOT_URL: (function() {
var scripts = document.getElementsByTagName('script');
for (var i = 0, len = scripts.length; i < len; i++) {
var src = scripts[i].src,
res = src && src.match(/^(.*\/)leaflet-*\w*\.js.*$/);
if (res && res[1]) { return res[1]; }
}
return '../dist/';
})(),
noConflict: function() {
window.L = this._originalL;
return this;
2010-09-17 00:38:58 +08:00
},
_originalL: window.L
};