]> git.argeo.org Git - gpl/argeo-suite.git/blob - js/src/geo/OpenLayersUtils.js
Run npm install before build
[gpl/argeo-suite.git] / js / src / geo / OpenLayersUtils.js
1 import { transformExtent } from 'ol/proj.js';
2
3
4 export function transformToLatLonExtent(extent, projection) {
5 const proj = projection.getCode();
6 if (proj === 'EPSG:4326')
7 return toLatLonExtent(extent);
8 var transformed = transformExtent(extent, proj, 'EPSG:4326');
9 return toLatLonExtent(transformed);
10 }
11
12 export function toLatLonExtent(extent) {
13 return [extent[1], extent[0], extent[3], extent[2]];
14 }