Created
August 10, 2016 20:40
-
-
Save BerryDaniel/90e1d27fdc763b34ca942f6658a945ac to your computer and use it in GitHub Desktop.
Example GeoNode local_settings.py file with STAMEN Basemaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from geonode import LOCAL_GEOSERVER | |
STAMEN_ATTR = ('Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a' | |
' href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</' | |
'a> — Map data © <a href="http://www.openstreetmap.o' | |
'rg/copyright">OpenStreetMap</a>') | |
MAP_BASELAYERS = [{ | |
"source": {"ptype": "gxp_olsource"}, | |
"type": "OpenLayers.Layer", | |
"args": ["No background"], | |
"visibility": False, | |
"fixed": True, | |
"group":"background" | |
}, { | |
"source": {"ptype": "gxp_osmsource"}, | |
"type": "OpenLayers.Layer.OSM", | |
"name": "mapnik", | |
"visibility": True, | |
"fixed": True, | |
"group": "background" | |
}, { | |
"source": {"ptype": "gxp_olsource"}, | |
"type": "OpenLayers.Layer.XYZ", | |
"args": [ | |
'Stamen Toner', | |
'http://stamen-tiles-a.a.ssl.fastly.net/toner/${z}/${x}/${y}.png', | |
{ | |
'transitionEffect': 'resize', | |
'attribution': '%s' % STAMEN_ATTR, | |
} | |
], | |
"visibility": False, | |
"fixed": True, | |
"group": "background" | |
}, { | |
"source": {"ptype": "gxp_olsource"}, | |
"type": "OpenLayers.Layer.XYZ", | |
"args": [ | |
'Stamen Toner Lite', | |
'http://stamen-tiles-a.a.ssl.fastly.net/toner-lite/${z}/${x}/${y}.png', | |
{ | |
'transitionEffect': 'resize', | |
'attribution': '%s' % STAMEN_ATTR, | |
} | |
], | |
"visibility": False, | |
"fixed": True, | |
"group": "background" | |
}, { | |
"source": {"ptype": "gxp_olsource"}, | |
"type": "OpenLayers.Layer.XYZ", | |
"args": [ | |
'Stamen Watercolor', | |
'http://stamen-tiles-a.a.ssl.fastly.net/watercolor/${z}/${x}/${y}.png', | |
{ | |
'transitionEffect': 'resize', | |
'attribution': '%s' % STAMEN_ATTR, | |
} | |
], | |
"visibility": False, | |
"fixed": True, | |
"group": "background" | |
}] | |
baselayers = MAP_BASELAYERS | |
MAP_BASELAYERS = [LOCAL_GEOSERVER] | |
MAP_BASELAYERS.extend(baselayers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pasted the above at the end of my local settings file (/etc/geonode/local_settings.py), and geonode crashed. I am running 2.4.