@giro3d/giro3d
Version:
A JS/WebGL framework for 3D geospatial data visualization
17 lines (15 loc) • 486 B
JavaScript
/*
* Copyright (c) 2015-2018, IGN France.
* Copyright (c) 2018-2026, Giro3D team.
* SPDX-License-Identifier: MIT
*/
import proj4 from 'proj4';
import NestedMap from '../../utils/NestedMap';
const createConverter = (src, dst) => proj4(src.id, dst.id);
const cache = new NestedMap();
/**
* Returns a coordinate converter from the specified source and destination CRSes.
*/
export function getConverter(crsIn, crsOut) {
return cache.getOrCreate(crsIn, crsOut, createConverter);
}