@raruto/leaflet-elevation 1.7.4 → 1.7.5
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 +1 -1
- package/dist/leaflet-elevation.js +9 -14
- 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/components.js +1 -1
- package/src/control.js +1 -1
- package/src/utils.js +36 -38
package/README.md
CHANGED
|
@@ -172,8 +172,9 @@
|
|
|
172
172
|
} : L.extend({
|
|
173
173
|
lazy: true
|
|
174
174
|
}, control.options.distanceMarkers);
|
|
175
|
-
var
|
|
176
|
-
|
|
175
|
+
var _control$options = control.options,
|
|
176
|
+
wptIcons = _control$options.wptIcons,
|
|
177
|
+
wptLabels = _control$options.wptLabels;
|
|
177
178
|
var layer = L.geoJson(data, {
|
|
178
179
|
distanceMarkers: distanceMarkers,
|
|
179
180
|
style: function style(feature) {
|
|
@@ -192,23 +193,17 @@
|
|
|
192
193
|
var prop = feature.properties;
|
|
193
194
|
var desc = (_prop$desc = prop.desc) !== null && _prop$desc !== void 0 ? _prop$desc : '';
|
|
194
195
|
var name = (_prop$name = prop.name) !== null && _prop$name !== void 0 ? _prop$name : '';
|
|
195
|
-
var sym = ((_prop$sym = prop.sym) !== null && _prop$sym !== void 0 ? _prop$sym : name).replace(' ', '-').replace('"', '').replace("'", '').toLowerCase(); // Handle
|
|
196
|
+
var sym = ((_prop$sym = prop.sym) !== null && _prop$sym !== void 0 ? _prop$sym : name).replace(' ', '-').replace('"', '').replace("'", '').toLowerCase(); // Handle chart waypoints (dots)
|
|
196
197
|
|
|
197
|
-
if (
|
|
198
|
-
name = '';
|
|
199
|
-
desc = '';
|
|
200
|
-
} // Handle chart waypoints (dots)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if ([true, "dots"].includes(control.options.waypoints)) {
|
|
198
|
+
if ([true, 'dots'].includes(control.options.waypoints)) {
|
|
204
199
|
control._registerCheckPoint({
|
|
205
200
|
latlng: latlng,
|
|
206
|
-
label: name
|
|
201
|
+
label: [true, 'dots'].includes(wptLabels) ? name : ''
|
|
207
202
|
}, true);
|
|
208
203
|
} // Handle map waypoints (markers)
|
|
209
204
|
|
|
210
205
|
|
|
211
|
-
if ([true,
|
|
206
|
+
if ([true, 'markers'].includes(control.options.waypoints) && wptIcons != false) {
|
|
212
207
|
// generate and cache appropriate icon symbol
|
|
213
208
|
if (!wptIcons.hasOwnProperty(sym)) {
|
|
214
209
|
wptIcons[sym] = L.divIcon(L.extend({}, wptIcons[""].options, {
|
|
@@ -220,7 +215,7 @@
|
|
|
220
215
|
icon: wptIcons[sym]
|
|
221
216
|
});
|
|
222
217
|
|
|
223
|
-
if (name || desc) {
|
|
218
|
+
if ([true, 'markers'].includes(wptLabels) && (name || desc)) {
|
|
224
219
|
marker.bindPopup("<b>" + name + "</b>" + (desc.length > 0 ? '<br>' + desc : '')).openPopup();
|
|
225
220
|
}
|
|
226
221
|
|
|
@@ -2124,7 +2119,7 @@
|
|
|
2124
2119
|
__TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.3.0/dist/togeojson.umd.js',
|
|
2125
2120
|
__LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
|
|
2126
2121
|
__LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
|
|
2127
|
-
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.7.
|
|
2122
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.7.5/libs/leaflet-distance-marker.min.js',
|
|
2128
2123
|
|
|
2129
2124
|
/*
|
|
2130
2125
|
* Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
|