road colors as seperate Rendering sytles

This commit is contained in:
sonora 2012-10-07 09:48:26 +02:00
parent 23689486a0
commit 533e43b5ee
8 changed files with 224 additions and 153 deletions

View file

@ -12,8 +12,8 @@
<!-- Types : string, int, boolean; possibleValues comma separated possible values for int/string --> <!-- Types : string, int, boolean; possibleValues comma separated possible values for int/string -->
<renderingProperty attr="hmRendered" name="Show more map detail" description="Increase amount of map detail shown" <renderingProperty attr="hmRendered" name="Show more map detail" description="Increase amount of map detail shown"
type="boolean" possibleValues=""/> type="boolean" possibleValues=""/>
<renderingProperty attr="roadColors" name="Road color scheme" description="Select road color scheme for specific purpose" <!-- renderingProperty attr="roadColors" name="Road color scheme" description="Select road color scheme for specific purpose"
type="string" possibleValues="Modified Mapnik,Road atlas style,High contrast roads,Experimental"/> type="string" possibleValues="Modified Mapnik,Road atlas style,High contrast roads,Experimental"/ -->
<renderingProperty attr="contourLines" name="Show contour lines" description="Select minimum zoom level to display in map if available. Separate SRTM-file may be needed." <renderingProperty attr="contourLines" name="Show contour lines" description="Select minimum zoom level to display in map if available. Separate SRTM-file may be needed."
type="string" possibleValues="--,13,12,11"/> type="string" possibleValues="--,13,12,11"/>
<renderingProperty attr="appMode" name="Rendering mode" description="Map optimization for respective User Profile" <renderingProperty attr="appMode" name="Rendering mode" description="Map optimization for respective User Profile"
@ -37,7 +37,7 @@
</renderingAttribute> </renderingAttribute>
<renderingAttribute name="routeColor"> <renderingAttribute name="routeColor">
<filter roadColors="Road atlas style" attrColorValue="#CCFF6600"/> <!-- filter roadColors="Road atlas style" attrColorValue="#CCFF6600"/ -->
<filter nightMode="false" attrColorValue="#960000FF"/> <filter nightMode="false" attrColorValue="#960000FF"/>
<filter attrColorValue="#CCFF6600"/> <filter attrColorValue="#CCFF6600"/>
</renderingAttribute> </renderingAttribute>
@ -48,36 +48,37 @@
<filter attrColorValue="#B400FFFF"/> <filter attrColorValue="#B400FFFF"/>
</renderingAttribute> </renderingAttribute>
<!-- Bug in filter - the last will be used by default --> <!-- filter does not work for renderingConstant - the last one will be used, but better use separate depends Rendering style -->
<!-- group roadColors="Modified Mapnik" --> <!-- roadColors="Modified Mapnik" -->
<group>
<renderingConstant name="motorwayRoadColor" value="#809bff"/> <renderingConstant name="motorwayRoadColor" value="#809bff"/>
<renderingConstant name="trunkRoadColor" value="#FF8095"/> <renderingConstant name="trunkRoadColor" value="#FF8095"/>
<renderingConstant name="primaryRoadColor" value="#FFAA80"/> <renderingConstant name="primaryRoadColor" value="#FFAA80"/>
<renderingConstant name="secondaryRoadColor" value="#ffd080"/> <renderingConstant name="secondaryRoadColor" value="#ffd080"/>
<renderingConstant name="tertiaryRoadColor" value="#ffff80"/> <renderingConstant name="tertiaryRoadColor" value="#ffff80"/>
</group> <!-- roadColors="Road atlas style" -->
<!-- group roadColors="Road atlas style"> <!--
<renderingConstant name="motorwayRoadColor" value="#809bff"/> <renderingConstant name="motorwayRoadColor" value="#809bff"/>
<renderingConstant name="trunkRoadColor" value="#ed154b"/> <renderingConstant name="trunkRoadColor" value="#ed154b"/>
<renderingConstant name="primaryRoadColor" value="#ff80a0"/> <renderingConstant name="primaryRoadColor" value="#ff80a0"/>
<renderingConstant name="secondaryRoadColor" value="#ffd080"/> <renderingConstant name="secondaryRoadColor" value="#ffd080"/>
<renderingConstant name="tertiaryRoadColor" value="#ffff80"/> <renderingConstant name="tertiaryRoadColor" value="#ffff80"/>
</group --> -->
<!-- group roadColors="High contrast roads"> <!-- roadColors="High contrast roads" -->
<!--
<renderingConstant name="motorwayRoadColor" value="#3838B0"/> <renderingConstant name="motorwayRoadColor" value="#3838B0"/>
<renderingConstant name="trunkRoadColor" value="#A01060"/> <renderingConstant name="trunkRoadColor" value="#A01060"/>
<renderingConstant name="primaryRoadColor" value="#C00828"/> <renderingConstant name="primaryRoadColor" value="#C00828"/>
<renderingConstant name="secondaryRoadColor" value="#FF8000"/> <renderingConstant name="secondaryRoadColor" value="#FF8000"/>
<renderingConstant name="tertiaryRoadColor" value="#F0C810"/> <renderingConstant name="tertiaryRoadColor" value="#F0C810"/>
</group --> -->
<!-- group roadColors="Experimental"> <!-- roadColors="Experimental" -->
<!--
<renderingConstant name="motorwayRoadColor" value="#6666CC"/> <renderingConstant name="motorwayRoadColor" value="#6666CC"/>
<renderingConstant name="trunkRoadColor" value="#A02067"/> <renderingConstant name="trunkRoadColor" value="#A02067"/>
<renderingConstant name="primaryRoadColor" value="#C04D61"/> <renderingConstant name="primaryRoadColor" value="#C04D61"/>
<renderingConstant name="secondaryRoadColor" value="#F7D131"/> <renderingConstant name="secondaryRoadColor" value="#F7D131"/>
<renderingConstant name="tertiaryRoadColor" value="#F0CE30"/> <renderingConstant name="tertiaryRoadColor" value="#F0CE30"/>
</group --> -->
<!-- <!--
All-Purpose Renderer (with attr="hmRendered" name="Show more map detail") (by Hardy Mueller), v023: All-Purpose Renderer (with attr="hmRendered" name="Show more map detail") (by Hardy Mueller), v023:

