var oldL = window.L,
L = {};
-L.version = '0.7.4';
+L.version = '0.7.7';
// define Leaflet for Node module pattern loaders, including Browserify
if (typeof module === 'object' && typeof module.exports === 'object') {
mobile = typeof orientation !== undefined + '',
msPointer = !window.PointerEvent && window.MSPointerEvent,
- pointer = (window.PointerEvent && window.navigator.pointerEnabled && window.navigator.maxTouchPoints) ||
+ pointer = (window.PointerEvent && window.navigator.pointerEnabled) ||
msPointer,
retina = ('devicePixelRatio' in window && window.devicePixelRatio > 1) ||
('matchMedia' in window && window.matchMedia('(min-resolution:144dpi)') &&
update: function () {
if (this._icon) {
- var pos = this._map.latLngToLayerPoint(this._latlng).round();
- L.Util.requestAnimFrame(function () {
- this._setPos(pos);
- }, this);
+ this._setPos(this._map.latLngToLayerPoint(this._latlng).round());
}
-
return this;
},
if (options.title) {
icon.title = options.title;
}
-
+
if (options.alt) {
icon.alt = options.alt;
}
layer = this._layers[layer];
}
- layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
+ if ('off' in layer) {
+ layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
+ }
L.LayerGroup.prototype.removeLayer.call(this, layer);
},
_fireMouseEvent: function (e) {
- if (!this.hasEventListeners(e.type)) { return; }
+ if (!this._map || !this.hasEventListeners(e.type)) { return; }
var map = this._map,
containerPoint = map.mouseEventToContainerPoint(e),
pointers = this._pointers;
var cb = function (e) {
-
- L.DomEvent.preventDefault(e);
+ if (e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
+ L.DomEvent.preventDefault(e);
+ }
var alreadyInArray = false;
for (var i = 0; i < pointers.length; i++) {
L.DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
- this._resetView(this._animateToCenter, this._animateToZoom, true, true);
+ L.Util.requestAnimFrame(function () {
+ this._resetView(this._animateToCenter, this._animateToZoom, true, true);
- if (L.Draggable) {
- L.Draggable._disabled = false;
- }
+ if (L.Draggable) {
+ L.Draggable._disabled = false;
+ }
+ }, this);
}
});