From f90810e6e8df38665784cb5b8e0eb874ee10a73f Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Tue, 11 Jun 2019 14:08:11 -0400 Subject: [PATCH] loleaflet: mobile: rename Map.CalcTap to Map.TouchGesture Change-Id: Ibcb45d87fcf5a0ea98bec06816e9085c6fe28937 --- loleaflet/build/deps.js | 2 +- loleaflet/src/layer/marker/Marker.js | 4 ++-- loleaflet/src/map/Map.js | 2 +- .../handler/{Map.CalcTap.js => Map.TouchGesture.js} | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) rename loleaflet/src/map/handler/{Map.CalcTap.js => Map.TouchGesture.js} (96%) diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js index 82652bfe8..23b0815c3 100644 --- a/loleaflet/build/deps.js +++ b/loleaflet/build/deps.js @@ -237,7 +237,7 @@ var deps = { 'core/Handler.js', 'map/handler/Map.TouchZoom.js', 'map/handler/Map.Tap.js', - 'map/handler/Map.CalcTap.js'], + 'map/handler/Map.TouchGesture.js'], deps: ['AnimationZoom'], desc: 'Enables smooth touch zoom / tap / longhold / doubletap on iOS, IE10, Android.' }, diff --git a/loleaflet/src/layer/marker/Marker.js b/loleaflet/src/layer/marker/Marker.js index f20b892e5..3db3dbfd9 100644 --- a/loleaflet/src/layer/marker/Marker.js +++ b/loleaflet/src/layer/marker/Marker.js @@ -56,8 +56,8 @@ L.Marker = L.Layer.extend({ }, onDown: function () { - if (this._map && this._map.touchCalc) { - this._map.touchCalc.disable(); + if (this._map && this._map.touchGesture) { + this._map.touchGesture.disable(); } }, diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index c23b6b95a..17ca49206 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -117,7 +117,7 @@ L.Map = L.Evented.extend({ this.options.inertia = false; this.dragging._draggable._manualDrag = true; this._mainEvents('off'); - this.addHandler('touchCalc', L.Map.CalcTap); + this.addHandler('touchGesture', L.Map.TouchGesture); this.addHandler('touchZoom', L.Map.TouchZoom); } else { this.addHandler('mouse', L.Map.Mouse); diff --git a/loleaflet/src/map/handler/Map.CalcTap.js b/loleaflet/src/map/handler/Map.TouchGesture.js similarity index 96% rename from loleaflet/src/map/handler/Map.CalcTap.js rename to loleaflet/src/map/handler/Map.TouchGesture.js index 58613175a..a3224c226 100644 --- a/loleaflet/src/map/handler/Map.CalcTap.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -4,11 +4,11 @@ */ L.Map.mergeOptions({ - touchCalc: true, + touchGesture: true, }); /* global Hammer $ */ -L.Map.CalcTap = L.Handler.extend({ +L.Map.TouchGesture = L.Handler.extend({ initialize: function (map) { L.Handler.prototype.initialize.call(this, map); @@ -82,8 +82,8 @@ L.Map.CalcTap = L.Handler.extend({ }, _onDocUp: function () { - if (!this._map.touchCalc.enabled()) { - this._map.touchCalc.enable(); + if (!this._map.touchGesture.enabled()) { + this._map.touchGesture.enable(); } }, @@ -145,7 +145,7 @@ L.Map.CalcTap = L.Handler.extend({ latlng = this._map.layerPointToLatLng(layerPoint), mousePos = this._map._docLayer._latLngToTwips(latlng); - if (this._map._docLayer._cellCursor.contains(latlng)) { + if (this._map._docLayer._cellCursor && this._map._docLayer._cellCursor.contains(latlng)) { this._cellSelections = true; this._map._docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, 1, 0); } else {