forked from systemed/potlatch2
/
test.css
71 lines (47 loc) · 3.27 KB
/
test.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
MapCSS demonstration stylesheet
Richard Fairhurst, October 2009
*/
/* We can reassign tags on the fly - here, we set "highlighted" to "yes" (the default)
if the road name contains the word Brown. */
way[name=~/Brown/] { set .highlighted; }
/* 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=trunk] { z-index: 8; color: green; width: 5; casing-color: black; casing-width: 7; }
way[highway=primary] { z-index: 8; color: red; width: 5; casing-color: black; casing-width: 7; }
way[highway=secondary] { z-index: 7; color: orange; width: 5; casing-width: 7; text: name; text-color: black; font-size: 9; text-position: line; }
way[highway=tertiary],way[highway=unclassified] { z-index: 6; color: yellow; width: 5; casing-width: 7; text: name; text-color: black; font-size: 7; text-position: line; }
way[highway=residential] { color: #DDDDDD; casing-color: gray; width: 5; casing-width: 7; }
way[highway=service] { color: white; width: 3; casing-width: 5; }
way[highway=footway] { color: green; width: 2; dashes: 2, 2; }
way[highway=bridleway] { color: green; width: 2; dashes: 4, 2, 2, 2; }
way[highway=track] { color: green; 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; }
{ 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; }
node :hover { z-index: 2; icon-image: square; icon-width: 10; color: gray; }
node :selected { z-index: 2; icon-image: square; icon-width: 10; color: yellow; }
node :selectedway { z-index: 9; icon-image: square; icon-width: 7; color: red; }
node !:drawn :poi { z-index: 5; icon-image: circle; icon-width: 8; color: green; casing-color: black; }
/* 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; }