View file

@ -0,0 +1,28 @@
<renderingStyle name="depends-template" depends="default" defaultColor="#f1eae4" version="1">
<!-- In a dependent renderer, just specify what should change vs. the master/default renderer -->
<!-- Example: modify route and gpx overlay colors -->
<renderingAttribute name="routeColor" attrColorValue="#CCFF6600"/>
<renderingAttribute name="gpxColor" attrColorValue="#B400FFFF"/>
<order>
</order>
<text>
</text>
<point>
</point>
<polygon>
</polygon>
<line>
</line>
</renderingStyle>

View file

@ -1,14 +1,21 @@
<renderingStyle name="high-contrast-roads-2" depends="default" defaultColor="#F5FFFF" version="1"> <renderingStyle name="high-contrast-roads" depends="default" defaultColor="#f1eae4" version="1">
<!-- <!--
Depends on All-Purpose Renderer (by Hardy Mueller), based on production version 2012-01-04 Depends on All-Purpose Renderer (by Hardy Mueller), based on production version 2012-01-04
--> -->
<!-- <!--
Try high contrast roads, suggested by Dirk Sommer: primary = #C00828, seconfary = #FF8000, tertiary = #F0C810 Try high contrast roads, suggested by Dirk Sommer: primary = #C00828, secondary = #FF8000, tertiary = #F0C810
2012-08-27 Simplify to facilitate color customization 2012-10-07 Simplify using Constants
--> -->
<!-- roadColors="High contrast roads" -->
<renderingConstant name="motorwayRoadColor" value="#3838B0"/>
<renderingConstant name="trunkRoadColor" value="#A01060"/>
<renderingConstant name="primaryRoadColor" value="#C00828"/>
<renderingConstant name="secondaryRoadColor" value="#FF8000"/>
<renderingConstant name="tertiaryRoadColor" value="#F0C810"/>
<order> <order>
</order> </order>
@ -27,101 +34,6 @@
<line> <line>
<group>
<filter tag="highway" value="motorway" maxzoom="13" color="#3838B0"/>
<filter tag="highway" value="motorway_link" maxzoom="13" color="#3838B0"/>
<filter tag="highway" value="trunk" maxzoom="13" color="#A01060"/>
<filter tag="highway" value="trunk_link" maxzoom="13" color="#A01060"/>
<groupFilter cap="ROUND">
<filter minzoom="5" maxzoom="9" strokeWidth="5"/>
<filter minzoom="10" maxzoom="10" strokeWidth="6"/>
<filter minzoom="11" maxzoom="11" strokeWidth="7"/>
<filter minzoom="12" maxzoom="12" strokeWidth="8"/>
<filter minzoom="13" maxzoom="13" strokeWidth="9"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="primary" maxzoom="13"/>
<filter tag="highway" value="primary_link" maxzoom="13"/>
<groupFilter color="#C00828" cap="ROUND">
<filter minzoom="7" maxzoom="9" strokeWidth="4"/>
<filter minzoom="10" maxzoom="10" strokeWidth="5"/>
<filter minzoom="11" maxzoom="11" strokeWidth="6"/>
<filter minzoom="12" maxzoom="12" strokeWidth="7"/>
<filter minzoom="13" maxzoom="13" strokeWidth="8"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="secondary" maxzoom="13"/>
<filter tag="highway" value="secondary_link" maxzoom="13"/>
<groupFilter color="#FF8000" shadowRadius="1" cap="ROUND">
<filter minzoom="9" maxzoom="9" strokeWidth="3"/>
<filter minzoom="10" maxzoom="10" strokeWidth="4"/>
<filter minzoom="11" maxzoom="11" strokeWidth="5"/>
<filter minzoom="12" maxzoom="12" strokeWidth="6"/>
<filter minzoom="13" maxzoom="13" strokeWidth="7"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="motorway" color="#3838B0"/>
<filter tag="highway" value="motorway_link" color="#3838B0"/>
<filter tag="highway" value="trunk" color="#A01060"/>
<filter tag="highway" value="trunk_link" color="#A01060"/>
<filter tag="highway" value="primary" color="#C00828"/>
<filter tag="highway" value="primary_link" color="#C00828"/>
<filter tag="highway" value="secondary" color="#FF8000"/>
<filter tag="highway" value="secondary_link" color="#FF8000"/>
<groupFilter shadowRadius="1" cap="ROUND">
<filter>
<filter minzoom="14" maxzoom="14" strokeWidth="10"/>
<filter minzoom="15" maxzoom="15" strokeWidth="12"/>
<filter minzoom="16" maxzoom="16" strokeWidth="15"/>
<filter minzoom="17" maxzoom="17" strokeWidth="19"/>
<filter minzoom="18" strokeWidth="24"/>
</filter>
<groupFilter layer="-1" pathEffect="4_4" cap="BUTT"/>
<!-- Bridges -->
<groupFilter layer="1" color_0="#000000" shadowRadius="0" cap_0="BUTT" cap="SQUARE">
<filter minzoom="14" maxzoom="14" strokeWidth_0="12"/>
<filter minzoom="15" maxzoom="15" strokeWidth_0="14"/>
<filter minzoom="16" maxzoom="16" strokeWidth_0="17"/>
<filter minzoom="17" maxzoom="17" strokeWidth_0="21"/>
<filter minzoom="18" strokeWidth_0="26"/>
<groupFilter nightMode="true" color_0="#ffffff"/>
</groupFilter>
</groupFilter>
</group>
<group>
<filter tag="highway" value="tertiary"/>
<filter tag="highway" value="tertiary_link"/>
<groupFilter color="#F0C810" shadowRadius="1" cap="ROUND">
<filter minzoom="10" maxzoom="10" strokeWidth="3"/>
<filter minzoom="11" maxzoom="11" strokeWidth="4"/>
<filter minzoom="12" maxzoom="12" strokeWidth="5"/>
<filter minzoom="13" maxzoom="13" strokeWidth="6"/>
<filter color_0="#000000">
<filter minzoom="14" maxzoom="14" strokeWidth="6"/>
<filter minzoom="15" maxzoom="15" strokeWidth="8"/>
<filter minzoom="16" maxzoom="16" strokeWidth="10"/>
<filter minzoom="17" maxzoom="17" strokeWidth="13"/>
<filter minzoom="18" strokeWidth="18"/>
<groupFilter layer="-1" pathEffect="4_4" cap="BUTT"/>
<groupFilter nightMode="true" color_0="#ffffff"/>
<!-- Bridges -->
<groupFilter layer="1" shadowRadius="0" cap_0="BUTT" cap="SQUARE">
<filter minzoom="14" maxzoom="14" strokeWidth_0="8"/>
<filter minzoom="15" maxzoom="15" strokeWidth_0="10"/>
<filter minzoom="16" maxzoom="16" strokeWidth_0="12"/>
<filter minzoom="17" maxzoom="17" strokeWidth_0="15"/>
<filter minzoom="18" strokeWidth_0="20"/>
</groupFilter>
</filter>
</groupFilter>
</group>
</line> </line>
</renderingStyle> </renderingStyle>

