Skip to content

Commit

Permalink
[fix] Remove existing points from map in appenData before calling render
Browse files Browse the repository at this point in the history
Remove the existing points from the map in appendData
before calling the render method. Otherwise,
the original points are duplicated on the map.
  • Loading branch information
pandafy committed May 27, 2024
1 parent 9079971 commit 5821b67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/js/netjsongraph.render.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ class NetJSONGraphRender {
features: self.data.features.concat(JSONData.features),
};

// Remove the existing points from the map. Otherwise,
// the original points are duplicated on the map.
self.leaflet.geoJSON.removeFrom(self.leaflet);
self.utils.render();
}

Expand Down

0 comments on commit 5821b67

Please sign in to comment.