Update to leaflet v.0.7.5

This commit is contained in:
David Molineus
2015-10-15 22:16:30 +02:00
parent 15b4cb565c
commit 7d8c0da0d2
5 changed files with 40 additions and 57 deletions

View File

@@ -12,7 +12,7 @@ Contao CMS.
This package contains following packages: This package contains following packages:
- [leaflet 0.7.3](http://leafletjs.com) - [leaflet 0.7.5](http://leafletjs.com)
- [Leaflet-providers 1.0.12](http://leaflet-extras.github.io/leaflet-providers) - [Leaflet-providers 1.0.12](http://leaflet-extras.github.io/leaflet-providers)
- [Leaflet.markercluster 0.4.0](https://github.com/Leaflet/Leaflet.markercluster) - [Leaflet.markercluster 0.4.0](https://github.com/Leaflet/Leaflet.markercluster)
- [Leaflet-omnivore 0.3.2](https://github.com/mapbox/leaflet-omnivore) - [Leaflet-omnivore 0.3.2](https://github.com/mapbox/leaflet-omnivore)

View File

@@ -7,7 +7,7 @@
var oldL = window.L, var oldL = window.L,
L = {}; L = {};
L.version = '0.7.3'; L.version = '0.7.5';
// define Leaflet for Node module pattern loaders, including Browserify // define Leaflet for Node module pattern loaders, including Browserify
if (typeof module === 'object' && typeof module.exports === 'object') { if (typeof module === 'object' && typeof module.exports === 'object') {
@@ -519,8 +519,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent;
gecko = ua.indexOf('gecko') !== -1, gecko = ua.indexOf('gecko') !== -1,
mobile = typeof orientation !== undefined + '', mobile = typeof orientation !== undefined + '',
msPointer = window.navigator && window.navigator.msPointerEnabled && msPointer = !window.PointerEvent && window.MSPointerEvent,
window.navigator.msMaxTouchPoints && !window.PointerEvent,
pointer = (window.PointerEvent && window.navigator.pointerEnabled && window.navigator.maxTouchPoints) || pointer = (window.PointerEvent && window.navigator.pointerEnabled && window.navigator.maxTouchPoints) ||
msPointer, msPointer,
retina = ('devicePixelRatio' in window && window.devicePixelRatio > 1) || retina = ('devicePixelRatio' in window && window.devicePixelRatio > 1) ||
@@ -534,38 +533,8 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent;
opera3d = 'OTransition' in doc.style, opera3d = 'OTransition' in doc.style,
any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d) && !phantomjs; any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d) && !phantomjs;
var touch = !window.L_NO_TOUCH && !phantomjs && (pointer || 'ontouchstart' in window ||
// PhantomJS has 'ontouchstart' in document.documentElement, but doesn't actually support touch. (window.DocumentTouch && document instanceof window.DocumentTouch));
// https://github.com/Leaflet/Leaflet/pull/1434#issuecomment-13843151
var touch = !window.L_NO_TOUCH && !phantomjs && (function () {
var startName = 'ontouchstart';
// IE10+ (We simulate these into touch* events in L.DomEvent and L.DomEvent.Pointer) or WebKit, etc.
if (pointer || (startName in doc)) {
return true;
}
// Firefox/Gecko
var div = document.createElement('div'),
supported = false;
if (!div.setAttribute) {
return false;
}
div.setAttribute(startName, 'return;');
if (typeof div[startName] === 'function') {
supported = true;
}
div.removeAttribute(startName);
div = null;
return supported;
}());
L.Browser = { L.Browser = {
ie: ie, ie: ie,
@@ -1632,15 +1601,16 @@ L.Map = L.Class.extend({
var paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]), var paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]),
paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]), paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]),
zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)), zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));
paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),
zoom = (options.maxZoom) ? Math.min(options.maxZoom, zoom) : zoom;
var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),
swPoint = this.project(bounds.getSouthWest(), zoom), swPoint = this.project(bounds.getSouthWest(), zoom),
nePoint = this.project(bounds.getNorthEast(), zoom), nePoint = this.project(bounds.getNorthEast(), zoom),
center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom); center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);
zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom;
return this.setView(center, zoom, options); return this.setView(center, zoom, options);
}, },
@@ -2782,7 +2752,7 @@ L.TileLayer = L.Class.extend({
} }
if (options.bounds) { if (options.bounds) {
var tileSize = options.tileSize, var tileSize = this._getTileSize(),
nwPoint = tilePoint.multiplyBy(tileSize), nwPoint = tilePoint.multiplyBy(tileSize),
sePoint = nwPoint.add([tileSize, tileSize]), sePoint = nwPoint.add([tileSize, tileSize]),
nw = this._map.unproject(nwPoint), nw = this._map.unproject(nwPoint),
@@ -3567,10 +3537,8 @@ L.Marker = L.Class.extend({
update: function () { update: function () {
if (this._icon) { if (this._icon) {
var pos = this._map.latLngToLayerPoint(this._latlng).round(); this._setPos(this._map.latLngToLayerPoint(this._latlng).round());
this._setPos(pos);
} }
return this; return this;
}, },
@@ -3593,7 +3561,7 @@ L.Marker = L.Class.extend({
if (options.title) { if (options.title) {
icon.title = options.title; icon.title = options.title;
} }
if (options.alt) { if (options.alt) {
icon.alt = options.alt; icon.alt = options.alt;
} }
@@ -4228,6 +4196,7 @@ L.Marker.include({
if (content instanceof L.Popup) { if (content instanceof L.Popup) {
L.setOptions(content, options); L.setOptions(content, options);
this._popup = content; this._popup = content;
content._source = this;
} else { } else {
this._popup = new L.Popup(options, this) this._popup = new L.Popup(options, this)
.setContent(content); .setContent(content);
@@ -5114,6 +5083,13 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :
if (options.fill) { if (options.fill) {
this._ctx.fillStyle = options.fillColor || options.color; this._ctx.fillStyle = options.fillColor || options.color;
} }
if (options.lineCap) {
this._ctx.lineCap = options.lineCap;
}
if (options.lineJoin) {
this._ctx.lineJoin = options.lineJoin;
}
}, },
_drawPath: function () { _drawPath: function () {
@@ -5151,7 +5127,7 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :
if (options.fill) { if (options.fill) {
ctx.globalAlpha = options.fillOpacity; ctx.globalAlpha = options.fillOpacity;
ctx.fill(); ctx.fill(options.fillRule || 'evenodd');
} }
if (options.stroke) { if (options.stroke) {
@@ -5166,15 +5142,14 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :
_initEvents: function () { _initEvents: function () {
if (this.options.clickable) { if (this.options.clickable) {
// TODO dblclick
this._map.on('mousemove', this._onMouseMove, this); this._map.on('mousemove', this._onMouseMove, this);
this._map.on('click', this._onClick, this); this._map.on('click dblclick contextmenu', this._fireMouseEvent, this);
} }
}, },
_onClick: function (e) { _fireMouseEvent: function (e) {
if (this._containsPoint(e.layerPoint)) { if (this._containsPoint(e.layerPoint)) {
this.fire('click', e); this.fire(e.type, e);
} }
}, },
@@ -8952,10 +8927,13 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : {
delta: delta, delta: delta,
backwards: backwards backwards: backwards
}); });
// horrible hack to work around a Chrome bug https://github.com/Leaflet/Leaflet/issues/3689
setTimeout(L.bind(this._onZoomTransitionEnd, this), 250);
}, this); }, this);
}, },
_onZoomTransitionEnd: function () { _onZoomTransitionEnd: function () {
if (!this._animatingZoom) { return; }
this._animatingZoom = false; this._animatingZoom = false;
@@ -9001,6 +8979,11 @@ L.TileLayer.include({
// force reflow // force reflow
L.Util.falseFn(bg.offsetWidth); L.Util.falseFn(bg.offsetWidth);
var zoom = this._map.getZoom();
if (zoom > this.options.maxZoom || zoom < this.options.minZoom) {
this._clearBgBuffer();
}
this._animating = false; this._animating = false;
}, },

View File

@@ -278,12 +278,12 @@
border-radius: 5px; border-radius: 5px;
} }
.leaflet-control-layers-toggle { .leaflet-control-layers-toggle {
background-image: url('images/layers.png'); background-image: url(images/layers.png);
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.leaflet-retina .leaflet-control-layers-toggle { .leaflet-retina .leaflet-control-layers-toggle {
background-image: url('images/layers-2x.png'); background-image: url(images/layers-2x.png);
background-size: 26px 26px; background-size: 26px 26px;
} }
.leaflet-touch .leaflet-control-layers-toggle { .leaflet-touch .leaflet-control-layers-toggle {

File diff suppressed because one or more lines are too long

View File

@@ -17,7 +17,7 @@
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array $GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
( (
'name' => 'Leaflet', 'name' => 'Leaflet',
'version' => '0.7.3', 'version' => '0.7.5',
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>', 'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
'homepage' => 'http://leafletjs.com', 'homepage' => 'http://leafletjs.com',
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css', 'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',