Skip to content

Commit

Permalink
Remove empty tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Falke-Design committed May 12, 2024
1 parent a436ad6 commit bc49085
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/leaflet.distortableimage.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/leaflet.distortableimage.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions examples/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ let map;

(() => {
map = L.map('map').setView([51.505, -0.09], 13);
map.addGoogleMutant();

// map.addGoogleMutant();
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
'attribution': 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'
}).addTo(map)
map.whenReady(() => {
img = L.distortableImageOverlay('example.jpg', {
selected: true,
selected: false,
fullResolutionSrc: 'large.jpg',
}).addTo(map);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet-distortableimage",
"version": "0.21.9-falke3",
"version": "0.21.9-falke4",
"description": "Leaflet plugin enabling image overlays to be distorted, stretched, and warped (built for Public Lab's MapKnitter: http://publiclab.org).",
"engines": {
"node": ">=10.0.0"
Expand Down
6 changes: 0 additions & 6 deletions src/DistortableImageOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,13 @@ L.DistortableImageOverlay = L.ImageOverlay.extend({
});

this.fire('add');

L.DomEvent.on(this.getElement(), 'mousemove', this.activateTooltip, this);
L.DomEvent.on(this.getElement(), 'mouseout', this.closeTooltip, this);
},

onRemove(map) {
if (this.editing) { this.editing.disable(); }
this.fire('remove');

L.ImageOverlay.prototype.onRemove.call(this, map);

L.DomEvent.on(this.getElement(), 'mouseout', this.closeTooltip, this);
L.DomEvent.off(this.getElement(), 'mousemove', this.deactivateTooltip, this);
},

_initImageDimensions() {
Expand Down
5 changes: 4 additions & 1 deletion src/mapmixins/DoubleClickLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ L.Map.mergeOptions({
doubleClickLabels: false,
});

L.Map.DoubleClickLabels = L.Handler.extend({});
L.Map.DoubleClickLabels = L.Handler.extend({
addHooks(){},
removeHooks(){}
});

L.Map.addInitHook('addHandler', 'doubleClickLabels', L.Map.DoubleClickLabels);

0 comments on commit bc49085

Please sign in to comment.