Skip to content

Commit

Permalink
Elevation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
morehawes committed Feb 22, 2024
1 parent 1b30e86 commit 874c2d4
Show file tree
Hide file tree
Showing 6 changed files with 2,238 additions and 26 deletions.
17 changes: 9 additions & 8 deletions dist/js/waymark-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -9628,23 +9628,24 @@ function Waymark_Map_Viewer() {
Waymark.elevation_control.loadData(feature);
}

layer.on("click", function (e) {
jQuery(layer).on("click", { W: Waymark }, function (e) {
var W = e.data.W;
var feature = e.target.feature;

//Clear chart
Waymark.elevation_control.clear();
W.elevation_control.clear();

//Clear Map layer
if (typeof Waymark.elevation_control.layer !== "undefined") {
Waymark.elevation_control.layer.removeFrom(Waymark.map);
if (typeof W.elevation_control.layer !== "undefined") {
W.elevation_control.layer.removeFrom(W.map);
}

//Feature has elevation data
Waymark.elevation_container.hide();
if (Waymark.line_has_elevation_data(feature)) {
Waymark.elevation_container.show();
W.elevation_container.hide();
if (W.line_has_elevation_data(feature)) {
W.elevation_container.show();

Waymark.elevation_control.loadData(feature);
W.elevation_control.loadData(feature);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/waymark-js.min.js

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions docs/public/dist/latest/js/waymark-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -9628,23 +9628,24 @@ function Waymark_Map_Viewer() {
Waymark.elevation_control.loadData(feature);
}

layer.on("click", function (e) {
jQuery(layer).on("click", { W: Waymark }, function (e) {
var W = e.data.W;
var feature = e.target.feature;

//Clear chart
Waymark.elevation_control.clear();
W.elevation_control.clear();

//Clear Map layer
if (typeof Waymark.elevation_control.layer !== "undefined") {
Waymark.elevation_control.layer.removeFrom(Waymark.map);
if (typeof W.elevation_control.layer !== "undefined") {
W.elevation_control.layer.removeFrom(W.map);
}

//Feature has elevation data
Waymark.elevation_container.hide();
if (Waymark.line_has_elevation_data(feature)) {
Waymark.elevation_container.show();
W.elevation_container.hide();
if (W.line_has_elevation_data(feature)) {
W.elevation_container.show();

Waymark.elevation_control.loadData(feature);
W.elevation_control.loadData(feature);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion docs/public/dist/latest/js/waymark-js.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 874c2d4

Please sign in to comment.