Coordinates Converter input validation

Hi there,

I am adding a “coordinates” feature on my web map to display the SVY21 coordinates based on a mouse event. The web map is in EPSG:3857 so I am using the Coordinates Converter API to handle the conversion from 3857 to 3414. However, I noticed that the API returns a value even if the map is not within the general Singapore region. My solution is add a few extra few lines of code to check if the coordinates in 3857 are within the projected bounds defined here.

Is it be possible or helpful to have this logic implemented on the server side? Someone that is unfamiliar with coordinate systems may not catch this “error” as a valid value is returned.

Yijun

Hello @Yijun,

Is your map also using SVY21 projection in order to display SVY21 coordinates?

Hi @kyroskoh, the web map is using EPSG:3857 (WGS 84 Web Mercator) and using the coordinates converter API to handle the conversion from 3857 to 3414 (SVY21). See demo here.

Yijun

Hi @Yijun,

To have better performance, you can do on the server end.