leaflet-rotate 0.2.0 → 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/src/map/Map.js CHANGED
@@ -19,7 +19,7 @@ L.Map.include({
19
19
  this._rotate = true;
20
20
  this._bearing = 0;
21
21
  }
22
- mapProto.initialize.call(this, id, options);
22
+ mapProto.initialize.apply(this, arguments);
23
23
  if(this.options.rotate){
24
24
  this.setBearing(this.options.bearing);
25
25
  }
@@ -35,7 +35,7 @@ L.Map.include({
35
35
  */
36
36
  containerPointToLayerPoint: function(point) {
37
37
  if (!this._rotate) {
38
- return mapProto.containerPointToLayerPoint.call(this, point);
38
+ return mapProto.containerPointToLayerPoint.apply(this, arguments);
39
39
  }
40
40
  return L.point(point)
41
41
  .subtract(this._getMapPanePos())
@@ -50,9 +50,9 @@ L.Map.include({
50
50
  * @param {L.Point} point pixel screen coordinates
51
51
  * @returns {L.Point} transformed pixel point
52
52
  */
53
- layerPointToContainerPoint: function(point) { // (Point)
53
+ layerPointToContainerPoint: function(point) {
54
54
  if (!this._rotate) {
55
- return mapProto.layerPointToContainerPoint.call(this, point);
55
+ return mapProto.layerPointToContainerPoint.apply(this, arguments);
56
56
  }
57
57
  return L.point(point)
58
58
  .add(this._getRotatePanePos())
@@ -69,6 +69,8 @@ L.Map.include({
69
69
  *
70
70
  * @param {L.Point} point pixel screen coordinates
71
71
  * @returns {L.Point}
72
+ *
73
+ * @since leaflet-rotate (v0.1)
72
74
  */
73
75
  rotatedPointToMapPanePoint: function(point) {
74
76
  return L.point(point)
@@ -84,6 +86,8 @@ L.Map.include({
84
86
  * (norotatePane) --> (rotatePane)
85
87
  *
86
88
  * @param {L.Point} point pixel screen coordinates
89
+ *
90
+ * @since leaflet-rotate (v0.1)
87
91
  */
88
92
  mapPanePointToRotatedPoint: function(point) {
89
93
  return L.point(point)
@@ -91,6 +95,31 @@ L.Map.include({
91
95
  .rotate(-this._bearing);
92
96
  },
93
97
 
98
+ /**
99
+ * Given latlng bounds, returns the bounds in projected pixel
100
+ * relative to the map container.
101
+ *
102
+ * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/map/Map.js#L1114-L1135
103
+ *
104
+ * @param {L.LatLngBounds} bounds
105
+ * @returns {L.Bounds}
106
+ *
107
+ * @since leaflet-rotate (v0.2)
108
+ */
109
+ mapBoundsToContainerBounds: function (bounds) {
110
+ if (!this._rotate && mapProto.mapBoundsToContainerBounds) {
111
+ return mapProto.mapBoundsToContainerBounds.apply(this, arguments);
112
+ }
113
+ const nw = this.latLngToContainerPoint(bounds.getNorthWest()),
114
+ ne = this.latLngToContainerPoint(bounds.getNorthEast()),
115
+ sw = this.latLngToContainerPoint(bounds.getSouthWest()),
116
+ se = this.latLngToContainerPoint(bounds.getSouthEast());
117
+ return L.bounds([
118
+ L.point(Math.min(nw.x, ne.x, se.x, sw.x), Math.min(nw.y, ne.y, se.y, sw.y)), // [ minX, minY ]
119
+ L.point(Math.max(nw.x, ne.x, se.x, sw.x), Math.max(nw.y, ne.y, se.y, sw.y)) // [ maxX, maxY ]
120
+ ]);
121
+ },
122
+
94
123
  /**
95
124
  * Returns geographical bounds visible in the current map view
96
125
  *
@@ -103,7 +132,7 @@ L.Map.include({
103
132
  */
104
133
  getBounds: function() {
105
134
  if (!this._rotate) {
106
- return mapProto.getBounds.call(this);
135
+ return mapProto.getBounds.apply(this, arguments);
107
136
  }
108
137
 
109
138
  // SEE: https://github.com/fnicollet/Leaflet/pull/22
@@ -146,6 +175,8 @@ L.Map.include({
146
175
  * Change map rotation
147
176
  *
148
177
  * @param {number} theta map degrees
178
+ *
179
+ * @since leaflet-rotate (v0.1)
149
180
  */
150
181
  setBearing: function(theta) {
151
182
  if (!L.Browser.any3d || !this._rotate) { return; }
@@ -169,6 +200,8 @@ L.Map.include({
169
200
  * Get current map rotation
170
201
  *
171
202
  * @returns {number} theta map degrees
203
+ *
204
+ * @since leaflet-rotate (v0.1)
172
205
  */
173
206
  getBearing: function() {
174
207
  return this._bearing * L.DomUtil.RAD_TO_DEG;
@@ -185,7 +218,7 @@ L.Map.include({
185
218
  */
186
219
  // createPane: function(name, container) {
187
220
  // if (!this._rotate || name == 'mapPane') {
188
- // return mapProto.createPane.call(this, name, container);
221
+ // return mapProto.createPane.apply(this, arguments);
189
222
  // }
190
223
  // // init "rotatePane"
191
224
  // if (!this._rotatePane) {
@@ -308,15 +341,108 @@ L.Map.include({
308
341
  // this._enforcingBounds = true;
309
342
  // var center = this.getCenter(),
310
343
  // newCenter = this._limitCenter(center, this._zoom, L.latLngBounds(bounds));
311
-
344
+ //
312
345
  // if (!center.equals(newCenter)) {
313
346
  // this.panTo(newCenter, options);
314
347
  // }
315
-
348
+ //
316
349
  // this._enforcingBounds = false;
317
350
  // return this;
318
351
  // },
319
352
 
353
+ // adjust center for view to get inside bounds
354
+ // _limitCenter(center, zoom, bounds) {
355
+ //
356
+ // if (!bounds) { return center; }
357
+ //
358
+ // const centerPoint = this.project(center, zoom),
359
+ // viewHalf = this.getSize().divideBy(2),
360
+ // viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),
361
+ // offset = this._getBoundsOffset(viewBounds, bounds, zoom);
362
+ //
363
+ // // If offset is less than a pixel, ignore.
364
+ // // This prevents unstable projections from getting into
365
+ // // an infinite loop of tiny offsets.
366
+ // if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {
367
+ // return center;
368
+ // }
369
+ //
370
+ // return this.unproject(centerPoint.add(offset), zoom);
371
+ // },
372
+
373
+ // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this
374
+ // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),
375
+ // but takes a bounds parameter like [`fitBounds`](#map-fitbounds).
376
+ // flyToBounds(bounds, options) {
377
+ // const target = this._getBoundsCenterZoom(bounds, options);
378
+ // return this.flyTo(target.center, target.zoom, options);
379
+ // },
380
+
381
+ // _getBoundsCenterZoom(bounds, options) {
382
+ //
383
+ // options = options || {};
384
+ // bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);
385
+ //
386
+ // const paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]),
387
+ // paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]);
388
+ //
389
+ // let zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));
390
+ //
391
+ // zoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;
392
+ //
393
+ // if (zoom === Infinity) {
394
+ // return { center: bounds.getCenter(), zoom };
395
+ // }
396
+ //
397
+ // return { center, zoom };
398
+ //
399
+ // },
400
+
401
+ /**
402
+ * Returns the maximum zoom level on which the given bounds fit to the map
403
+ * view in its entirety. If `inside` (optional) is set to `true`, the method
404
+ * instead returns the minimum zoom level on which the map view fits into
405
+ * the given bounds in its entirety.
406
+ *
407
+ * @param {L.LatLngBounds} bounds
408
+ * @param {Boolean} [inside=false]
409
+ * @param {L.Point} [padding=[0,0]]
410
+ *
411
+ * @returns {Number} zoom level
412
+ */
413
+ getBoundsZoom(bounds, inside, padding) {
414
+ if (!this._rotate || Math.abs(this._bearing).toFixed(1) < 0.1) {
415
+ return mapProto.getBoundsZoom.apply(this, arguments);
416
+ }
417
+
418
+ bounds = L.latLngBounds(bounds);
419
+ padding = L.point(padding || [0, 0]);
420
+
421
+ let zoom = this.getZoom() || 0;
422
+ const min = this.getMinZoom(),
423
+ max = this.getMaxZoom(),
424
+ /** @TODO use mapProto.getBoundsZoom */
425
+ // nw = bounds.getNorthWest(),
426
+ // se = bounds.getSouthEast(),
427
+ // size = this.getSize().subtract(padding),
428
+ // boundsSize = L.bounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),
429
+ size = this.getSize().subtract(padding),
430
+ boundsSize = this.mapBoundsToContainerBounds(bounds).getSize(),
431
+ snap = this.options.zoomSnap,
432
+ scalex = size.x / boundsSize.x,
433
+ scaley = size.y / boundsSize.y,
434
+ scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);
435
+
436
+ zoom = this.getScaleZoom(scale, zoom);
437
+
438
+ if (snap) {
439
+ zoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level
440
+ zoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;
441
+ }
442
+
443
+ return Math.max(min, Math.min(max, zoom));
444
+ },
445
+
320
446
  /**
321
447
  * Layer point of the current center
322
448
  *
@@ -332,13 +458,16 @@ L.Map.include({
332
458
  * @param {L.LatLng} latlng map coordinates
333
459
  */
334
460
  _getCenterOffset: function(latlng) {
335
- var centerOffset = mapProto._getCenterOffset.call(this, latlng);
461
+ var centerOffset = mapProto._getCenterOffset.apply(this, arguments);
336
462
  if (this._rotate) {
337
463
  centerOffset = centerOffset.rotate(this._bearing);
338
464
  }
339
465
  return centerOffset;
340
466
  },
341
467
 
468
+ /**
469
+ * @since leaflet-rotate (v0.1)
470
+ */
342
471
  _getRotatePanePos: function() {
343
472
  return this._rotatePanePos || new L.Point(0, 0);
344
473
  // return L.DomUtil.getPosition(this._rotatePane) || new L.Point(0, 0);
@@ -347,7 +476,7 @@ L.Map.include({
347
476
  _getNewPixelOrigin: function(center, zoom) {
348
477
  var viewHalf = this.getSize()._divideBy(2);
349
478
  if (!this._rotate) {
350
- return mapProto._getNewPixelOrigin.call(this, center, zoom);
479
+ return mapProto._getNewPixelOrigin.apply(this, arguments);
351
480
  }
352
481
  return this.project(center, zoom)
353
482
  .rotate(this._bearing)
@@ -454,39 +583,6 @@ L.Map.include({
454
583
  this.fire('locationfound', data);
455
584
  },
456
585
 
457
- /**
458
- * Given latlng bounds, returns the bounds in projected pixel
459
- * relative to the map container.
460
- *
461
- * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/map/Map.js#L1114-L1135
462
- *
463
- * @param {L.LatLngBounds} bounds
464
- * @returns {L.Bounds}
465
- */
466
- // boundsToContainerBounds: function (bounds) {
467
- // if (this._rotate) {
468
- // var northWest = this.latLngToContainerPoint(bounds.getNorthWest());
469
- // var northEast = this.latLngToContainerPoint(bounds.getNorthEast());
470
- // var southWest = this.latLngToContainerPoint(bounds.getSouthWest());
471
- // var southEast = this.latLngToContainerPoint(bounds.getSouthEast());
472
- //
473
- // var minX = Math.min(northWest.x, northEast.x, southEast.x, southWest.x);
474
- // var maxX = Math.max(northWest.x, northEast.x, southEast.x, southWest.x);
475
- // var minY = Math.min(northWest.y, northEast.y, southEast.y, southWest.y);
476
- // var maxY = Math.max(northWest.y, northEast.y, southEast.y, southWest.y);
477
- //
478
- // return L.bounds(
479
- // L.point(minX, minY).multiplyBy(-1),
480
- // L.point(maxX, maxY).multiplyBy(-1).add(this.getSize())
481
- // );
482
- // } else {
483
- // return L.Bounds(
484
- // this.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1),
485
- // this.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1).add(this.getSize())
486
- // );
487
- // }
488
- // },
489
-
490
586
  /**
491
587
  * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/geo/LatLngBounds.js#L253-L264
492
588
  *
@@ -31,7 +31,9 @@ L.Map.CompassBearing = L.Handler.extend({
31
31
 
32
32
  });
33
33
 
34
- // @section Handlers
35
- // @property compassBearing: Handler
36
- // Compass bearing handler.
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
- // @namespace Map
8
- // @section Interaction Options
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
- // @option trackContainerMutation: Boolean = false
12
- // Whether the map uses [mutation observers](https://developer.mozilla.org/docs/Web/API/MutationObserver)
13
- // to detect changes in its container and trigger `invalidateSize`. Disabled
14
- // by default due to support not being available in all web browsers.
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
- /** @TODO check again this property. Will likely be added in future releases (leaflet > v1.9.3) */
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._onMutation, 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
- /** @TODO check again this property. Will likely be added in future releases (leaflet > v1.9.3) */
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
- // @section Handlers
55
- // @property containerMutation: Handler
56
- // Container mutation handler (disabled unless [`trackContainerMutation`](#map-trackcontainermutation) is set).
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 + mouseheel scrolling (desktop).
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
- // @section ShiftKey interaction options
13
- // @option shiftKeyRotate: Boolean|String = *
14
- // Whether the map can be rotated with a shit-wheel rotation
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
- // @section Handlers
45
- // @property touchZoom: Handler
46
- // Touch rotate handler.
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 "scrollWheelZoom" handler priority over "shiftKeyRotate" handler
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
- // @option bounceAtZoomLimits: Boolean = true
15
- // Set it to false if you don't want the map to zoom beyond min/max zoom
16
- // and then bounce back when pinch-zooming.
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
- /// TODO: The pivot should be the last touch point, but zoomAnimation manages to
96
- /// overwrite the rotate pane position. Maybe related to #3529.
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
- // @section Handlers
165
- // @property touchGestures: Handler
166
- // Touch gestures handler.
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
- // @section Touch interaction options
12
- // @option touchRotate: Boolean|String = *
13
- // Whether the map can be rotated with a two-finger rotation gesture
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
- // @section Handlers
32
- // @property touchZoom: Handler
33
- // Touch rotate handler.
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
- // @section Touch interaction options
14
- // @option touchZoom: Boolean|String = *
15
- // Whether the map can be zoomed by touch-dragging with two fingers. If
16
- // passed `'center'`, it will zoom to the center of the view regardless of
17
- // where the touch events (fingers) were. Enabled for touch-capable web
18
- // browsers.
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
- * @TODO check if this is a duplicate of `L.Map.TouchGestures::bounceAtZoomLimits`
23
+ *
23
24
  */
24
25
 
25
- // @option bounceAtZoomLimits: Boolean = true
26
- // Set it to false if you don't want the map to zoom beyond min/max zoom
27
- // and then bounce back when pinch-zooming.
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
- // @section Handlers
48
- // @property touchZoom: Handler
49
- // Touch zoom handler.
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);
package/test/index.html CHANGED
@@ -26,6 +26,7 @@
26
26
  border: 1px solid #ccc;
27
27
  max-height: 50vh;
28
28
  }
29
+ /* TODO: fix incorrect map corners position when map has some margin */
29
30
  html, body {
30
31
  /* margin: 0; */
31
32
  /* padding: 0; */
@@ -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.call(this);
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.call(this);
19
- // this._map.off('rotate', this._redraw, this);
20
- // },
21
-
22
- // _update: function() {
23
- // canvasProto._update.call(this);
24
- // // Tell paths to redraw themselves
25
- // this.fire('update')
26
- // },
27
-
28
- });
@@ -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.call(this);
13
- // if (this._map._rotate) {
14
- // this.fire('update');
15
- // }
16
- // },
17
-
18
- });