Skip to content

Commit

Permalink
Lock wms crs input to epsg-3857 (issue 600) (#632) (#695)
Browse files Browse the repository at this point in the history
* locked custom wms crs input to epsg-2857

Signed-off-by: Quinn Guerin <[email protected]>

* updated changelog

Signed-off-by: Quinn Guerin <[email protected]>

---------

Signed-off-by: Quinn Guerin <[email protected]>
Signed-off-by: Heemin Kim <[email protected]>
Co-authored-by: Quinn Guerin <[email protected]>
Co-authored-by: Heemin Kim <[email protected]>
(cherry picked from commit 8c7a4ca)

Co-authored-by: Quinn <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and qugu2427 authored Jan 21, 2025
1 parent febb545 commit 26e6a1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Features
### Enhancements
### Bug Fixes
* Locked custom wms crs input to epsg-3857 ([#632](https://github.com/opensearch-project/dashboards-maps/pull/632))
### Infrastructure
### Documentation
### Maintenance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ export const CustomMapSource = ({
value={WMSCoordinateSystem}
onChange={onChangeWMSCoordinateSystem}
fullWidth={true}
value="EPSG:3857"
disabled
/>
</EuiCompressedFormRow>
<EuiSpacer size="m" />
Expand Down
3 changes: 3 additions & 0 deletions public/model/customLayerFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ const getCustomMapURL = (layerConfig: CustomLayerSpecification) => {
return layerSource?.url;
} else if (layerSource?.customType === 'wms') {
const referenceSystemName = layerSource.version === '1.3.0' ? 'crs' : 'srs';
if (!layerSource.crs) {
layerSource.crs = "EPSG:3857"
}
return `${layerSource?.url}?service=WMS&version=${layerSource.version}&request=GetMap&format=${layerSource.format}&transparent=true&layers=${layerSource?.layers}&styles=${layerSource.styles}&${referenceSystemName}=${layerSource.crs}&width=256&height=256&bbox={bbox-epsg-3857}`;
} else {
return '';
Expand Down

0 comments on commit 26e6a1c

Please sign in to comment.