@geoblocks/edittrack
Advanced tools
Comparing version 1.2.10 to 1.2.11
{ | ||
"name": "@geoblocks/edittrack", | ||
"version": "1.2.10", | ||
"version": "1.2.11", | ||
"description": "Geoblocks edittrack", | ||
@@ -53,7 +53,4 @@ "module": "src/index.js", | ||
"typedoc": "0.25.4", | ||
"typescript": "5.3.2" | ||
"typescript": "5.3.3" | ||
}, | ||
"optionalDependencies": { | ||
"@geoblocks/d3profile": "0.0.6" | ||
}, | ||
"peerDependencies": { | ||
@@ -60,0 +57,0 @@ "ol": "^6 || ^7 || ^8.0.0", |
@@ -533,2 +533,15 @@ import Feature from 'ol/Feature.js'; | ||
/** | ||
* Delete a POI and notify track change listeners. | ||
* @param {number} index | ||
*/ | ||
deletePOI(index) { | ||
const poi = this.trackData_.getPOIs().find(feature => feature.get('index') === index); | ||
const feature = this.source_.getFeatures().find(feature => feature.get('index') === index); | ||
this.source_.removeFeature(feature); | ||
this.trackData_.deletePOI(poi); | ||
this.trackData_.updatePOIIndexes(); | ||
this.notifyTrackChangeEventListeners_(); | ||
} | ||
/** | ||
* Add new event listener to be notified on track changes. | ||
@@ -611,2 +624,3 @@ * @param {Function} fn EventListener | ||
await this.restoreFeaturesInternal_(features.map(feature => { | ||
// we need to clone the features, otherwise they could be changed in the history state from outside | ||
const clone = feature.clone(); | ||
@@ -631,2 +645,3 @@ clone.setId(feature.getId()); | ||
await this.restoreFeaturesInternal_(features.map(feature => { | ||
// we need to clone the features, otherwise they could be changed in the history state from outside | ||
const clone = feature.clone(); | ||
@@ -633,0 +648,0 @@ clone.setId(feature.getId()); |
75975
2
2052