From 01c78ed1f765fc3de8a3504ff79a6af5f86a949e Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Sun, 13 Dec 2020 13:43:51 +1100 Subject: [PATCH] fix(track): ensure places node list will update when track name changes Resolves #842 The caller updating the track name (or other values) still has to call track.dispatchEvent(new os.events.PropertyChangeEvent(os.annotation.EventType.UPDATE_PLACEMARK)); --- src/plugin/track/track.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugin/track/track.js b/src/plugin/track/track.js index 2d25e740d..9a3d9a183 100644 --- a/src/plugin/track/track.js +++ b/src/plugin/track/track.js @@ -466,6 +466,7 @@ plugin.track.updateTrackZIndex = os.track.updateTrackZIndex; * * @param {!os.track.CreateOptions} options The options object for the track. * @return {os.track.TrackFeatureLike|undefined} The track feature. + * @suppress {accessControls} for onFeatureChange access */ plugin.track.createAndAdd = function(options) { var track = os.track.createTrack(options); @@ -479,6 +480,7 @@ plugin.track.createAndAdd = function(options) { var trackNode = plugin.file.kml.ui.updatePlacemark({ 'feature': track }); + ol.events.listen(track, goog.events.EventType.PROPERTYCHANGE, trackNode.onFeatureChange, trackNode); var rootNode = plugin.places.PlacesManager.getInstance().getPlacesRoot(); if (rootNode) {