opensearch-project / dashboards-maps

:globe_with_meridians: User interface for the backend geospatial plugin which can be integrated with OpenSearch Dashboards and a home for all other map related features.
https://opensearch.org/docs/latest/dashboards/geojson-regionmaps/#custom-vector-maps-with-geojson
Apache License 2.0
17 stars 44 forks source link

Lock wms crs input to epsg-3857 (issue 600) #632

Open qugu2427 opened 1 month ago

qugu2427 commented 1 month ago

Description

Disable the custom wms crs input and set it to a constant value of EPSG:3857.

Currently, users are able to input a different crs into the curstom wms field. The problem is that maplibre only allows epsg-3857 (see https://github.com/opensearch-project/dashboards-maps/issues/600#issuecomment-2218484539), thus inputting any other value creates an incorrect bbox which essentially ruins the whole map.

Though this is not a perfect 'fix', it does prevent these bbox errors from occuring. Additionally, most map servers will allow epsg-3857 as a source.

Issues Resolved

https://github.com/opensearch-project/dashboards-maps/issues/600

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

junqiu-lei commented 1 month ago

Thanks for sharing the context for maplibre supported projections, like it metioned:

MapLibre Native supports Web Mercator (EPSG:3857) as its only supported projection. This fulfills most of the web and device map needs. At the time of writing, modern map renderers such as Google Maps and Mapbox GL offers 3D globe, conic, and rectangular projections too. At the time of writing, MapLibre Native renderer component does not have an architectural separation for supporting multiple projections and coordinate reference systems.

In this case, maybe we remove crs field component on UI and use the fixed constant value of EPSG:3857 here?

qugu2427 commented 1 month ago

@junqiu-lei Per https://github.com/maplibre/maplibre-gl-js/issues/168, there is a very slow push to add support for additional crs types. My thinking was that leaving the wms crs ui field, would make it trivial to re-enable once maplibre adds support. Additionally, it would at least alert users to the fact that they can only use epsg-3857, which could save them a headache since some legacy sources do not support epsg-3857.