Open MrkGrgsn opened 8 years ago
Wow, that's disappointing, I totally missed any previous announcement. That's bound to affect many people as MapQuest was the default option on all spatial widgets.
It looks like the way to go is to use their Leaflet plugin (or switch provider).
It's unlikely that I'd have time to work on that on the near future, so if someone from the many sites affected wants to jump in I can definitely help with a spec and guidance.
BTW does anyone know of a free alternative to use as default tiles?
We also need to do something about this since the maps are now broken in our instance. But since the whole Finnish public sector is on vacation during July and our another ckan project which should launch multiple instances and probably needs maps won't be starting for another month , we can't do pretty much anything right now.
Looks like a quick solution is to change the following in ckanext-spatial/ckanext/spatial/public/js/common_map.js, from:
baseLayerUrl = '//otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png’
to
baseLayerUrl = '//a.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png’;
Here are some other tile server options: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Tile_servers
I summarized the available options (Excerpt from https://lists.okfn.org/pipermail/ckan-dev/2016-July/010124.html)
You can provide a working alternative right now without any code change, just by configuring an alternative base layer. The recommended options are:
MapBox. Register for an account and get an access token. Then set the following configuration on your ini file:
ckanext.spatial.common_map.type = mapbox
ckanext.spatial.common_map.mapbox.map_id = youraccount.map-xxxxxxxx
ckanext.spatial.common_map.mapbox.access_token = pk.ey...
Other tile providers. There are a couple of other free tile providers that don't require registration or have free plans. Thunderforest offers OSM based tiles. (registration is recommended). Here are the configuration options that you should use:
ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.custom.url = https://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png
ckanext.spatial.common_map.attribution = Maps © <a href="http://www.thunderforest.com">Thunderforest</a>, Data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>
Maptiles offers two base maps based on OSM. (I'd recommend clarify with the author its terms of use):
ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.custom.url = http://{s}.osm.maptiles.xyz/{z}/{x}/{y}.png
ckanext.spatial.common_map.attribution = © <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors. Tiles provided by <a href="https://maptiles.xyz">MapTiles</a>.
Note: Please if you are using the widgets on a production site consider checking the terms for all options described here, and do not hesitate to contact any of them if you have any doubts regarding usage.
@jayhuggins you don't need to change the source code to access these tiles, have a look above for the relevant config options
Some other Basemap tile services not yet mentioned:
BE SURE to check that your use is covered by each service's Terms/Conditions and Attribution requirements - but none of the following require an API Key:
http://openmapsurfer.uni-hd.de/tiles/adminb/x={x}&y={y}&z={z}
http://{s}.tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png
http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png
http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
http://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png
http://{s}.tile.stamen.com/terrain/{z}/{x}/{y}.png
http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png
http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png
:+1: for filing an issue :-1: for this ever becoming an issue (MapQuest)
Since 11 July 2016 MapQuest requires an AppKey in order to load tiles. ckanext-spatial configured to use MapQuest displays an error message directing users to MapQuest's blog instead of the map tiles.