[fusion-commits] r2874 - in sandbox/stamen: layers/Generic lib text widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Fri Sep 5 06:03:19 PDT 2014
Author: jng
Date: 2014-09-05 06:03:18 -0700 (Fri, 05 Sep 2014)
New Revision: 2874
Modified:
sandbox/stamen/layers/Generic/Generic.js
sandbox/stamen/lib/fusion.js
sandbox/stamen/text/en.json
sandbox/stamen/widgets/BasemapSwitcher.js
Log:
Add stamen layer support:
- Add support for a StamenScript element. Authoring tools will be expected to add the following script URL for stamen map layer support:
- http://maps.stamen.com/js/tile.stamen.js?v1.3.0
- Update layers/Generic/Generic.js to recognize and instantiate stamen layer objects
- Add stamen layer support to the BasemapSwitcher widget
Modified: sandbox/stamen/layers/Generic/Generic.js
===================================================================
--- sandbox/stamen/layers/Generic/Generic.js 2014-09-05 12:45:21 UTC (rev 2873)
+++ sandbox/stamen/layers/Generic/Generic.js 2014-09-05 13:03:18 UTC (rev 2874)
@@ -180,6 +180,9 @@
this.mapTag.layerOptions.type = 'Mapnik';
}
break;
+ case 'Stamen':
+ this.oLayerOL = new OpenLayers.Layer[this.layerType](this.mapTag.layerOptions.type);
+ break;
case 'XYZ':
this.oLayerOL = new OpenLayers.Layer[this.layerType](
this.getMapName(),
Modified: sandbox/stamen/lib/fusion.js
===================================================================
--- sandbox/stamen/lib/fusion.js 2014-09-05 12:45:21 UTC (rev 2873)
+++ sandbox/stamen/lib/fusion.js 2014-09-05 13:03:18 UTC (rev 2874)
@@ -1681,11 +1681,13 @@
var yahooElement = appDefXML.getElementsByTagName("YahooScript")[0];
var veElement = appDefXML.getElementsByTagName("VirtualEarthScript")[0];
var osmElement = appDefXML.getElementsByTagName("OpenStreetMapScript")[0];
+ var stamenElement = appDefXML.getElementsByTagName("StamenScript")[0];
addElement(googleElement);
addElement(yahooElement);
addElement(veElement);
addElement(osmElement);
+ addElement(stamenElement);
}
};
Modified: sandbox/stamen/text/en.json
===================================================================
--- sandbox/stamen/text/en.json 2014-09-05 12:45:21 UTC (rev 2873)
+++ sandbox/stamen/text/en.json 2014-09-05 13:03:18 UTC (rev 2874)
@@ -86,6 +86,9 @@
'openStreetMap':'Open Street Map',
'openStreetMapTransportMap':'Open Street Map (TransportMap)',
'openStreetMapCycleMap':'Open Street Map (CycleMap)',
+'stamenToner':'Stamen Toner',
+'stamenTerrain':'Stamen Terrain',
+'stamenWatercolor':'Stamen Watercolor',
'end': '',
'currentPositionOutsideInitialView': 'Your position is outside of the initial view of the map',
'currentPositionOutsideMaxExtent': 'Your position is outside of the maximum extent of the map',
Modified: sandbox/stamen/widgets/BasemapSwitcher.js
===================================================================
--- sandbox/stamen/widgets/BasemapSwitcher.js 2014-09-05 12:45:21 UTC (rev 2873)
+++ sandbox/stamen/widgets/BasemapSwitcher.js 2014-09-05 13:03:18 UTC (rev 2874)
@@ -251,6 +251,41 @@
}
}
break;
+ case 'Stamen':
+ switch (map.mapTag.extension.Options[0].type[0]) {
+ case 'terrain':
+ if (map.mapTag.extension.Options[0].name) {
+ this.options['terrain'] = map.mapTag.extension.Options[0].name[0];
+ }
+ else {
+ this.options['terrain'] = OpenLayers.i18n('stamenTerrain');
+ }
+ this.baseMaps['terrain'] = map;
+ break;
+ case 'watercolor':
+ if (map.mapTag.extension.Options[0].name) {
+ this.options['watercolor'] = map.mapTag.extension.Options[0].name[0];
+ }
+ else {
+ this.options['watercolor'] = OpenLayers.i18n('stamenWatercolor');
+ }
+ this.baseMaps['watercolor'] = map;
+ break;
+ default: //Default to toner tileset
+ if (map.mapTag.extension.Options[0].name) {
+ this.options['toner'] = map.mapTag.extension.Options[0].name[0];
+ }
+ else {
+ this.options['toner'] = OpenLayers.i18n('stamenToner');
+ }
+ this.baseMaps['toner'] = map;
+ break;
+ }
+ // The first non-MapGuide basemap will be the default basemap
+ if (!this.defaultBasemap) {
+ this.defaultBasemap = map.mapTag.extension.Options[0].type[0];
+ }
+ break;
case 'OpenStreetMap':
// if user didn't indicate basemap types, use the default OSM Mapnik render
if (!map.mapTag.extension.Options || !map.mapTag.extension.Options[0].type) {
More information about the fusion-commits
mailing list