limit elevation lat/long decimal places to 7

This commit is contained in:
Miko 2025-02-05 00:44:01 +01:00 committed by Andrew Calcutt
parent 6ef12fba6c
commit 5dcd47165c
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ class ElevationInfoControl {
map.on('click', (e) => { map.on('click', (e) => {
var url = this.url; 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) { for(var key in coord) {
url = url.replace(new RegExp('{'+ key +'}','g'), coord[key]); url = url.replace(new RegExp('{'+ key +'}','g'), coord[key]);
} }

View file

@ -259,8 +259,8 @@ export const serve_data = {
let data = fetchTile.data; let data = fetchTile.data;
var param = { var param = {
long: bbox[0], long: bbox[0].toFixed(7),
lat: bbox[1], lat: bbox[1].toFixed(7),
encoding, encoding,
format, format,
tile_size: TILE_SIZE, tile_size: TILE_SIZE,