<renderingStyle name="walking" depends="Touring view (contrast and details)" defaultColor="#f1eae4" version="1">

	<!--
		Renderer for walking and walk planning, dependent on Touring View
		(A. Thompson August 2017)

		DESCRIPTION: A "walk" way is anything nicer than a road: i.e. footway, path, bridleway, cycleway, track. This renderer adds new options to the bottom of the "Configure Map" menu under "Other map attributes":
			
			* Hide restricted walks: If set, then walks with the access tag set to "no" or "private" are completely hidden (rather than being shown with a very slightly different line style). This applies even to walks that would otherwise be highlighted.

			* Highlight walks: If set, then as you zoom out walks are highlighted in bold black. Otherwise they become hard to see or an not rendered at all. Tracks remain dashed, other walks are solid.

			* Contour 50/100m markers: When set, 100m contours are twice normal width, and from zoom level 16 50m contours are 1.5 times normal. When unset , this standard behaviour is suppressed and all contours are shown the same width: best for general visualisation of the terrain and when closely-spaced contours are giving a shading effect that highlights steep slopes.

			* Contour width: select from a range of sizes greater than standard.

		INSTALLATION:
			Place this file in the "rendering" subfolder of your "osmand" folder. You could rename it "yourName.render.xml" 
			The next time Osmand is fully restarted (after force stop, or swiped away from the recent apps list), then this renderer will appear among the standard ones in the choices of "Map style" in the "Map rendering" section of the "Configure map" menu. Once selected, the extra menu options listed above will appear.

		KNOWN ISSUES (nothing serious (and not my fault?)):
			- When a new contour width is selected, the new value is not immediately shown in the "Configure map" menu overview, even though it takes effect on the map.
			- For some reason, as you zoom out, at the last level before the renderer loses control to the overview map, access restrictions aren't detected. So if "Hide restricted walks" is on, then walks that are hidden at all closer zoom levels make a brief appearance.

		TESTING:
			To find, for example, something tagged with "access=private" in the OpenStreetMap data, http://overpass-turbo.eu can be used by typing "access=private" (without quotes) into the wizard.
	-->

	<!-- Add new controls to the bottom of the "configure map" menu -->
	<renderingProperty attr="hideRestrictedWalks" name="Hide restricted walks" description="Hide restricted walks" type="boolean" possibleValues="" category=""/>
	<renderingProperty attr="highlightWalks" name="Highlight walks" description="Highlight walks" type="boolean" possibleValues="" category=""/>
	<renderingProperty attr="contourMarkers" name="Contour 50/100m markers" description="Contour 50/100m markers" type="boolean" possibleValues="" category=""/>
	<renderingProperty attr="contourThickness" name="Contour width" description="Contour width" type="string" possibleValues="x2,x3,x4" defaultValueDescription="default" category=""/>

	<!-- Adjust when and how walking ways are highlighted with the following (Android colors use hex format #AARRGGBB): -->
	<renderingConstant name="maxPathZoomLevel" value="13"/>
	<renderingConstant name="maxPathColor" value="#FF000000"/>
	<renderingConstant name="maxPathWidth" value="2"/>

	<!-- The following contour colors are copied from the Touring View renderer -->
	<renderingConstant name="contourLineColor" value="#2Aff7c00"/>
	<renderingConstant name="contourLineColor50m" value="#2Aea7300"/>

	<line>

		<!-- Highlighting of walks other than tracks as solid lines, or possibly hide if access restricted -->
		<switch>
			<case tag="highway" value="footway"/>
			<case tag="highway" value="path"/>
			<case tag="highway" value="bridleway"/>
			<case tag="highway" value="cycleway"/>
			<apply>
				<apply highlightWalks="true" minzoom="1" maxzoom="$maxPathZoomLevel" color="$maxPathColor" color_5="$maxPathColor" strokeWidth="$maxPathWidth" strokeWidth_5="$maxPathWidth"/>
				<apply hideRestrictedWalks="true">
					<apply additional="access=private" disable="true"/>
					<apply additional="access=no" disable="true"/>
				</apply>
			</apply>
		</switch>

		<!-- Highlighting of tracks as dashed lines, or possibly hide if access restricted -->
		<switch>
			<case tag="highway" value="track"/>
			<apply>
				<apply highlightWalks="true" minzoom="1" maxzoom="$maxPathZoomLevel" color_5="$maxPathColor" strokeWidth="$maxPathWidth" strokeWidth_5="$maxPathWidth"/>
				<apply hideRestrictedWalks="true">
					<apply additional="access=private" disable="true"/>
					<apply additional="access=no" disable="true"/>
				</apply>
			</apply>
		</switch>

		<!-- Contour widths and 50/100m marker control. Based on code from the Touring View renderer, where normal contours are width 1, 100m markers are always shown twice that width, and 50m markers come in at minzoom="16" at 1.5 times normal width -->
		<switch>
			<case contourLines="11" tag="contour" value="elevation" minzoom="11"/>
			<case contourLines="12" tag="contour" value="elevation" minzoom="12"/>
			<case contourLines="13" tag="contour" value="elevation" minzoom="13"/>
			<case contourLines="14" tag="contour" value="elevation" minzoom="14"/>
			<case contourLines="15" tag="contour" value="elevation" minzoom="15"/>
			<case contourLines="16" tag="contour" value="elevation" minzoom="16"/>
			<apply color="$contourLineColor" strokeWidth="1">
				<apply contourMarkers="true">
					<case additional="contourtype=50m" minzoom="16" color="$contourLineColor50m" strokeWidth="1.5"/>
					<case additional="contourtype=100m" color="$contourLineColor50m" strokeWidth="2"/>
				</apply>
				<apply contourThickness="x2" strokeWidth="2">
					<apply contourMarkers="true">
						<case additional="contourtype=50m" minzoom="16" color="$contourLineColor50m" strokeWidth="3"/>
						<case additional="contourtype=100m" color="$contourLineColor50m" strokeWidth="4"/>
					</apply>
				</apply>
				<apply contourThickness="x3" strokeWidth="3">
					<apply contourMarkers="true">
						<case additional="contourtype=50m" minzoom="16" color="$contourLineColor50m" strokeWidth="4.5"/>
						<case additional="contourtype=100m" color="$contourLineColor50m" strokeWidth="6"/>
					</apply>
				</apply>
				<apply contourThickness="x4" strokeWidth="4">
					<apply contourMarkers="true">
						<case additional="contourtype=50m" minzoom="16" color="$contourLineColor50m" strokeWidth="6"/>
						<case additional="contourtype=100m" color="$contourLineColor50m" strokeWidth="8"/>
					</apply>
				</apply>
			</apply>
		</switch>

	</line>

</renderingStyle>
