Answer the question
In order to leave comments, you need to log in
How to get layer size in meters?
Hello. There is a layer in the L.CRS.Simple coordinate system on the map. The layer must somehow be changed in meters
[if you calculate the size of the layer in width, you get 14900 km, which is a lot]. That is, let's say there is known data on how many meters the width and height should be
"Width": 0.008863744, "Height": 0.008372224, in meters. The pixel size is also known in meters.
6.4e-8. Can I somehow use this for calculation?
Answer the question
In order to leave comments, you need to log in
sumrakx , you first need to change the coordinate system. If you use a background for example Google, and overlay a layer with a picture on it, for example imageOverlay, then this layer can have:
let one = tile.getBounds()._northEast;
let two = tile.getBounds()._southWest;
getWidthAndHeight(southWest, southEast, northEast) { // получаем длины вертикальной и горизонтальной линии
this.points = [
new L.LatLng(southWest[0], southWest[1]),
new L.LatLng(southEast[0], southEast[1]),
new L.LatLng(northEast[0], northEast[1])
];
this.data.width = +(this.points[0].distanceTo(this.points[1])).toFixed(0);
this.data.height = +(this.points[1].distanceTo(this.points[2])).toFixed(0);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question