create a new stylesheet
authorAndy Allan <gravitystorm@gmail.com>
Wed, 18 Nov 2009 22:02:08 +0000 (22:02 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Wed, 18 Nov 2009 22:02:08 +0000 (22:02 +0000)
resources/potlatch.css [new file with mode: 0644]
resources/potlatch2.html

diff --git a/resources/potlatch.css b/resources/potlatch.css
new file mode 100644 (file)
index 0000000..bb84087
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+
+       Stylesheet that mimicks, to a certain extent, potlatch 1.x
+        Andy Allan, November 2009
+
+       Based heavily on:
+       MapCSS demonstration stylesheet
+       Richard Fairhurst, October 2009
+       
+*/
+
+/* This rule applies to all areas (closed ways). Note that rules are applied in the order
+   they appear in the file, so later rules may replace this one for some ways. */
+
+way :area { fill-color: gray; fill-opacity: 0.5; }
+
+/* A set of fairly standard rules.
+   We use z-index to make sure high-priority roads appear above minor ones. */
+
+way[highway=motorway],way[highway=motorway_link],
+way[highway=trunk],way[highway=trunk_link],
+way[highway=primary],way[highway=primary_link],
+way[highway=secondary],way[highway=secondary_link] { text: name; text-color: black; font-size: 7; text-position: line;}
+way[highway=motorway],way[highway=motorway_link]    { z-index: 9; color: #809BC0; width: 7; casing-color: black; casing-width: 8; }
+way[highway=trunk],way[highway=trunk_link]          { z-index: 9; color: #7FC97F; width: 5; casing-color: black; casing-width: 7; }
+way[highway=primary],way[highway=primary_link]      { z-index: 8; color: #E46D71; width: 5; casing-color: black; casing-width: 7; }
+way[highway=secondary],way[highway=secondary_link]  { z-index: 7; color: #FDBF6F; width: 7; casing-width: 8; }
+way[highway=tertiary],way[highway=unclassified]     { z-index: 6; color: #FEFECB; width: 5; casing-width: 7; }
+way[highway=residential]                            { z-index: 5; color: #E8E8E8; width: 5; casing-color: gray; casing-width: 7; }
+way[highway=service]                                { color: white; width: 3; casing-width: 5; }
+
+way[highway=footway]   { color: #FF6644; width: 2; dashes: 6, 3 }
+way[highway=bridleway] { color: #996644; width: 2; dashes: 4, 2, 2, 2; }
+way[highway=track]     { color: #996644; width: 2; dashes: 4, 2; }
+way[highway=path]      { color: lightgreen; width: 2; dashes: 2, 2; }
+
+way[waterway=river], way[waterway=canal] { color: lightblue; width: 2; }
+
+/* Fills can be solid colour or bitmap images */
+
+way[leisure=pitch],way[leisure=park] { fill-image: fills/grass.jpg; }
+
+/* POIs, too, can have bitmap icons - they can even be transparent */
+
+node[amenity=pub] { icon-image: icons/pub.png; text-offset: 7; font-family: DejaVu; text: name; font-size: 9; }
+node[place] { icon-image: icons/place.png; text-offset: 10; font-family: DejaVu; text: name; font-size: 9; font-weight: bold; text-decoration: underline; }
+way node[barrier=gate], way node[highway=gate] { icon-image: icons/gate.png; }
+       
+/* We can stack styles at different z-index (depth) */
+
+way[railway=rail]
+       { z-index: 4; color: black; width: 4; }
+way[railway=rail]
+       { z-index: 5; color: white; width: 3; dashes: 6,6; }
+
+/* Change the road colour based on dynamically set "highlighted" tag (see earlier) */
+
+way .highlighted { color: pink; }
+
+/* Interactive editors may choose different behaviour when a user mouses-over or selects
+   an object. Potlatch 2 supports these but the stand-alone Halcyon viewer does not */
+
+way :hover     { z-index: 2; width: 8; color: gray; }
+way :selected { z-index: 2; width: 8; color: yellow; }
+way !:drawn { z-index: 5; width: 0.5; color: gray; }
+
+/* Descendant selectors provide an easy way to style relations: this example means "any way
+   which is part of a relation whose type=route". */
+
+relation[type=route] way { z-index: 1; width: 17; color: blue; opacity: 0.3; }
+
index 52dc2cf..e31770a 100644 (file)
@@ -27,7 +27,7 @@
         fo.addVariable("oauth_consumer_key", "fiM1IoqnKJk4JCfcl63DA");
         fo.addVariable("oauth_consumer_secret", "7fYgJK9M4vB1CvBZ6jEsPGxYK9UD1hEnI6NqTxNGs");
         fo.addVariable("serverName", "api06 Test On Dev");
-       fo.addVariable("style","test.css");
+       fo.addVariable("style","potlatch.css");
        fo.write("map");