Skip to content

Commit

Permalink
limit elevation lat/long decimal places to 7
Browse files Browse the repository at this point in the history
  • Loading branch information
okimiko committed Feb 4, 2025
1 parent 1d60dd6 commit 131b78a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/resources/elevation-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ElevationInfoControl {

map.on('click', (e) => {
var url = this.url;
var coord = {"z": Math.floor(map.getZoom()), "x": e.lngLat["lng"], "y": e.lngLat["lat"]};
var coord = {"z": Math.floor(map.getZoom()), "x": e.lngLat["lng"].toFixed(7), "y": e.lngLat["lat"].toFixed(7)};
for(var key in coord) {
url = url.replace(new RegExp('{'+ key +'}','g'), coord[key]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/serve_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ export const serve_data = {

let data = fetchTile.data;
var param = {
long: bbox[0],
lat: bbox[1],
long: bbox[0].toFixed(7),
lat: bbox[1].toFixed(7),
encoding,
format,
tile_size: TILE_SIZE,
Expand Down

0 comments on commit 131b78a

Please sign in to comment.