ckan / ckanext-spatial

Geospatial extension for CKAN
http://docs.ckan.org/projects/ckanext-spatial
125 stars 190 forks source link

Current used Default Basemap is not going to be avaliable from 31. October #317

Closed MarijaKnezevic closed 8 months ago

MarijaKnezevic commented 9 months ago

Currently used basemap (Stamen Terrain) is not going to be avaliable from 31. October 2023 (see attached image).

Stamen-backgroundmap

Could it be updated so that by default the other basemap is used? (e.g. OpenStreetMap https://tile.openstreetmap.org/${z}/${x}/${y}.png ; Tile Usage Policy or some other map)?

EricSoroos commented 9 months ago

The option that we're using is going with stadiamaps, the service that's taken over this tile style. -- though it's not going to work without at least a free account.

Once you have an account and add a domain to it, it is a drop-in replacement with some ckan.ini additions:

ckanext.spatial.common_map.custom.url =  https://tiles-eu.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}@2x.png
ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.attribution = Map tiles by <a href="https://www.stadiamaps.com" target="_blank">Stadia Maps</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.
amercader commented 8 months ago

The bottom line is that currently there is no service that we can add as default that won't require some form of configuration by the user, which was the main selling point of the Stamen tiles. My plan going forward is to:

  1. Not set any background tiles by default and clearly mark to the user that they should (see below)
  2. Make really easy to choose and configure a provider, rather than the current cumbersome config system. For this I'll integrate the leaflet-providers plugin so we can add any of the providers they support with just two/three config options (type and API key)
  3. Keep existing options for backwards compatibility.

It's nice to get a map with zero config but sadly that's no longer possible, so I think that's the best experience for new users. I'll send a PR briefly.

Screenshot 2023-10-26 at 12-57-05 Dataset - CKAN

mmdolbow commented 8 months ago

Just want to comment for anyone else looking to patch immediately with their .ini file configuration, when I attempted this at first by placing the configuration at the end, the update didn't work. Putting the config in the middle of the file, between Front-End settings and Internationalization, worked. (Sorry if that's a noob mistake.)

I used the Esri WorldTopoMap, since we have Esri licensing.

ckanext.spatial.common_map.custom.url = https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}.jpg

amercader commented 8 months ago

I just released ckanext-spatial 2.1.0 which adds support for may different tile providers via Leaflet-providers. Please check the documentation for details on how to configure your map widgets and avoid the Stamen error tiles when using the old default tiles:

https://docs.ckan.org/projects/ckanext-spatial/en/latest/map-widgets.html

amercader commented 8 months ago

@mmdolbow no need to apologize, it's easy to get confused by this!

All CKAN settings, including the ckanext.spatial.* ones should be placed inside the [app:main] section, i.e. before the [loggers] one in the ini file