Skip to content

Commit

Permalink
fix tooltip dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto committed Feb 14, 2021
1 parent f39c73a commit 1f76caf
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 174 deletions.
120 changes: 38 additions & 82 deletions dist/leaflet-rotate-src.js

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-rotate-src.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/leaflet-rotate.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/leaflet-rotate.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css">

<!-- Leaflet-Rotate -->
<script src="https://unpkg.com/[email protected].0/dist/leaflet-rotate-src.js"></script>
<script src="https://unpkg.com/[email protected].1/dist/leaflet-rotate-src.js"></script>

<!-- include some miscellaneous -->
<script src="https://unpkg.com/[email protected].0/misc/route.js"></script>
<script src="https://unpkg.com/[email protected].0/misc/places.js"></script>
<script src="https://unpkg.com/[email protected].0/misc/loremIpsum.js"></script>
<script src="https://unpkg.com/[email protected].0/lib/debug.js"></script>
<script src="https://unpkg.com/[email protected].1/misc/route.js"></script>
<script src="https://unpkg.com/[email protected].1/misc/places.js"></script>
<script src="https://unpkg.com/[email protected].1/misc/loremIpsum.js"></script>
<script src="https://unpkg.com/[email protected].1/lib/debug.js"></script>

<style>
#map {
Expand Down
5 changes: 1 addition & 4 deletions src/dom/DomUtil.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* L.DomUtil
*/
const domUtilProto = {
setTransform: L.DomUtil.setTransform,
setPosition: L.DomUtil.setPosition
};
const domUtilProto = L.extend({}, L.DomUtil);

L.extend(L.DomUtil, {

Expand Down
5 changes: 1 addition & 4 deletions src/layer/DivOverlay.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* L.DivOverlay
*/
const divOverlayProto = {
getEvents: L.DivOverlay.prototype.getEvents,
_updatePosition: L.DivOverlay.prototype._updatePosition,
};
const divOverlayProto = L.extend({}, L.DivOverlay.prototype);

L.DivOverlay.include({

Expand Down
5 changes: 1 addition & 4 deletions src/layer/Popup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* L.Popup
*/
const popupProto = {
_animateZoom: L.Popup.prototype._animateZoom,
_adjustPan: L.Popup.prototype._adjustPan,
};
const popupProto = L.extend({}, L.Popup.prototype);

L.Popup.include({

Expand Down
7 changes: 2 additions & 5 deletions src/layer/Tooltip.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* L.Tooltip
*/
const tooltipProto = {
_updatePosition: L.Tooltip.prototype._updatePosition,
_animateZoom: L.Tooltip.prototype._animateZoom,
};
const tooltipProto = L.extend({}, L.Tooltip.prototype);

L.Tooltip.include({

Expand All @@ -20,7 +17,7 @@ L.Tooltip.include({

_animateZoom: function(e) {
if (!this._map._rotate) {
return tooltipProto._animateZoom.call(this);
return tooltipProto._animateZoom.call(this, e);
}
var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);

Expand Down
4 changes: 1 addition & 3 deletions src/layer/marker/Icon.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/**
* L.Icon
*/
const iconProto = {
_updatePosition: L.Icon.prototype._setIconStyles,
};
const iconProto = L.extend({}, L.Icon.prototype);

L.Icon.include({

Expand Down
Loading

0 comments on commit 1f76caf

Please sign in to comment.