View file

@ -0,0 +1,127 @@
<renderingStyle name="high-contrast-roads-2" depends="default" defaultColor="#F5FFFF" version="1">
<!--
Depends on All-Purpose Renderer (by Hardy Mueller), based on production version 2012-01-04
-->
<!--
Try high contrast roads, suggested by Dirk Sommer: primary = #C00828, seconfary = #FF8000, tertiary = #F0C810
2012-08-27 Simplify to facilitate color customization
-->
<order>
</order>
<text>
</text>
<point>
</point>
<polygon>
</polygon>
<line>
<group>
<filter tag="highway" value="motorway" maxzoom="13" color="#3838B0"/>
<filter tag="highway" value="motorway_link" maxzoom="13" color="#3838B0"/>
<filter tag="highway" value="trunk" maxzoom="13" color="#A01060"/>
<filter tag="highway" value="trunk_link" maxzoom="13" color="#A01060"/>
<groupFilter cap="ROUND">
<filter minzoom="5" maxzoom="9" strokeWidth="5"/>
<filter minzoom="10" maxzoom="10" strokeWidth="6"/>
<filter minzoom="11" maxzoom="11" strokeWidth="7"/>
<filter minzoom="12" maxzoom="12" strokeWidth="8"/>
<filter minzoom="13" maxzoom="13" strokeWidth="9"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="primary" maxzoom="13"/>
<filter tag="highway" value="primary_link" maxzoom="13"/>
<groupFilter color="#C00828" cap="ROUND">
<filter minzoom="7" maxzoom="9" strokeWidth="4"/>
<filter minzoom="10" maxzoom="10" strokeWidth="5"/>
<filter minzoom="11" maxzoom="11" strokeWidth="6"/>
<filter minzoom="12" maxzoom="12" strokeWidth="7"/>
<filter minzoom="13" maxzoom="13" strokeWidth="8"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="secondary" maxzoom="13"/>
<filter tag="highway" value="secondary_link" maxzoom="13"/>
<groupFilter color="#FF8000" shadowRadius="1" cap="ROUND">
<filter minzoom="9" maxzoom="9" strokeWidth="3"/>
<filter minzoom="10" maxzoom="10" strokeWidth="4"/>
<filter minzoom="11" maxzoom="11" strokeWidth="5"/>
<filter minzoom="12" maxzoom="12" strokeWidth="6"/>
<filter minzoom="13" maxzoom="13" strokeWidth="7"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="motorway" color="#3838B0"/>
<filter tag="highway" value="motorway_link" color="#3838B0"/>
<filter tag="highway" value="trunk" color="#A01060"/>
<filter tag="highway" value="trunk_link" color="#A01060"/>
<filter tag="highway" value="primary" color="#C00828"/>
<filter tag="highway" value="primary_link" color="#C00828"/>
<filter tag="highway" value="secondary" color="#FF8000"/>
<filter tag="highway" value="secondary_link" color="#FF8000"/>
<groupFilter shadowRadius="1" cap="ROUND">
<filter>
<filter minzoom="14" maxzoom="14" strokeWidth="10"/>
<filter minzoom="15" maxzoom="15" strokeWidth="12"/>
<filter minzoom="16" maxzoom="16" strokeWidth="15"/>
<filter minzoom="17" maxzoom="17" strokeWidth="19"/>
<filter minzoom="18" strokeWidth="24"/>
</filter>
<groupFilter layer="-1" pathEffect="4_4" cap="BUTT"/>
<!-- Bridges -->
<groupFilter layer="1" color_0="#000000" shadowRadius="0" cap_0="BUTT" cap="SQUARE">
<filter minzoom="14" maxzoom="14" strokeWidth_0="12"/>
<filter minzoom="15" maxzoom="15" strokeWidth_0="14"/>
<filter minzoom="16" maxzoom="16" strokeWidth_0="17"/>
<filter minzoom="17" maxzoom="17" strokeWidth_0="21"/>
<filter minzoom="18" strokeWidth_0="26"/>
<groupFilter nightMode="true" color_0="#ffffff"/>
</groupFilter>
</groupFilter>
</group>
<group>
<filter tag="highway" value="tertiary"/>
<filter tag="highway" value="tertiary_link"/>
<groupFilter color="#F0C810" shadowRadius="1" cap="ROUND">
<filter minzoom="10" maxzoom="10" strokeWidth="3"/>
<filter minzoom="11" maxzoom="11" strokeWidth="4"/>
<filter minzoom="12" maxzoom="12" strokeWidth="5"/>
<filter minzoom="13" maxzoom="13" strokeWidth="6"/>
<filter color_0="#000000">
<filter minzoom="14" maxzoom="14" strokeWidth="6"/>
<filter minzoom="15" maxzoom="15" strokeWidth="8"/>
<filter minzoom="16" maxzoom="16" strokeWidth="10"/>
<filter minzoom="17" maxzoom="17" strokeWidth="13"/>
<filter minzoom="18" strokeWidth="18"/>
<groupFilter layer="-1" pathEffect="4_4" cap="BUTT"/>
<groupFilter nightMode="true" color_0="#ffffff"/>
<!-- Bridges -->
<groupFilter layer="1" shadowRadius="0" cap_0="BUTT" cap="SQUARE">
<filter minzoom="14" maxzoom="14" strokeWidth_0="8"/>
<filter minzoom="15" maxzoom="15" strokeWidth_0="10"/>
<filter minzoom="16" maxzoom="16" strokeWidth_0="12"/>
<filter minzoom="17" maxzoom="17" strokeWidth_0="15"/>
<filter minzoom="18" strokeWidth_0="20"/>
</groupFilter>
</filter>
</groupFilter>
</group>
</line>
</renderingStyle>

