Skip to content

Commit

Permalink
Ignore new marker if same as previous (fixes #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmuguet committed Oct 10, 2017
1 parent 54b7f8f commit 02783ef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/map2gpx.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2355,6 +2355,9 @@ window.onload = function () {
type: 'waypoint'
});

// Ignore this marker if same as previous
if ($.Track.hasMarkers() && $.Track.getLastMarker().getLatLng().equals(marker.getLatLng())) return;

marker.add().progress($.State.updateComputing).done(function () {
marker.setOpacity(1);
});
Expand Down
2 changes: 1 addition & 1 deletion js/map2gpx.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions js/map2gpx.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,10 @@ window.onload = function () {
type: 'waypoint',
});

// Ignore this marker if same as previous
if ($.Track.hasMarkers() && $.Track.getLastMarker().getLatLng().equals(marker.getLatLng()))
return;

marker.add().progress($.State.updateComputing).done(function () {
marker.setOpacity(1);
});
Expand Down
4 changes: 4 additions & 0 deletions src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ window.onload = function () {
type: 'waypoint',
});

// Ignore this marker if same as previous
if ($.Track.hasMarkers() && $.Track.getLastMarker().getLatLng().equals(marker.getLatLng()))
return;

marker.add().progress($.State.updateComputing).done(function () {
marker.setOpacity(1);
});
Expand Down

0 comments on commit 02783ef

Please sign in to comment.