Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
elmarquis committed Aug 9, 2018
2 parents 08fe4fd + 64683d3 commit 5f8c613
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 125 deletions.
5 changes: 3 additions & 2 deletions dist/leaflet-gesture-handling.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-webkit-animation: leaflet-gestures-fadein 0.8s backwards;
animation: leaflet-gestures-fadein 0.8s backwards;
color: #fff;
font-family: 'Roboto', Arial, sans-serif;
font-family: "Roboto", Arial, sans-serif;
font-size: 22px;
-webkit-box-pack: center;
-ms-flex-pack: center;
Expand All @@ -35,7 +35,8 @@
z-index: 461;
pointer-events: none; }

.leaflet-gesture-handling-touch-warning:after, .leaflet-gesture-handling-scroll-warning:after {
.leaflet-gesture-handling-touch-warning:after,
.leaflet-gesture-handling-scroll-warning:after {
-webkit-animation: leaflet-gestures-fadein 0.8s forwards;
animation: leaflet-gestures-fadein 0.8s forwards; }

Expand Down
41 changes: 22 additions & 19 deletions dist/leaflet-gesture-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,17 @@
this._map._container.addEventListener("touchstart", this._handleTouch);
this._map._container.addEventListener("touchmove", this._handleTouch);
this._map._container.addEventListener("touchend", this._handleTouch);
this._map._container.addEventListener("touchcancel", this._handleTouch);
this._map._container.addEventListener("click", this._handleTouch);

L.DomEvent.on(this._map._container, "mousewheel", this._handleScroll, this);
L.DomEvent.on(this._map, "mouseover", this._handleMouseOver, this);
L.DomEvent.on(this._map, "mouseout", this._handleMouseOut, this);

// Listen to these events so will not disable dragging if the user moves the mouse out the boundary of the map container whilst actively dragging the map.
L.DomEvent.on(this._map, 'movestart', this._handleDragging, this);
L.DomEvent.on(this._map, 'move', this._handleDragging, this);
L.DomEvent.on(this._map, 'moveend', this._handleDragging, this);
L.DomEvent.on(this._map, "movestart", this._handleDragging, this);
L.DomEvent.on(this._map, "move", this._handleDragging, this);
L.DomEvent.on(this._map, "moveend", this._handleDragging, this);
},

removeHooks: function () {
Expand All @@ -370,21 +371,22 @@
this._map._container.removeEventListener("touchstart", this._handleTouch);
this._map._container.removeEventListener("touchmove", this._handleTouch);
this._map._container.removeEventListener("touchend", this._handleTouch);
this._map._container.removeEventListener("touchcancel", this._handleTouch);
this._map._container.removeEventListener("click", this._handleTouch);

L.DomEvent.off(this._map._container, "mousewheel", this._handleScroll, this);
L.DomEvent.off(this._map, "mouseover", this._handleMouseOver, this);
L.DomEvent.off(this._map, "mouseout", this._handleMouseOut, this);

L.DomEvent.off(this._map, 'movestart', this._handleDragging, this);
L.DomEvent.off(this._map, 'move', this._handleDragging, this);
L.DomEvent.off(this._map, 'moveend', this._handleDragging, this);
L.DomEvent.off(this._map, "movestart", this._handleDragging, this);
L.DomEvent.off(this._map, "move", this._handleDragging, this);
L.DomEvent.off(this._map, "moveend", this._handleDragging, this);
},

_handleDragging: function (e) {
if (e.type == 'movestart' || e.type == 'move') {
if (e.type == "movestart" || e.type == "move") {
draggingMap = true;
} else if (e.type == 'moveend') {
} else if (e.type == "moveend") {
draggingMap = false;
}
},
Expand All @@ -406,7 +408,6 @@
},

_setupPluginOptions: function () {

//For backwards compatibility, merge gestureHandlingText into the new options object
if (this._map.options.gestureHandlingText) {
this._map.options.gestureHandlingOptions.text = this._map.options.gestureHandlingText;
Expand Down Expand Up @@ -472,9 +473,8 @@
},

_handleTouch: function (e) {

//Disregard touch events on the minimap if present
var ignoreList = ['leaflet-control-minimap', 'leaflet-interactive', 'leaflet-popup-content', 'leaflet-popup-content-wrapper', 'leaflet-popup-close-button', 'leaflet-control-zoom-in', 'leaflet-control-zoom-out'];
var ignoreList = ["leaflet-control-minimap", "leaflet-interactive", "leaflet-popup-content", "leaflet-popup-content-wrapper", "leaflet-popup-close-button", "leaflet-control-zoom-in", "leaflet-control-zoom-out"];

var ignoreElement = false;
for (var i = 0; i < ignoreList.length; i++) {
Expand All @@ -484,21 +484,25 @@
}

if (ignoreElement) {
if (e.target.classList.contains('leaflet-interactive') && e.type === 'touchmove' && e.touches.length === 1) {
this._map._container.classList.add('leaflet-gesture-handling-touch-warning');
if (e.target.classList.contains("leaflet-interactive") && e.type === "touchmove" && e.touches.length === 1) {
this._map._container.classList.add("leaflet-gesture-handling-touch-warning");
this._disableInteractions();
} else {
this._map._container.classList.remove('leaflet-gesture-handling-touch-warning');
this._map._container.classList.remove("leaflet-gesture-handling-touch-warning");
}
return;
}
// screenLog(e.type+' '+e.touches.length);

if ((e.type === 'touchmove' || e.type === 'touchstart') && e.touches.length === 1) {
e.currentTarget.classList.add('leaflet-gesture-handling-touch-warning');
if (e.type !== "touchmove" && e.type !== "touchstart") {
this._map._container.classList.remove("leaflet-gesture-handling-touch-warning");
return;
}
if (e.touches.length === 1) {
this._map._container.classList.add("leaflet-gesture-handling-touch-warning");
this._disableInteractions();
} else {
e.target.classList.remove('leaflet-gesture-handling-touch-warning');
this._enableInteractions();
this._map._container.classList.remove("leaflet-gesture-handling-touch-warning");
}
},

Expand Down Expand Up @@ -537,7 +541,6 @@
},

_isScrolling: false

});

L.Map.addInitHook("addHandler", "gestureHandling", GestureHandling);
Expand Down
2 changes: 1 addition & 1 deletion dist/leaflet-gesture-handling.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/leaflet-gesture-handling.min.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"build": "gulp build",
"start": "gulp dev",
"format": "prettier --write src/*/*",
"prepublish": "npm run build"
},
"repository": {
Expand Down Expand Up @@ -44,6 +45,7 @@
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0",
"prettier": "^1.14.0",
"rollup-plugin-babel": "^3.0.7"
}
}
Loading

0 comments on commit 5f8c613

Please sign in to comment.