Open grantfitzsimmons opened 7 months ago
@maxpatiiuk – If you are available to spend some time looking at this with me sometime in the next few weeks/months, I would appreciate it. If you want to try and solve this alone, that is OK too 😉 . In any case, your insight is appreciated!
(a message from out marketing deparment 😊)
- "Street Map (ESRI)": {
+ "Street Map (Esri)": {
It may be as simple as studying the implementation done in this repository and adding it here: https://github.com/rkaravia/Leaflet.TileLayer.Swiss
Looking at the code, it's not too complicated, but in this case I would favor using their library rather than doing that work on our own - Specify is not in a business of maintaining GIS code
Though, my suggestions about the implementation:
I don't like the idea of loading all those maps on every specify page load for every institution and having the layer list be populated with a hundred layers, of which almost all are usable only in one country at a narrow set of zoom levels
Is your feature request related to a problem? Please describe. We've heard from numerous Swiss institutions that being able to integrate with Swisstopo would be an incredibly useful utility for them. Since we already have integrated Leaflet into Specify, it seems natural to extend this to have all the Swisstopo base maps and layers so that they can effectively visualize their data on the maps provided by the service.
I've created a new leaflet layers JSON file that contains many of these maps as a starting point. From the troubleshooting I've done and based on discussions with Max, it seems that we'll need to add support for the coordinate projection system these maps rely on. When importing this file directly into Specify, it repeatedly reports that there is a bad request because tile is out of bounds.
topolayers.json.zip
Swisstopo uses the coordinate projection system LV95 (EPSG:2056), which is captured in the
layerOptions
asFortunately, there is already a plugin that adds support for this CRS: https://leaflet-tilelayer-swiss.karavia.ch/installation
It may be as simple as studying the implementation done in this repository and adding it here: https://github.com/rkaravia/Leaflet.TileLayer.Swiss
I am happy to help create the default leaflet layers file after the CRS is supported.
For example, here's a snippet you can add in a new leaflet layer app resource for testing/evaluation: leaflet-layers-swisstopo.json.zip
Reported By Several Swiss Museums of Natural History (Bern, Basel, Lausanne)