update other libs

This commit is contained in:
Norbert Renner 2014-05-14 16:01:20 +02:00
parent e4ae9b5533
commit aa1e051cfd
31 changed files with 679 additions and 719 deletions

View file

@ -1,3 +1,4 @@
/* global console: true */
L.BingLayer = L.TileLayer.extend({
options: {
subdomains: [0, 1, 2, 3],
@ -20,20 +21,19 @@ L.BingLayer = L.TileLayer.extend({
for (var i = z; i > 0; i--) {
var digit = 0;
var mask = 1 << (i - 1);
if ((x & mask) != 0) digit += 1;
if ((y & mask) != 0) digit += 2;
if ((x & mask) !== 0) digit += 1;
if ((y & mask) !== 0) digit += 2;
quad = quad + digit;
}
return quad;
},
getTileUrl: function(p, z) {
var z = this._getZoomForUrl();
var zoom = this._getZoomForUrl();
var subdomains = this.options.subdomains,
s = this.options.subdomains[Math.abs((p.x + p.y) % subdomains.length)];
return this._url.replace('{subdomain}', s)
.replace('{quadkey}', this.tile2quad(p.x, p.y, z))
.replace('http:', document.location.protocol)
.replace('{quadkey}', this.tile2quad(p.x, p.y, zoom))
.replace('{culture}', this.options.culture);
},
@ -46,17 +46,18 @@ L.BingLayer = L.TileLayer.extend({
var e = document.getElementById(cbid);
e.parentNode.removeChild(e);
if (meta.errorDetails) {
if (window.console) console.log("Leaflet Bing Plugin Error - Got metadata: " + meta.errorDetails);
if (window.console) console.log('Leaflet Bing Plugin Error - Got metadata: ' + meta.errorDetails);
return;
}
_this.initMetadata();
};
var url = document.location.protocol + "//dev.virtualearth.net/REST/v1/Imagery/Metadata/" + this.options.type + "?include=ImageryProviders&jsonp=" + cbid + "&key=" + this._key;
var script = document.createElement("script");
script.type = "text/javascript";
var url = document.location.protocol + '//dev.virtualearth.net/REST/v1/Imagery/Metadata/' + this.options.type + '?include=ImageryProviders&jsonp=' + cbid +
'&key=' + this._key + '&UriScheme=' + document.location.protocol.slice(0, -1);
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
script.id = cbid;
document.getElementsByTagName("head")[0].appendChild(script);
document.getElementsByTagName('head')[0].appendChild(script);
},
initMetadata: function() {
@ -84,7 +85,7 @@ L.BingLayer = L.TileLayer.extend({
},
_update: function() {
if (this._url == null || !this._map) return;
if (this._url === null || !this._map) return;
this._update_attribution();
L.TileLayer.prototype._update.apply(this, []);
},