Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #44, fix #11: Hovering marker disable drag, fix #33: Center text when wrapping multiline #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Leaflet.GestureHandling

Version 1.1.8
Version 1.1.9

Brings the basic functionality of [Google Maps Gesture Handling](https://developers.google.com/maps/documentation/javascript/examples/interaction-cooperative) into Leaflet.

Expand Down
1 change: 1 addition & 0 deletions dist/leaflet-gesture-handling.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
text-align: center;
padding: 15px;
position: absolute;
top: 0;
Expand Down
12 changes: 7 additions & 5 deletions dist/leaflet-gesture-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@

/*
* * Leaflet Gesture Handling **
* * Version 1.1.8
* * Version 1.1.9
*/

L.Map.mergeOptions({
Expand All @@ -342,6 +342,8 @@
var GestureHandling = L.Handler.extend({
addHooks: function () {
this._handleTouch = this._handleTouch.bind(this);
this._handleMouseOver = this._handleMouseOver.bind(this);
this._handleMouseOut = this._handleMouseOut.bind(this);

this._setupPluginOptions();
this._setLanguageContent();
Expand All @@ -356,8 +358,8 @@
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);
this._map._container.addEventListener("mouseenter", this._handleMouseOver);
this._map._container.addEventListener("mouseleave", this._handleMouseOut);

// 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);
Expand All @@ -375,8 +377,8 @@
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);
this._map._container.addEventListener("mouseenter", this._handleMouseOver);
this._map._container.addEventListener("mouseleave", this._handleMouseOut);

L.DomEvent.off(this._map, "movestart", this._handleDragging, this);
L.DomEvent.off(this._map, "move", this._handleDragging, this);
Expand Down
2 changes: 1 addition & 1 deletion dist/leaflet-gesture-handling.min.css

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

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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet-gesture-handling",
"version": "1.1.8",
"version": "1.1.9",
"description": "Prompt mobile user to use 2 fingers to move the map. Prompt desktop users to use Ctrl+Mouse Wheel to zoom. Brings Google Maps gesture handling into Leaflet. ",
"main": "./dist/leaflet-gesture-handling.min.js",
"files": [
Expand Down
12 changes: 7 additions & 5 deletions src/js/leaflet-gesture-handling.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* * Leaflet Gesture Handling **
* * Version 1.1.8
* * Version 1.1.9
*/
import LanguageContent from "./language-content";

Expand All @@ -16,6 +16,8 @@ var draggingMap = false;
export var GestureHandling = L.Handler.extend({
addHooks: function() {
this._handleTouch = this._handleTouch.bind(this);
this._handleMouseOver = this._handleMouseOver.bind(this);
this._handleMouseOut = this._handleMouseOut.bind(this);

this._setupPluginOptions();
this._setLanguageContent();
Expand All @@ -35,8 +37,8 @@ export var GestureHandling = L.Handler.extend({
this._handleScroll,
this
);
L.DomEvent.on(this._map, "mouseover", this._handleMouseOver, this);
L.DomEvent.on(this._map, "mouseout", this._handleMouseOut, this);
this._map._container.addEventListener("mouseenter", this._handleMouseOver);
this._map._container.addEventListener("mouseleave", this._handleMouseOut);

// 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);
Expand Down Expand Up @@ -68,8 +70,8 @@ export var GestureHandling = L.Handler.extend({
this._handleScroll,
this
);
L.DomEvent.off(this._map, "mouseover", this._handleMouseOver, this);
L.DomEvent.off(this._map, "mouseout", this._handleMouseOut, this);
this._map._container.addEventListener("mouseenter", this._handleMouseOver);
this._map._container.addEventListener("mouseleave", this._handleMouseOut);

L.DomEvent.off(this._map, "movestart", this._handleDragging, this);
L.DomEvent.off(this._map, "move", this._handleDragging, this);
Expand Down
3 changes: 2 additions & 1 deletion src/scss/leaflet-gesture-handling.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
justify-content: center;
display: flex;
align-items: center;
text-align: center;
padding: 15px;
position: absolute;
top: 0;
Expand All @@ -24,7 +25,7 @@
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 461;
pointer-events:none;
pointer-events: none;
}
}

Expand Down