@raruto/leaflet-elevation 1.8.3 → 1.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raruto/leaflet-elevation",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "A Leaflet plugin that allows to add elevation profiles using d3js",
5
5
  "main": "dist/leaflet-elevation.min.js",
6
6
  "module": "src/index.js",
package/src/chart.js CHANGED
@@ -214,6 +214,7 @@ export var Chart = L.Class.extend({
214
214
  this._updateScale(); // hacky way for restoring x scale when zooming out
215
215
  this.zooming = true;
216
216
  this._scales.distance = this._x = e.transform.rescaleX(this._x); // calculate x scale at zoom level
217
+ if (this._scales.time) this._scales.time = e.transform.rescaleX(this._scales.time); // calculate x scale at zoom level
217
218
  this._resetDrag();
218
219
  if (e.sourceEvent && e.sourceEvent.type == "mousemove") {
219
220
  this._hideDiagramIndicator();
@@ -374,7 +375,9 @@ export var Chart = L.Class.extend({
374
375
  let opts = this.options;
375
376
  let scale = props.scale;
376
377
 
377
- if (typeof scale !== 'function') {
378
+ if (typeof this._scales[props.name] === 'function') {
379
+ props.scale = this._scales[props.name]; // retrieve cached scale
380
+ } else if (typeof scale !== 'function') {
378
381
  scale = L.extend({
379
382
  data : this._data,
380
383
  forceBounds: opts.forceAxisBounds
package/src/control.js CHANGED
@@ -17,7 +17,7 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
17
17
  __TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.3.0/dist/togeojson.umd.js',
18
18
  __LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
19
19
  __LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
20
- __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.3/libs/leaflet-distance-marker.min.js',
20
+ __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.4/libs/leaflet-distance-marker.min.js',
21
21
 
22
22
  /*
23
23
  * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
package/src/index.css CHANGED
@@ -36,10 +36,6 @@
36
36
  user-select: none;
37
37
  }
38
38
 
39
- .elevation-control.elevation .background.zoomed .axis.time {
40
- display: none;
41
- }
42
-
43
39
  .elevation-control.elevation .axis line,
44
40
  .elevation-control.elevation .axis path {
45
41
  stroke: #2D1130;