[ckan-dev] Important: MapQuest tiles failing on spatial widgets and maps, workarounds and alternatives
Adrià Mercader
adria.mercader at okfn.org
Tue Jul 12 16:13:08 UTC 2016
Hi all,
If your favourite CKAN instance uses any of the map widgets provided
by ckanext-spatial or ckanext-geoview (spatial query, dataste extent,
GeoJSON preview, etc), chances are that you are getting an ugly image
from MapQuest instead of the usual base map:
http://otile1.mqcdn.com/tiles/1.0.0/osm/0/0/0.png
This was caused by MapQuest discontinuing support for direct access to
map tiles (In my opinion rather abruptly, and looking at the forums
the CKAN community is not the only one that has missed this):
http://devblog.mapquest.com/2016/06/15/modernization-of-mapquest-results-in-changes-to-open-tile-access/
You can provide a working alternative right now without any code
change, just by configuring an alternative base layer [1]. The
recommended options are:
1. MapBox. Register for an account [2] 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...
2. Other tile providers. There are a couple of other free tile
providers that don't require registration or have free plans.
Thunderforest (http://www.thunderforest.com/) offers OSM based tiles.
(registration is recommended [3]). 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 (https://maptiles.xyz/) 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>.
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.
As for MapQuest support, given the new Leaflet plugin required [4] and
the current structure of the JS modules it is not trivial to support
it straight away. If someone has extra time to submit a patch that
allows to use the new plugin that would be great.
In any case, it definitely seems like it should not be the default
option any more.
Hope this helps in the short term.
Any question just ask.
Adrià
[1] http://docs.ckan.org/projects/ckanext-spatial/en/latest/map-widgets.html
[2] https://www.mapbox.com/pricing/
[3] http://www.thunderforest.com/pricing/
[4] https://developer.mapquest.com/documentation/leaflet-plugins
More information about the ckan-dev
mailing list