diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-27 22:10:12 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-27 22:10:14 +0800 |
commit | 29b8074880011bbe62855430a10c2b0b3631483e (patch) | |
tree | 16f495c0cd5431db3c664f9d75dc3b74ebfc00c8 | |
parent | d2e8d4ba513b30ed0963adaa819eac4b88b087e9 (diff) |
refactor: rename setGeoSchemeByCRS -> updateGeoSchemeByCRS
-rw-r--r-- | src/dumbyUtils.mjs | 3 | ||||
-rw-r--r-- | src/dumbymap.mjs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs index 02cabca..1993b02 100644 --- a/src/dumbyUtils.mjs +++ b/src/dumbyUtils.mjs | |||
@@ -131,12 +131,11 @@ export const addGeoSchemeByText = async (node) => { | |||
131 | } | 131 | } |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * setGeoSchemeByCRS. | ||
135 | * @description Add more information into Anchor Element within Geo Scheme by CRS | 134 | * @description Add more information into Anchor Element within Geo Scheme by CRS |
136 | * @param {String} crs - EPSG/ESRI Code for CRS | 135 | * @param {String} crs - EPSG/ESRI Code for CRS |
137 | * @return {Function} - Function for link | 136 | * @return {Function} - Function for link |
138 | */ | 137 | */ |
139 | export const setGeoSchemeByCRS = (crs) => (link) => { | 138 | export const updateGeoSchemeByCRS = (crs) => (link) => { |
140 | const transform = proj4(crs, 'EPSG:4326') | 139 | const transform = proj4(crs, 'EPSG:4326') |
141 | const params = new URLSearchParams(link.search) | 140 | const params = new URLSearchParams(link.search) |
142 | let xy = params.get('xy')?.split(',')?.map(Number) | 141 | let xy = params.get('xy')?.split(',')?.map(Number) |
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 3c849e1..ccec8dd 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs | |||
@@ -317,7 +317,7 @@ export const generateMaps = (container, { | |||
317 | const crsString = container.dataset.crs | 317 | const crsString = container.dataset.crs |
318 | Promise.all([fromEPSGCode(crsString), addGeoScheme]).then((values) => { | 318 | Promise.all([fromEPSGCode(crsString), addGeoScheme]).then((values) => { |
319 | values.at(-1) | 319 | values.at(-1) |
320 | .map(utils.setGeoSchemeByCRS(crsString)) | 320 | .map(utils.updateGeoSchemeByCRS(crsString)) |
321 | .filter(link => link) | 321 | .filter(link => link) |
322 | .forEach(GeoLink) | 322 | .forEach(GeoLink) |
323 | }) | 323 | }) |