How find current utm zone from lon lat position (from mapcenter for example) ?
I need to determine which utm zone currently is from my position.
How find current utm zone from lon lat position (from mapcenter for example) ?
I need to determine which utm zone currently is from my position.
function getUtmZoneFromPosition(lon,lat) {
return (Math.floor((lon + 180) / 6) % 60) + 1;
}
and in ol3
use function this way
function getCurrentUtmZone() {
var position = ol.proj.transform(mapObj.getView().getCenter(), mapObj.getView().getProjection(), "EPSG:4326");
return getUtmZoneFromPosition(position[0]);
}
var currentZone=getCurrentUtmZone();
Thanks to Determining UTM zone (to convert) from longitude/latitude