commit cd011e904029bddab9de9ac7f4025814dd46c248
parent 08803c5f849514c698f4616454712066467e312e
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Mon, 20 Mar 2017 11:49:30 +0300
removed workarounds for bug with click event when enter pressed in: panoramas, canvasMarkers, wikimapia, line edit
Diffstat:
4 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/src/lib/leaflet.control.panoramas/index.js b/src/lib/leaflet.control.panoramas/index.js
@@ -89,10 +89,7 @@ L.Control.Panoramas = L.Control.extend({
},
onMapClick: function(e) {
- // click event on map can be from keypress with keycode=13 in which case it doesnot have position
- if (e.latlng) {
- this.showPanoramaAtPos(e.latlng);
- }
+ this.showPanoramaAtPos(e.latlng);
},
showPanoramaAtPos: function(latlng, pov) {
diff --git a/src/lib/leaflet.layer.canvasMarkers/index.js b/src/lib/leaflet.layer.canvasMarkers/index.js
@@ -326,9 +326,6 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({
},
findMarkerFromMouseEvent: function(e) {
- if (!e.latlng) {
- return;
- }
const
p = this._map.project(e.latlng),
region = this._regions.search({minX: p.x, minY: p.y, maxX: p.x, maxY: p.y})[0];
diff --git a/src/lib/leaflet.layer.wikimapia/index.js b/src/lib/leaflet.layer.wikimapia/index.js
@@ -146,9 +146,6 @@ L.Wikimapia = L.GridLayer.extend({
},
getPlaceAtMousePos: function(e) {
- if (!e.layerPoint) {
- return;
- }
const tileCoords = this._tileCoordsFromEvent(e);
let tile = this._tiles[this._tileCoordsToKey(tileCoords)];
if (!tile) {
diff --git a/src/lib/leaflet.polyline-edit/index.js b/src/lib/leaflet.polyline-edit/index.js
@@ -85,11 +85,8 @@ L.Polyline.EditMixin = {
onMapClick: function(e) {
if (this._drawingDirection) {
- // click event on map can be from keypress with keycode=13 in which case it doesnot have position
- if (e.latlng) {
- var newNodeIndex = this._drawingDirection === -1 ? 1 : this.getLatLngs().length - 1;
- this.addNode(newNodeIndex, e.latlng);
- }
+ var newNodeIndex = this._drawingDirection === -1 ? 1 : this.getLatLngs().length - 1;
+ this.addNode(newNodeIndex, e.latlng);
} else {
if (!this.preventStopEdit) {
this.stopEdit();