@geoblocks/edittrack
Advanced tools
Comparing version 1.1.8 to 1.2.0
{ | ||
"name": "@geoblocks/edittrack", | ||
"version": "1.1.8", | ||
"version": "1.2.0", | ||
"description": "Geoblocks edittrack", | ||
@@ -38,8 +38,8 @@ "module": "src/index.js", | ||
"@types/chai": "4.3.9", | ||
"@types/mocha": "10.0.2", | ||
"@types/proj4": "2.5.3", | ||
"@typescript-eslint/eslint-plugin": "6.8.0", | ||
"@typescript-eslint/parser": "6.8.0", | ||
"@types/mocha": "10.0.3", | ||
"@types/proj4": "2.5.4", | ||
"@typescript-eslint/eslint-plugin": "6.9.1", | ||
"@typescript-eslint/parser": "6.9.1", | ||
"chai": "4.3.10", | ||
"eslint": "8.51.0", | ||
"eslint": "8.53.0", | ||
"eslint-config-openlayers": "18.0.0", | ||
@@ -49,7 +49,7 @@ "gh-pages": "6.0.0", | ||
"ol": "8.1.0", | ||
"parcel": "2.10.0", | ||
"proj4": "2.9.1", | ||
"parcel": "2.10.2", | ||
"proj4": "2.9.2", | ||
"ts-node": "10.9.1", | ||
"tsconfig-paths": "4.2.0", | ||
"typedoc": "0.25.2", | ||
"typedoc": "0.25.3", | ||
"typescript": "5.2.2" | ||
@@ -56,0 +56,0 @@ }, |
@@ -7,2 +7,9 @@ # Local development | ||
open http://localhost:1234/simple/simple.html | ||
``` | ||
``` | ||
## Publish a new version to npm | ||
```bash | ||
npm version patch | ||
npm publish | ||
git push --tags origin master | ||
``` |
@@ -5,2 +5,2 @@ export {default as TrackManager} from './interaction/TrackManager'; | ||
export {default as SwisstopoProfiler} from './profiler/SwisstopoProfiler'; | ||
export {default as GraphHopperRouter} from './router/GraphHopper'; | ||
export {default as GraphHopperRouter} from './router/GraphHopper.ts'; |
@@ -117,14 +117,14 @@ import {equals} from 'ol/coordinate.js'; | ||
getLineString(): LineString { | ||
const coordinates: Coordinate[] = []; | ||
const lineCoords: Coordinate[] = []; | ||
for (const feature of this.segments) { | ||
const segment = feature.getGeometry().getCoordinates(); | ||
const segmentCoords = feature.getGeometry().getCoordinates(); | ||
// remove the overlap between the last coordinate of a segment and | ||
// the first coordinate of the next one | ||
const overlap = coordinates.length > 0 && equals(segment[0], coordinates[coordinates.length - 1]); | ||
for (let i = overlap ? 1 : 0; i < coordinates.length; ++i) { | ||
coordinates.push(coordinates[i].slice(0, 3)); | ||
const overlapping = lineCoords.length > 0 && equals(segmentCoords[0], lineCoords[lineCoords.length - 1]); | ||
for (let i = overlapping ? 1 : 0; i < segmentCoords.length; ++i) { | ||
lineCoords.push(segmentCoords[i].slice(0, 3)); | ||
} | ||
} | ||
console.assert(isXYZ(coordinates)); | ||
return new LineString(coordinates); | ||
console.assert(isXYZ(lineCoords)); | ||
return new LineString(lineCoords); | ||
} | ||
@@ -131,0 +131,0 @@ |
@@ -372,3 +372,7 @@ import Feature from 'ol/Feature.js'; | ||
this.shadowTrackLayer_.getSource().addFeatures( | ||
this.source_.getFeatures().map(f => f.clone()) | ||
this.source_.getFeatures().map(f => { | ||
const clone = f.clone(); | ||
clone.setId(f.getId()); | ||
return clone; | ||
}) | ||
); | ||
@@ -499,3 +503,7 @@ } | ||
getPOIs() { | ||
return this.trackData_.getPOIs().map(point => point.clone()); | ||
return this.trackData_.getPOIs().map((point) => { | ||
const clone = point.clone(); | ||
clone.setId(point.getId()); | ||
return clone; | ||
}); | ||
} | ||
@@ -509,2 +517,3 @@ | ||
const clone = point.clone(); | ||
clone.setId(point.getId()); | ||
clone.set('index', index); | ||
@@ -521,2 +530,3 @@ return clone; | ||
const clone = segment.clone(); | ||
clone.setId(segment.getId()); | ||
clone.set('index', index); | ||
@@ -611,3 +621,8 @@ return clone; | ||
if (features) { | ||
this.restoreFeaturesInternal_(features.map(feature => feature.clone())); | ||
this.restoreFeaturesInternal_(features.map(feature => { | ||
const clone = feature.clone(); | ||
clone.setId(feature.getId()); | ||
return clone; | ||
} | ||
)); | ||
this.notifyTrackChangeEventListeners_(false); | ||
@@ -626,3 +641,7 @@ } | ||
if (features) { | ||
this.restoreFeaturesInternal_(features.map(feature => feature.clone())); | ||
this.restoreFeaturesInternal_(features.map(feature => { | ||
const clone = feature.clone(); | ||
clone.setId(feature.getId()); | ||
return clone; | ||
})); | ||
this.notifyTrackChangeEventListeners_(false); | ||
@@ -629,0 +648,0 @@ } |
@@ -7,3 +7,3 @@ import { distance } from 'ol/coordinate'; | ||
type RouterBaseOptions = { | ||
export type RouterBaseOptions = { | ||
map: Map; | ||
@@ -10,0 +10,0 @@ maxRoutingTolerance?: number; |
15
1
77393
2141