Important: MapQuest tiles failing on spatial widgets and maps, workarounds and alternatives

119 views
Skip to first unread message

Adrià Mercader

unread,
Jul 12, 2016, 12:13:11 PM7/12/16
to CKAN Development Discussions, ckan-global...@googlegroups.com
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 &copy; <a
href="http://www.thunderforest.com">Thunderforest</a>, Data &copy; <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 = &copy <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

stefan.s...@ble.de

unread,
Jul 13, 2016, 8:33:19 AM7/13/16
to CKAN Global User Group, ckan...@lists.okfn.org
Thanks a lot, I've been looking for a solution so I'll try the first option you've proposed.

stefan.s...@ble.de

unread,
Jul 18, 2016, 9:36:06 AM7/18/16
to CKAN Global User Group, ckan...@lists.okfn.org
Hi Adrià

I'm really new to all the map business so maybe you could help me a bit? I've registered at Mapbox so I do have an access token and an account name. But where do I find the map_id? Is it the
Style URL?

Stefan

Am Dienstag, 12. Juli 2016 18:13:11 UTC+2 schrieb Adri? Mercader:

Maurizio Napolitano

unread,
Jul 18, 2016, 2:38:14 PM7/18/16
to ckan-global...@googlegroups.com, CKAN Development Discussions
I like a lot the rendering made by Wikimedia Foundation
https://maps.wikimedia.org

here the tms url
https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png

ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.custom.url =
https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png
ckanext.spatial.common_map.attribution = Maps &copy; <a
rref="http://www.wikimedia.org">Wikimedia Foundation</a>, Data &copy;
<a href="http://www.openstreetmap.org/copyright">OpenStreetMap
contributors</a>

If you are looking for some tms sources I suggest you to check on the
source code of the QuickMapServices QGIS Plugin
https://plugins.qgis.org/plugins/quick_map_services/

In particular the .ini files present in this directory
https://github.com/nextgis/quickmapservices/tree/master/src/data_sources
https://github.com/nextgis/quickmapservices_contrib/tree/master/data_sources

Matthew Fullerton

unread,
Jul 28, 2016, 3:40:34 AM7/28/16
to ckan-global...@googlegroups.com, CKAN Development Discussions
For some views (e.g. KML) the server switching part doesn't work and the thunderforest link needs to be:

e.g. ckanext.spatial.common_map.custom.url = https://tile.thunderforest.com/transport/{z}/{x}/{y}.png

or even better ckanext.spatial.common_map.custom.url = //tile.thunderforest.com/transport/{z}/{x}/{y}.png

(http for http connection and https for https)

-Matt



--
You received this message because you are subscribed to the Google Groups "CKAN Global User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ckan-global-user-...@googlegroups.com.
To post to this group, send an email to ckan-global...@googlegroups.com.
Visit this group at https://groups.google.com/group/ckan-global-user-group.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ckan-global-user-group/CAGJR8iJRn%2BaNE21PGfd1b5tAgDWW-yvLECP%2B3h14Watd2NrX1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Adrià Mercader

unread,
Aug 3, 2016, 9:32:45 AM8/3/16
to ckan-global...@googlegroups.com, CKAN Development Discussions
For an update on problems on the Recline viewer see here:
https://github.com/ckan/ckan/pull/3174#issuecomment-237216080

I've updated the default tiles on the ckanext-spatial and
ckanext-geoview widgets to use the Stamen ones for now, so these
should be fixed if you pull the latest code.

Adrià
> To post to this group, send email to
> ckan-global...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ckan-global-user-group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/ckan-global-user-group/CAAm%2B7Tbs18waAQOutu1PWbBMvqqCWWmSJsFCwSvd06DKjwbBvA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages