Skip to content

Commit 3f627a4

Browse files
committed
Add state boundary layer to map style
1 parent 5c6a969 commit 3f627a4

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

src/MapStyle.vala

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class Notejot.MapStyle : Notejot.JsonObject {
8989
};
9090
layers.add (park);
9191

92-
// Administrative boundaries
92+
// Country boundaries
9393
var admin_filter = new Notejot.Expression ("all");
9494
admin_filter.append_string_int ("<=", "admin_level", 2);
9595

@@ -114,6 +114,31 @@ public class Notejot.MapStyle : Notejot.JsonObject {
114114
admin_line.paint.line_dasharray = admin_dash;
115115
layers.add (admin_line);
116116

117+
// State boundaries
118+
var state_filter = new Notejot.Expression ("all");
119+
state_filter.append_string_int ("==", "admin_level", 4);
120+
121+
var state_line = new Layer () {
122+
id = "admin_state",
123+
kind = "line",
124+
source = "vector-tiles",
125+
source_layer = "boundary",
126+
filter = state_filter,
127+
paint = new Layer.Paint () {
128+
line_color = BORDER_COLOR,
129+
line_opacity = 0.4
130+
},
131+
layout = new Layer.Layout () {
132+
line_cap = "round",
133+
line_join = "round"
134+
}
135+
};
136+
var state_dash = new Json.Array ();
137+
state_dash.add_double_element (1);
138+
state_dash.add_double_element (1);
139+
state_line.paint.line_dasharray = state_dash;
140+
layers.add (state_line);
141+
117142
// Major roads
118143
var major_road_filter = new Notejot.Expression ("all");
119144
major_road_filter.append_string_string ("in", "class", "motorway");

0 commit comments

Comments
 (0)