Refactoring of GPS-location (uses featureSource too now), factoring out state, add ReplaceGeometryAction and conflation example

This commit is contained in:
Pieter Vander Vennet 2021-11-03 00:44:53 +01:00
parent 1db54f3c8e
commit 2484848cd6
37 changed files with 1035 additions and 467 deletions

View file

@ -155,7 +155,6 @@ export default class ShowDataLayer {
continue
}
try {
if ((feat.geometry.type === "LineString" || feat.geometry.type === "MultiLineString")) {
const self = this;
const coords = L.GeoJSON.coordsToLatLngs(feat.geometry.coordinates)
@ -190,9 +189,10 @@ export default class ShowDataLayer {
if (options.zoomToFeatures ?? false) {
try {
mp.fitBounds(this.geoLayer.getBounds(), {animate: false})
const bounds = this.geoLayer.getBounds()
mp.fitBounds(bounds, {animate: false})
} catch (e) {
console.error(e)
console.debug("Invalid bounds",e)
}
}