ol-elevation-profile 1.0.0 → 1.1.0
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 +19 -1
- package/dist/ol-elevation-profile.esm.js +576 -31
- package/dist/ol-elevation-profile.esm.min.js +2 -2
- package/dist/ol-elevation-profile.js +578 -34
- package/dist/ol-elevation-profile.min.js +2 -2
- package/package.json +4 -3
- package/src/ol-elevation-profile.js +576 -31
package/README.md
CHANGED
|
@@ -88,7 +88,25 @@ A track with **no Z** — drawn by hand, traced over a basemap, exported by a to
|
|
|
88
88
|
|
|
89
89
|
Elevation is interpolated bilinearly between the four surrounding pixels — reading the containing pixel would make the profile advance in stairs, and every stair counts as a climb then a descent in the D+. A track is filled **entirely or not at all**: a profile missing a few points dives to sea level and its D+ becomes absurd. Tracks that already carry their own Z are untouched.
|
|
90
90
|
|
|
91
|
-
Accuracy is roughly 30–90 m depending on the region (mean 16 m from IGN's 1 m reference on steep alpine terrain). Any
|
|
91
|
+
Accuracy is roughly 30–90 m depending on the region (mean 16 m from IGN's 1 m reference on steep alpine terrain). Any of these can be used instead:
|
|
92
|
+
|
|
93
|
+
| `dem` | Source |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `'terrarium'` (default) | AWS Terrain Tiles, keyless, worldwide |
|
|
96
|
+
| `'ign'` | IGN Géoplateforme RGE ALTI, France, metre-accurate, keyless |
|
|
97
|
+
| `{ url: '.../{z}/{x}/{y}.png' }` | any XYZ tile set, `terrarium` or `mapbox` encoding, or your own decoder |
|
|
98
|
+
| `{ wms: { url, layers } }` | WMS tiles, one `GetMap` per tile |
|
|
99
|
+
| `{ olSource }` | any `ol/source/TileImage`, or **`ol/source/GeoTIFF`** for a COG or a WCS `GetCoverage` |
|
|
100
|
+
| `{ featureInfo: { url, layers } }` | GeoServer greyscale coverage, through WMS `GetFeatureInfo` |
|
|
101
|
+
| a function | you fetch the elevations yourself, from any API |
|
|
102
|
+
|
|
103
|
+
Every source but `featureInfo` is sampled with **bilinear interpolation** between the four surrounding pixels. See the [guide](https://lc-4918.github.io/ol-elevation-profile/guide/features#terrain-model).
|
|
104
|
+
|
|
105
|
+
### PNG export
|
|
106
|
+
|
|
107
|
+
`exportPng: true` adds a button to the toolbar, to the right of the zoom buttons, saving the **whole panel** as an image: title, stats line, slope legend and the complete chart with both axes. `profile.exportPNG()` does the same from code and resolves with the `Blob`; `{ download: false }` returns it without saving, `scale` defaults to the device pixel ratio.
|
|
108
|
+
|
|
109
|
+
The position indicator is left out: it marks where the pointer happens to be, which means nothing once the image is saved. The panel is rebuilt as an SVG rather than screenshotted, with every painting property frozen inline, since a serialized SVG carries no stylesheet.
|
|
92
110
|
|
|
93
111
|
### Attributions
|
|
94
112
|
|