@raruto/leaflet-elevation 1.9.1 → 1.9.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/README.md +18 -27
- package/dist/leaflet-elevation.js +13 -22
- package/dist/leaflet-elevation.js.map +1 -1
- package/dist/leaflet-elevation.min.js +1 -1
- package/dist/leaflet-elevation.min.js.map +1 -1
- package/package.json +1 -1
- package/src/control.js +4 -14
- package/src/options.js +1 -1
package/package.json
CHANGED
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.5.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.9.
|
|
20
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.2/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
|
|
@@ -400,17 +400,6 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
|
|
|
400
400
|
if (marker) this._markers.addLayer(marker)
|
|
401
401
|
},
|
|
402
402
|
|
|
403
|
-
_bindPopup: function(marker) {
|
|
404
|
-
let popup = marker._popup;
|
|
405
|
-
if (popup) {
|
|
406
|
-
popup.options.className = 'elevation-popup';
|
|
407
|
-
if (popup._content) {
|
|
408
|
-
popup._content = decodeURI(popup._content);
|
|
409
|
-
popup.bindTooltip(popup._content, { direction: 'auto', sticky: true, opacity: 1, className: 'elevation-tooltip' }).openTooltip();
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
|
|
414
403
|
/**
|
|
415
404
|
* Initialize "L.AlmostOver" integration
|
|
416
405
|
*/
|
|
@@ -754,10 +743,11 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
|
|
|
754
743
|
}
|
|
755
744
|
let marker = L.marker(latlng, { icon: wptIcons[sym] });
|
|
756
745
|
if ([true, 'markers'].includes(wptLabels) && (name || desc)) {
|
|
757
|
-
|
|
746
|
+
let content = decodeURI("<b>" + name + "</b>" + (desc.length > 0 ? '<br>' + desc : ''));
|
|
747
|
+
marker.bindPopup(content, { className: 'elevation-popup', keepInView: true }).openPopup();
|
|
748
|
+
marker.bindTooltip(content, { className: 'elevation-tooltip', direction: 'auto', sticky: true, opacity: 1 }).openTooltip();
|
|
758
749
|
}
|
|
759
750
|
control._addMarker(marker);
|
|
760
|
-
control._bindPopup(marker);
|
|
761
751
|
control.fire('waypoint_added', { point: marker, element: latlng, properties: prop });
|
|
762
752
|
return marker;
|
|
763
753
|
}
|
package/src/options.js
CHANGED
|
@@ -69,7 +69,7 @@ export var Options = {
|
|
|
69
69
|
wptIcons: {
|
|
70
70
|
'': L.divIcon({
|
|
71
71
|
className: 'elevation-waypoint-marker',
|
|
72
|
-
html: '<i class="elevation-waypoint-icon"></i>',
|
|
72
|
+
html: '<i class="elevation-waypoint-icon default"></i>',
|
|
73
73
|
iconSize: [30, 30],
|
|
74
74
|
iconAnchor: [8, 30],
|
|
75
75
|
}),
|