View file

@ -0,0 +1,39 @@
<renderingStyle name="road-atlas-style" depends="default" defaultColor="#f1eae4" version="1">
<!--
Part of former All-Purpose Renderer (by Hardy Mueller), based on production version 2012-01-04
- roadColors="Road atlas style" scheme aligned with conventional road atlas, Saturation=50, Brightness=100, except trunk is considered special case of primary (same hue)
-->
<!-- roadColors="Road atlas style" -->
<renderingConstant name="motorwayRoadColor" value="#809bff"/>
<renderingConstant name="trunkRoadColor" value="#ed154b"/>
<renderingConstant name="primaryRoadColor" value="#ff80a0"/>
<renderingConstant name="secondaryRoadColor" value="#ffd080"/>
<renderingConstant name="tertiaryRoadColor" value="#ffff80"/>
<renderingAttribute name="routeColor" attrColorValue="#CCFF6600"/>
<renderingAttribute name="gpxColor" attrColorValue="#B400FFFF"/>
<order>
</order>
<text>
</text>
<point>
</point>
<polygon>
</polygon>
<line>
</line>
</renderingStyle>

View file

@ -1,32 +0,0 @@
<renderingStyle name="test-depends" depends="default" defaultColor="#f1eae4" version="1">
<!-- In a dependent renderer, just specify what should change vs. the master/default renderer -->
<!-- Example: always use 'Road atlas style' road colors -->
<renderingConstant name="motorwayRoadColor" value="#809bff"/>
<renderingConstant name="trunkRoadColor" value="#ed154b"/>
<renderingConstant name="primaryRoadColor" value="#ff80a0"/>
<renderingConstant name="secondaryRoadColor" value="#ffd080"/>
<renderingConstant name="tertiaryRoadColor" value="#ffff80"/>
<order>
</order>
<text>
</text>
<point>
</point>
<polygon>
</polygon>
<line>
</line>
</renderingStyle>

