leaflet-rotate 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/leaflet-rotate-src.js +198 -156
- package/dist/leaflet-rotate-src.js.map +1 -1
- package/dist/leaflet-rotate.js +198 -156
- package/dist/leaflet-rotate.js.map +1 -1
- package/package.json +1 -1
- package/src/dom/DomUtil.js +32 -2
- package/src/dom/Draggable.js +7 -0
- package/src/geo/LatLngBounds.js +13 -0
- package/src/geometry/Bounds.js +13 -0
- package/src/geometry/Point.js +5 -0
- package/src/index.js +16 -3
- package/src/layer/DivOverlay.js +11 -4
- package/src/layer/Popup.js +6 -6
- package/src/layer/marker/Marker.js +29 -17
- package/src/layer/tile/GridLayer.js +6 -0
- package/src/layer/vector/Renderer.js +9 -9
- package/src/map/handler/CompassBearing.js +5 -3
- package/src/map/handler/ContainerMutation.js +23 -24
- package/src/map/handler/ShiftKeyRotate.js +11 -10
- package/src/map/handler/TouchGestures.js +20 -10
- package/src/map/handler/TouchRotate.js +10 -8
- package/src/map/handler/TouchZoom.js +24 -15
- package/src/layer/vector/Canvas.js +0 -28
- package/src/layer/vector/SVG.js +0 -18
package/src/dom/Draggable.js
CHANGED
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/Draggable.js
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* A class for making DOM elements draggable (including touch support).
|
|
9
|
+
* Used internally for map and marker dragging. Only works for elements
|
|
10
|
+
* that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).
|
|
11
|
+
*/
|
|
12
|
+
|
|
7
13
|
L.Draggable.include({
|
|
8
14
|
|
|
15
|
+
/** @TODO */
|
|
9
16
|
// updateMapBearing: function(mapBearing) {
|
|
10
17
|
// this._mapBearing = mapBearing;
|
|
11
18
|
// },
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @external L.LatLngBounds
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/geo/LatLngBounds.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @TODO find out if should override here some functions in order
|
|
9
|
+
* to always get correct { _southWest, _northEast } bounds on a rotaded
|
|
10
|
+
* map, for example: at 180° "_southWest" should becomes "_northEast"?
|
|
11
|
+
*
|
|
12
|
+
* @see L.Map.getBounds()
|
|
13
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @external L.Bounds
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/geometry/Bounds.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @TODO find out if should override here some functions in order
|
|
9
|
+
* to always get correct { min, max } pixel bounds on a rotaded
|
|
10
|
+
* map, for example: at 180° "min" should becomes "max"?
|
|
11
|
+
*
|
|
12
|
+
* @see L.Map.getPixelBounds()
|
|
13
|
+
*/
|
package/src/geometry/Point.js
CHANGED
|
@@ -26,6 +26,11 @@ L.extend(L.Point.prototype, {
|
|
|
26
26
|
* 3. add (pivot.x, pivot.y) back
|
|
27
27
|
*
|
|
28
28
|
* same as `this.subtract(pivot).rotate(theta).add(pivot)`
|
|
29
|
+
*
|
|
30
|
+
* @param {Number} theta
|
|
31
|
+
* @param {L.Point} pivot
|
|
32
|
+
*
|
|
33
|
+
* @returns {L.Point}
|
|
29
34
|
*/
|
|
30
35
|
rotateFrom: function(theta, pivot) {
|
|
31
36
|
if (!theta) { return this; }
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Export Leaflet classes in the same order as the core library
|
|
3
|
+
*
|
|
2
4
|
* @external L
|
|
3
5
|
*
|
|
4
6
|
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/Leaflet.js
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/control/index.js
|
|
9
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/core/index.js
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/dom/index.js
|
|
12
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/geometry/index.js
|
|
13
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/geo/index.js
|
|
14
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/index.js
|
|
15
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/marker/index.js
|
|
16
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/tile/index.js
|
|
17
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/vector/index.js
|
|
18
|
+
* @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/index.js
|
|
5
19
|
*/
|
|
6
20
|
|
|
7
21
|
// import {version} from '../package.json';
|
|
@@ -19,9 +33,10 @@ export * from './dom/Draggable';
|
|
|
19
33
|
|
|
20
34
|
// geometry
|
|
21
35
|
export * from './geometry/Point';
|
|
36
|
+
export * from './geometry/Bounds';
|
|
22
37
|
|
|
23
38
|
// geo
|
|
24
|
-
|
|
39
|
+
export * from './geo/LatLngBounds';
|
|
25
40
|
|
|
26
41
|
// layer
|
|
27
42
|
export * from './layer/DivOverlay';
|
|
@@ -30,9 +45,7 @@ export * from './layer/Tooltip';
|
|
|
30
45
|
export * from './layer/marker/Icon';
|
|
31
46
|
export * from './layer/marker/Marker';
|
|
32
47
|
export * from './layer/tile/GridLayer';
|
|
33
|
-
export * from './layer/vector/Canvas';
|
|
34
48
|
export * from './layer/vector/Renderer';
|
|
35
|
-
export * from './layer/vector/SVG';
|
|
36
49
|
|
|
37
50
|
// map
|
|
38
51
|
export * from './map/Map';
|
package/src/layer/DivOverlay.js
CHANGED
|
@@ -8,16 +8,23 @@ const divOverlayProto = L.extend({}, L.DivOverlay.prototype);
|
|
|
8
8
|
|
|
9
9
|
L.DivOverlay.include({
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Update L.Popup and L.Tooltip anchor positions after
|
|
13
|
+
* the map is moved by calling `map.setBearing(theta)`
|
|
14
|
+
*
|
|
15
|
+
* @listens L.Map~rotate
|
|
16
|
+
*/
|
|
11
17
|
getEvents: function() {
|
|
12
18
|
return L.extend(divOverlayProto.getEvents.apply(this, arguments), { rotate: this._updatePosition });
|
|
13
19
|
},
|
|
14
20
|
|
|
21
|
+
/**
|
|
22
|
+
* 0. update element anchor point (divOverlayProto v1.9.3)
|
|
23
|
+
* 1. rotate around anchor point (subtract anchor -> rotate point -> add anchor)
|
|
24
|
+
*/
|
|
15
25
|
_updatePosition: function() {
|
|
16
|
-
|
|
26
|
+
if (!this._map) { return; }
|
|
17
27
|
divOverlayProto._updatePosition.apply(this, arguments);
|
|
18
|
-
// 1. subtract anchor
|
|
19
|
-
// 2. rotate element
|
|
20
|
-
// 3. restore anchor
|
|
21
28
|
if (this._map && this._map._rotate && this._zoomAnimated) {
|
|
22
29
|
var anchor = this._getAnchor();
|
|
23
30
|
var pos = L.DomUtil.getPosition(this._container).subtract(anchor);
|
package/src/layer/Popup.js
CHANGED
|
@@ -8,12 +8,12 @@ const popupProto = L.extend({}, L.Popup.prototype);
|
|
|
8
8
|
|
|
9
9
|
L.Popup.include({
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* 0. update element anchor point (popupProto v1.9.3)
|
|
13
|
+
* 1. rotate around anchor point (subtract anchor -> rotate point -> add anchor)
|
|
14
|
+
*/
|
|
11
15
|
_animateZoom: function(e) {
|
|
12
|
-
// 0. update anchor (leaflet v1.9.3)
|
|
13
16
|
popupProto._animateZoom.apply(this, arguments);
|
|
14
|
-
// 1. subtract anchor
|
|
15
|
-
// 2. rotate element
|
|
16
|
-
// 3. restore anchor
|
|
17
17
|
if (this._map && this._map._rotate) {
|
|
18
18
|
var anchor = this._getAnchor();
|
|
19
19
|
var pos = L.DomUtil.getPosition(this._container).subtract(anchor);
|
|
@@ -22,7 +22,7 @@ L.Popup.include({
|
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Fix for L.popup({ keepInView = true })
|
|
26
26
|
*
|
|
27
27
|
* @see https://github.com/fnicollet/Leaflet/pull/21
|
|
28
28
|
*/
|
|
@@ -44,8 +44,8 @@ L.Popup.include({
|
|
|
44
44
|
|
|
45
45
|
layerPos._add(L.DomUtil.getPosition(this._container));
|
|
46
46
|
|
|
47
|
-
// var containerPos = map.layerPointToContainerPoint(layerPos);
|
|
48
47
|
/** @TODO use popupProto._adjustPan */
|
|
48
|
+
// var containerPos = map.layerPointToContainerPoint(layerPos);
|
|
49
49
|
var containerPos = layerPos._add(this._map._getMapPanePos()),
|
|
50
50
|
padding = L.point(this.options.autoPanPadding),
|
|
51
51
|
paddingTL = L.point(this.options.autoPanPaddingTopLeft || padding),
|
|
@@ -3,22 +3,33 @@
|
|
|
3
3
|
* @external L.Handler.MarkerDrag
|
|
4
4
|
*
|
|
5
5
|
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Marker.js
|
|
6
|
+
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Marker.Drag.js
|
|
7
|
+
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/Draggable.js
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
10
|
const markerProto = L.extend({}, L.Marker.prototype);
|
|
9
11
|
|
|
10
12
|
L.Marker.mergeOptions({
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Rotation of this marker in rad
|
|
16
|
+
*
|
|
17
|
+
* @type {Number}
|
|
18
|
+
*/
|
|
14
19
|
rotation: 0,
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Rotate this marker when map rotates
|
|
23
|
+
*
|
|
24
|
+
* @type {Boolean}
|
|
25
|
+
*/
|
|
18
26
|
rotateWithView: false,
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Scale of the marker icon
|
|
30
|
+
*
|
|
31
|
+
* @type {Number}
|
|
32
|
+
*/
|
|
22
33
|
scale: undefined,
|
|
23
34
|
|
|
24
35
|
});
|
|
@@ -79,15 +90,16 @@ var MarkerDrag = {
|
|
|
79
90
|
|
|
80
91
|
L.Marker.include({
|
|
81
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Update L.Marker anchor position after the map
|
|
95
|
+
* is moved by calling `map.setBearing(theta)`
|
|
96
|
+
*
|
|
97
|
+
* @listens L.Map~rotate
|
|
98
|
+
*/
|
|
82
99
|
getEvents: function() {
|
|
83
100
|
return L.extend(markerProto.getEvents.apply(this, arguments), { rotate: this.update });
|
|
84
101
|
},
|
|
85
102
|
|
|
86
|
-
onAdd: function(map) {
|
|
87
|
-
markerProto.onAdd.apply(this, arguments);
|
|
88
|
-
map.on('rotate', this.update, this);
|
|
89
|
-
},
|
|
90
|
-
|
|
91
103
|
_initInteraction: function() {
|
|
92
104
|
var ret = markerProto._initInteraction.apply(this, arguments);
|
|
93
105
|
if (this.dragging && this.dragging.enabled() && this._map && this._map._rotate) {
|
|
@@ -132,12 +144,12 @@ L.Marker.include({
|
|
|
132
144
|
this._resetZIndex();
|
|
133
145
|
},
|
|
134
146
|
|
|
135
|
-
_updateZIndex: function(offset) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
},
|
|
147
|
+
// _updateZIndex: function(offset) {
|
|
148
|
+
// if (!this._map._rotate) {
|
|
149
|
+
// return markerProto._updateZIndex.apply(this, arguments);
|
|
150
|
+
// }
|
|
151
|
+
// this._icon.style.zIndex = Math.round(this._zIndex + offset);
|
|
152
|
+
// },
|
|
141
153
|
|
|
142
154
|
setRotation: function(rotation) {
|
|
143
155
|
this.options.rotation = rotation;
|
|
@@ -8,6 +8,12 @@ const gridLayerProto = L.extend({}, L.GridLayer.prototype);
|
|
|
8
8
|
|
|
9
9
|
L.GridLayer.include({
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Redraw L.TileLayer bounds after the map is
|
|
13
|
+
* moved by just calling `map.setBearing(theta)`
|
|
14
|
+
*
|
|
15
|
+
* @listens L.Map~rotate
|
|
16
|
+
*/
|
|
11
17
|
getEvents: function() {
|
|
12
18
|
var events = gridLayerProto.getEvents.apply(this, arguments);
|
|
13
19
|
if (this._map._rotate && !this.options.updateWhenIdle) {
|
|
@@ -8,15 +8,15 @@ const rendererProto = L.extend({}, L.Renderer.prototype);
|
|
|
8
8
|
|
|
9
9
|
L.Renderer.include({
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Redraw L.Canvas and L.SVG renderer bounds after the
|
|
13
|
+
* map is moved by just calling `map.setBearing(theta)`
|
|
14
|
+
*
|
|
15
|
+
* @listens L.Map~rotate
|
|
16
|
+
*/
|
|
17
|
+
getEvents: function() {
|
|
18
|
+
return L.extend(rendererProto.getEvents.apply(this, arguments), { rotate: this._update });
|
|
19
|
+
},
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @TODO rechek this changes from leaflet@v1.9.3
|
|
@@ -31,7 +31,9 @@ L.Map.CompassBearing = L.Handler.extend({
|
|
|
31
31
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Add Compass bearing handler to L.Map (disabled unless `window.DeviceOrientationEvent` is set).
|
|
36
|
+
*
|
|
37
|
+
* @property {L.Map.CompassBearing} compassBearing
|
|
38
|
+
*/
|
|
37
39
|
L.Map.addInitHook('addHandler', 'compassBearing', L.Map.CompassBearing);
|
|
@@ -4,14 +4,23 @@
|
|
|
4
4
|
* @typedef L.Map.ContainerMutation
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @TODO check again this file after leaflet v1.9.3 (eg. L.Browser.mutation).
|
|
9
|
+
* Mutation Observer support will likely be added by default in next releases.
|
|
10
|
+
*/
|
|
11
|
+
|
|
9
12
|
L.Map.mergeOptions({
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Whether the map uses mutation observers to
|
|
16
|
+
* detect changes in its container and trigger
|
|
17
|
+
* `invalidateSize`. Disabled by default due to
|
|
18
|
+
* support not being available in all web browsers.
|
|
19
|
+
*
|
|
20
|
+
* @type {Boolean}
|
|
21
|
+
*
|
|
22
|
+
* @see https://developer.mozilla.org/docs/Web/API/MutationObserver
|
|
23
|
+
*/
|
|
15
24
|
trackContainerMutation: false
|
|
16
25
|
|
|
17
26
|
});
|
|
@@ -19,15 +28,10 @@ L.Map.mergeOptions({
|
|
|
19
28
|
L.Map.ContainerMutation = L.Handler.extend({
|
|
20
29
|
|
|
21
30
|
addHooks: function() {
|
|
22
|
-
|
|
23
|
-
// if (!L.Browser.mutation) {
|
|
24
|
-
// return;
|
|
25
|
-
// }
|
|
26
|
-
|
|
31
|
+
// if (!L.Browser.mutation) { return; }
|
|
27
32
|
if (!this._observer) {
|
|
28
|
-
this._observer = new MutationObserver(L.Util.bind(this.
|
|
33
|
+
this._observer = new MutationObserver(L.Util.bind(this._map.invalidateSize, this._map));
|
|
29
34
|
}
|
|
30
|
-
|
|
31
35
|
this._observer.observe(this._map.getContainer(), {
|
|
32
36
|
childList: false,
|
|
33
37
|
attributes: true,
|
|
@@ -38,20 +42,15 @@ L.Map.ContainerMutation = L.Handler.extend({
|
|
|
38
42
|
},
|
|
39
43
|
|
|
40
44
|
removeHooks: function() {
|
|
41
|
-
|
|
42
|
-
// if (!L.Browser.mutation) {
|
|
43
|
-
// return;
|
|
44
|
-
// }
|
|
45
|
+
// if (!L.Browser.mutation) { return; }
|
|
45
46
|
this._observer.disconnect();
|
|
46
47
|
},
|
|
47
48
|
|
|
48
|
-
_onMutation: function() {
|
|
49
|
-
this._map.invalidateSize();
|
|
50
|
-
},
|
|
51
|
-
|
|
52
49
|
});
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Add Container mutation handler to L.Map (disabled unless `trackContainerMutation` is set).
|
|
53
|
+
*
|
|
54
|
+
* @property {L.Map.ContainerMutation} trackContainerMutation
|
|
55
|
+
*/
|
|
57
56
|
L.Map.addInitHook('addHandler', 'trackContainerMutation', L.Map.ContainerMutation);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Rotates the map on shift key +
|
|
3
|
+
* Rotates the map on shift key + mousewheel scrolling (desktop).
|
|
4
4
|
*
|
|
5
5
|
* @typedef L.Map.ShiftKeyRotate
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// @namespace Map
|
|
9
|
-
// @section Interaction Options
|
|
10
8
|
L.Map.mergeOptions({
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Whether the map can be rotated with shift + wheel scroll
|
|
12
|
+
* @type {Boolean}
|
|
13
|
+
*/
|
|
15
14
|
shiftKeyRotate: true,
|
|
16
15
|
|
|
17
16
|
});
|
|
@@ -41,12 +40,14 @@ L.Map.ShiftKeyRotate = L.Handler.extend({
|
|
|
41
40
|
|
|
42
41
|
});
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Add ShiftKey handler to L.Map (enabled unless `shiftKeyRotate` is unset).
|
|
45
|
+
*
|
|
46
|
+
* @property {L.Map.ShiftKeyRotate} shiftKeyRotate
|
|
47
|
+
*/
|
|
47
48
|
L.Map.addInitHook('addHandler', 'shiftKeyRotate', L.Map.ShiftKeyRotate);
|
|
48
49
|
|
|
49
|
-
// decrease
|
|
50
|
+
// decrease `scrollWheelZoom` handler priority over `shiftKeyRotate` handler
|
|
50
51
|
L.Map.addInitHook(function() {
|
|
51
52
|
if (this.scrollWheelZoom.enabled() && this.shiftKeyRotate.enabled()) {
|
|
52
53
|
this.scrollWheelZoom.disable();
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
* @typedef L.Map.TouchGestures
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
// @namespace Map
|
|
11
|
-
// @section Interaction Options
|
|
12
10
|
L.Map.mergeOptions({
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Set it to false if you don't want the map to
|
|
14
|
+
* zoom beyond min/max zoom and then bounce back
|
|
15
|
+
* when pinch-zooming.
|
|
16
|
+
*
|
|
17
|
+
* @type {Boolean}
|
|
18
|
+
*/
|
|
17
19
|
bounceAtZoomLimits: true,
|
|
18
20
|
|
|
19
21
|
});
|
|
@@ -92,8 +94,14 @@ L.Map.TouchGestures = L.Handler.extend({
|
|
|
92
94
|
var bearingDelta = (theta - this._startTheta) * L.DomUtil.RAD_TO_DEG;
|
|
93
95
|
if (vector.y < 0) { bearingDelta += 180; }
|
|
94
96
|
if (bearingDelta) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
/**
|
|
98
|
+
* @TODO the pivot should be the last touch point,
|
|
99
|
+
* but zoomAnimation manages to overwrite the rotate
|
|
100
|
+
* pane position. Maybe related to #3529.
|
|
101
|
+
*
|
|
102
|
+
* @see https://github.com/Leaflet/Leaflet/pull/3529
|
|
103
|
+
* @see https://github.com/fnicollet/Leaflet/commit/a77af51a6b10f308d1b9a16552091d1d0aee8834
|
|
104
|
+
*/
|
|
97
105
|
map.setBearing(this._startBearing - bearingDelta);
|
|
98
106
|
}
|
|
99
107
|
}
|
|
@@ -161,7 +169,9 @@ L.Map.TouchGestures = L.Handler.extend({
|
|
|
161
169
|
|
|
162
170
|
});
|
|
163
171
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Add Touch Gestures handler (enabled unless `touchGestures` is unset).
|
|
174
|
+
*
|
|
175
|
+
* @property {L.Map.TouchGestures} touchGestures
|
|
176
|
+
*/
|
|
167
177
|
L.Map.addInitHook('addHandler', 'touchGestures', L.Map.TouchGestures);
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* @typedef L.Map.TouchRotate
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// @namespace Map
|
|
8
|
-
// @section Interaction Options
|
|
9
7
|
L.Map.mergeOptions({
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Whether the map can be rotated with a two-finger rotation gesture
|
|
11
|
+
*
|
|
12
|
+
* @type {Boolean}
|
|
13
|
+
*/
|
|
14
14
|
touchRotate: false,
|
|
15
15
|
|
|
16
16
|
});
|
|
@@ -28,7 +28,9 @@ L.Map.TouchRotate = L.Handler.extend({
|
|
|
28
28
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Add Touch Rotate handler (disabled unless `touchGestures` is set).
|
|
33
|
+
*
|
|
34
|
+
* @property {L.Map.TouchGestures} touchGestures
|
|
35
|
+
*/
|
|
34
36
|
L.Map.addInitHook('addHandler', 'touchRotate', L.Map.TouchRotate);
|
|
@@ -6,25 +6,32 @@
|
|
|
6
6
|
* @external L.Map.TouchZoom
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
// @namespace Map
|
|
10
|
-
// @section Interaction Options
|
|
11
9
|
L.Map.mergeOptions({
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Whether the map can be zoomed by touch-dragging
|
|
13
|
+
* with two fingers. If passed `'center'`, it will
|
|
14
|
+
* zoom to the center of the view regardless of
|
|
15
|
+
* where the touch events (fingers) were. Enabled
|
|
16
|
+
* for touch-capable web browsers.
|
|
17
|
+
*
|
|
18
|
+
* @type {(Boolean|String)}
|
|
19
|
+
*/
|
|
19
20
|
touchZoom: L.Browser.touch,
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
*
|
|
23
24
|
*/
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @TODO check if this is a duplicate of `L.Map.TouchGestures::bounceAtZoomLimits`
|
|
28
|
+
*
|
|
29
|
+
* Set it to false if you don't want the map to
|
|
30
|
+
* zoom beyond min/max zoom and then bounce back
|
|
31
|
+
* when pinch-zooming.
|
|
32
|
+
*
|
|
33
|
+
* @type {Boolean}
|
|
34
|
+
*/
|
|
28
35
|
bounceAtZoomLimits: false,
|
|
29
36
|
|
|
30
37
|
});
|
|
@@ -44,7 +51,9 @@ L.Map.TouchZoom = L.Handler.extend({
|
|
|
44
51
|
|
|
45
52
|
});
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Add Touch Zoom handler (disabled unless `L.Browser.touch` is set).
|
|
56
|
+
*
|
|
57
|
+
* @property {L.Map.TouchGestures} touchGestures
|
|
58
|
+
*/
|
|
50
59
|
L.Map.addInitHook('addHandler', 'touchZoom', L.Map.TouchZoom);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @external L.Canvas
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/vector/Canvas.js
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const canvasProto = L.extend({}, L.Canvas.prototype);
|
|
8
|
-
|
|
9
|
-
L.Canvas.include({
|
|
10
|
-
|
|
11
|
-
// onAdd: function() {
|
|
12
|
-
// canvasProto.onAdd.apply(this, arguments);
|
|
13
|
-
// // When rotating the canvas itself, it is cleared by some weird reason, so redraw.
|
|
14
|
-
// this._map.on('rotate', this._redraw, this);
|
|
15
|
-
// },
|
|
16
|
-
|
|
17
|
-
// onRemove: function() {
|
|
18
|
-
// canvasProto.onRemove.apply(this, arguments);
|
|
19
|
-
// this._map.off('rotate', this._redraw, this);
|
|
20
|
-
// },
|
|
21
|
-
|
|
22
|
-
// _update: function() {
|
|
23
|
-
// canvasProto._update.apply(this, arguments);
|
|
24
|
-
// // Tell paths to redraw themselves
|
|
25
|
-
// this.fire('update')
|
|
26
|
-
// },
|
|
27
|
-
|
|
28
|
-
});
|
package/src/layer/vector/SVG.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @external L.SVG
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/vector/SVG.js
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const svgProto = L.extend({}, L.SVG.prototype);
|
|
8
|
-
|
|
9
|
-
L.SVG.include({
|
|
10
|
-
|
|
11
|
-
// _update: function() {
|
|
12
|
-
// svgProto._update.apply(this, arguments);
|
|
13
|
-
// if (this._map._rotate) {
|
|
14
|
-
// this.fire('update');
|
|
15
|
-
// }
|
|
16
|
-
// },
|
|
17
|
-
|
|
18
|
-
});
|