From 65bc8edc39b16f841b3ff7530460b5ecfdc5dc37 Mon Sep 17 00:00:00 2001 From: Raruto Date: Sun, 7 Mar 2021 01:11:55 +0100 Subject: [PATCH] update readme and examples to 1.6.0 --- README.md | 7 ++- examples/demo.kml | 2 +- examples/leaflet-elevation.html | 4 +- examples/leaflet-elevation_geojson-data.html | 10 ++-- examples/leaflet-elevation_kml-data.html | 62 +++++++++++++++----- 5 files changed, 59 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index a1baf40e..9002c29a 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,10 @@ _Related: [Leaflet-UI presets](https://github.com/raruto/leaflet-ui), [QGIS Inte --- **Compatibile with:** -[![Leaflet 1.x compatible!](https://img.shields.io/badge/Leaflet-1.3.2-1EB300.svg?style=flat)](http://leafletjs.com/reference.html) -[![leaflet-gpx 1.5 compatibile!](https://img.shields.io/badge/Leaflet%20GPX-1.5.0-1EB300.svg?style=flat)](https://github.com/mpetazzoni/leaflet-gpx) -[![d3.js v5 compatibile!](https://img.shields.io/badge/d3.js-5.15-1EB300.svg?style=flat)](https://www.npmjs.com/package/d3) +[![Leaflet 1.x compatible!](https://img.shields.io/badge/Leaflet-1.6.0-1EB300.svg?style=flat)](http://leafletjs.com/reference.html) +[![d3.js v6 compatibile!](https://img.shields.io/badge/d3.js-6.5-1EB300.svg?style=flat)](https://www.npmjs.com/package/d3) +[![@tmcw/togeojson v4.1.0 compatibile!](https://img.shields.io/badge/@tmcw/togeojson-4.1-1EB300.svg?style=flat)](https://www.npmjs.com/package/@tmcw/togeojson) + --- diff --git a/examples/demo.kml b/examples/demo.kml index 04d99d75..0514bc8a 100644 --- a/examples/demo.kml +++ b/examples/demo.kml @@ -1,7 +1,7 @@ - via-emilia.gpx + demo.kml diff --git a/examples/leaflet-elevation.html b/examples/leaflet-elevation.html index adc6e2eb..8efee50a 100644 --- a/examples/leaflet-elevation.html +++ b/examples/leaflet-elevation.html @@ -62,8 +62,8 @@ imperial: false, // altitude: "disabled", slope: "disabled", - speed: "disabled", - acceleration: "disabled", + speed: false, + acceleration: false, time: "summary", legend: true, followMarker: false, diff --git a/examples/leaflet-elevation_geojson-data.html b/examples/leaflet-elevation_geojson-data.html index 7875843a..0e37913e 100644 --- a/examples/leaflet-elevation_geojson-data.html +++ b/examples/leaflet-elevation_geojson-data.html @@ -50,7 +50,7 @@ resizerControl: true, }, elevationControl: { - url: "https://raruto.github.io/leaflet-elevation/examples/demo.gpx", + url: "https://raruto.github.io/leaflet-elevation/examples/demo.geojson", options: { theme: "lime-theme", collapsed: false, @@ -61,10 +61,10 @@ summary: "inline", imperial: false, // altitude: "disabled", - slope: "disabled", - speed: "disabled", - acceleration: "disabled", - time: "summary", + slope: true, + speed: false, + acceleration: false, + time: true, legend: true, followMarker: false, }, diff --git a/examples/leaflet-elevation_kml-data.html b/examples/leaflet-elevation_kml-data.html index 815d780d..d8cb599a 100644 --- a/examples/leaflet-elevation_kml-data.html +++ b/examples/leaflet-elevation_kml-data.html @@ -29,14 +29,11 @@ - - - - + - - + + @@ -55,10 +52,21 @@ elevationControl: { url: "https://raruto.github.io/leaflet-elevation/examples/demo.kml", options: { - theme: "lightblue-theme", + theme: "yellow-theme", collapsed: false, + autohide: false, + autofitBounds: true, + position: "bottomleft", detached: true, - summary: "multiline", + summary: "inline", + imperial: false, + // altitude: "disabled", + slope: "disabled", + speed: "disabled", + acceleration: "disabled", + time: true, + legend: true, + followMarker: false, }, }, layersControl: { @@ -80,13 +88,37 @@ controlLayer.addOverlay(e.layer, e.name); }); - fetch(opts.elevationControl.url) - .then((response) => response.text()) - .then((xml) => { - var data = toGeoJSON.kml(new DOMParser().parseFromString(xml, "text/xml")); - if(!data.name) data.name = data.features[0].properties.name; - controlElevation.load(data); - }); + controlElevation.load(opts.elevationControl.url); + + + +