View file

@ -1,4 +1,4 @@
<renderingStyle name="winter" depends="default" defaultColor="#F5FFFF" version="1"> <renderingStyle name="winter+ski" depends="default" defaultColor="#F5FFFF" version="1">
<!-- <!--
Depends on All-Purpose Renderer (by Hardy Mueller), v023 Depends on All-Purpose Renderer (by Hardy Mueller), v023
@ -18,10 +18,8 @@
</renderingAttribute> </renderingAttribute>
<!-- input exact layer, orderType check tag, value -->
<!-- point = 1, line = 2, polygon = 3 -->
<order> <order>
<!-- Winter: Layers --> <!-- Winter layers -->
<group objectType="2"> <group objectType="2">
<filter tag="oa_nordic" value="" order="57" shadowLevel="1"/> <filter tag="oa_nordic" value="" order="57" shadowLevel="1"/>
<filter tag="oa_downhill" value="" order="57" shadowLevel="1"/> <filter tag="oa_downhill" value="" order="57" shadowLevel="1"/>
@ -31,9 +29,8 @@
</order> </order>
<!-- PRIORITY Input to filter : tag, value, zoom [minzoom, maxzoom], textLength, ref, textOrder (default=100) -->
<text> <text>
<!--Winter--> <!--Winter text-->
<group> <group>
<filter tag="oa_nordic" value="" textOrder="8"/> <filter tag="oa_nordic" value="" textOrder="8"/>
<filter tag="oa_downhill" value="" textOrder="8"/> <filter tag="oa_downhill" value="" textOrder="8"/>
@ -50,12 +47,10 @@
</text> </text>
<!-- PRIORITY Input to filter : tag, value, zoom [minzoom, maxzoom] -->
<point> <point>
</point> </point>
<!-- PRIORITY Input to filter : tag, value, zoom [minzoom, maxzoom] -->
<polygon> <polygon>
<!--Winter landscape--> <!--Winter landscape-->
<filter minzoom="10" color="#F5FFFF" tag="natural" value="land"/> <filter minzoom="10" color="#F5FFFF" tag="natural" value="land"/>

View file

@ -34,8 +34,9 @@ public class RendererRegistry {
public RendererRegistry(){ public RendererRegistry(){
internalRenderers.put(DEFAULT_RENDER, "default.render.xml"); internalRenderers.put(DEFAULT_RENDER, "default.render.xml");
internalRenderers.put("winter+ski", "winter+ski.render.xml"); internalRenderers.put("road-atlas-style", "road-atlas-style.render.xml");
internalRenderers.put("high-contrast-roads", "high-contrast-roads.render.xml"); internalRenderers.put("high-contrast-roads", "high-contrast-roads.render.xml");
internalRenderers.put("winter+ski", "winter+ski.render.xml");
} }
public RenderingRulesStorage defaultRender() { public RenderingRulesStorage defaultRender() {