[gnome-maps/wip/mlundblad/fix-selecting-turnpoint: 1/2] mapView: Fix removing previous turnpoint marker




commit c0e4826d8ac65e905967228147ded4d4bcc085e2
Author: Marcus Lundblad <ml dfupdate se>
Date:   Thu Sep 22 22:45:39 2022 +0200

    mapView: Fix removing previous turnpoint marker
    
    Use the proper remove_marker() method to remove
    the previous marker when showing a new turnpoint.

 src/mapView.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index e6c3c96e..7b267501 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -774,7 +774,7 @@ export class MapView extends Gtk.Overlay {
 
     showTurnPoint(turnPoint) {
         if (this._turnPointMarker)
-            this._turnPointMarker.destroy();
+            this._instructionMarkerLayer.remove_marker(this._turnPointMarker);
 
         this._turnPointMarker = null;
         if (turnPoint.isStop())
@@ -788,7 +788,7 @@ export class MapView extends Gtk.Overlay {
 
     showTransitStop(transitStop, transitLeg) {
         if (this._turnPointMarker)
-            this._turnPointMarker.destroy();
+            this._instructionMarkerLayer.remove_marker(this._turnPointMarker);
 
         this._turnPointMarker = new TurnPointMarker({ transitStop: transitStop,
                                                       transitLeg: transitLeg,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]