Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default tiles for map view, allow customization #502

Merged
merged 2 commits into from Aug 12, 2016

Conversation

amercader
Copy link
Contributor

After the MapQuest debacle, there was a patch merged that replaced the MapQuest tiles with the OpenStreetMap ones (#501). IMO these are not a good default choice because while they might be fine for a small Recline project, heavy usage of them goes against their Terms of Use:

http://wiki.openstreetmap.org/wiki/Tile_usage_policy

More specifically:

Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators

Popular CKAN instances that use Recline are likely to fall in this category.

This patch replaces the tiles with the Terrain tileset from Stamen (http://maps.stamen.com), which has more liberal terms.

But more crucially, as this is something that different people will have different views on, it allows you to configure the tiles used by passing custom options to the view constructor, eg:

view = new recline.View.Map({
    model: dataset,
    mapTilesURL: '//{s}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/{z}/{x}/{y}.png?access_token=pk.XXXX',
    mapTilesAttribution: '© MapBox etc..',
    mapTilesSubdomains: 'ab'
})

So everybody (and apps integrating Recline like CKAN) can configure the tiles as they want.

After the MapQuest debacle, there was a patch merged that replaced the
MapQuest tiles with the OpenStreetMap ones (#501). IMO these are not a
good default choice because while they might be fine for a small Recline
project, heavy usage of them goes against their Terms of Use:

http://wiki.openstreetmap.org/wiki/Tile_usage_policy

More specifically:

> Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org)
> is forbidden without prior permission from the System Administrators

Popular CKAN instances that use Recline are likely to fall in this
category.

And also:

> Highly Recommended: Do not hardcode any URL at tile.openstreetmap.org
> into an app.

This patch replaces the tiles with the Terrain tileset from Stamen
(http://maps.stamen.com), which have more liberal terms.

But more crucially, as this is something that different people will have
different views on, it allows you to configure the tiles used by passing
custom options to the view constructor, eg:

    view = new recline.View.Map({
        model: dataset,
        mapTilesURL: '//{s}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/{z}/{x}/{y}.png?access_token=pk.XXXX',
        mapTilesAttribution: '© MapBox etc..',
        mapTilesSubdomains: 'ab'
    })

So everybody (and apps integrating Recline like CKAN) can configure the tiles
as they want.
@amercader
Copy link
Contributor Author

Any ideas as to why the tests are failing on Travis? I'm not familiar with this suite and they pass for me locally.

@rufuspollock
Copy link
Member

@amercader not sure why tests fail but looks good so happy for you merge if you want.

@amercader
Copy link
Contributor Author

amercader commented Aug 12, 2016

@rgrp fixed the tests, merging

@amercader amercader merged commit 88cbe06 into master Aug 12, 2016
@amercader amercader deleted the new-tiles-custom-options branch August 12, 2016 11:12
amercader added a commit to ckan/ckan that referenced this pull request Aug 12, 2016
@amercader amercader mentioned this pull request Aug 12, 2016
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants