Skip to content

Commit

Permalink
Merge pull request cyclosm#311 from Florimondable/conditionnal_access
Browse files Browse the repository at this point in the history
Add conditional text along the way for bicycle|vehicle|access|motor_vehicle:conditional
  • Loading branch information
Phyks committed Feb 23, 2020
2 parents 20b43ac + 9702029 commit 8d29ca9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
30 changes: 30 additions & 0 deletions labels.mss
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,36 @@
}
}


#roads-text-conditional[zoom >= 20] {
text-name: ""; /* Useless since it is voreloaded after, but it rise a warning. */
text-fill: @conditional-text;
text-size: 9;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @road_halo;
text-spacing: 300;
text-clip: false;
text-placement: line;
text-face-name: @sans;
text-vertical-alignment: top;
text-dy: -12;
text-repeat-distance: @minor-highway-text-repeat-distance;

[motor_vehicle_conditional != null] {
text-name: "motor=" + [motor_vehicle_conditional];
text-fill: @conditional-cycle-text;
}
[access_conditional != null] {
text-name: "all=" + [access_conditional];
}
[vehicle_conditional != null] {
text-name: "vehicle=" + [vehicle_conditional];
}
[bicycle_conditional != null] {
text-name: "bicycle=" + [bicycle_conditional];
}
}

#paths-text-name {
[highway = 'track'] {
[zoom >= 16] {
Expand Down
3 changes: 3 additions & 0 deletions palette.mss
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
@ferry-route: #66f;
@ferry-route-text: @ferry-route;

@conditional-text: #ff2701;
@conditional-cycle-text: #0000ff;

/* Also used for other small places: hamlets, suburbs, localities */
@village_text: #444;
@village_halo: @place_halo;
Expand Down
22 changes: 22 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,28 @@ Layer:
) AS data
properties:
minzoom: 15
- id: roads-text-conditional
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
highway,
tags->'motor_vehicle:conditional' AS motor_vehicle_conditional,
tags->'vehicle:conditional' AS vehicle_conditional,
tags->'access:conditional' AS access_conditional,
tags->'bicycle:conditional' AS bicycle_conditional
FROM planet_osm_line
WHERE tags->'motor_vehicle:conditional' IS NOT NULL
OR tags->'vehicle:conditional' IS NOT NULL
OR tags->'access:conditional' IS NOT NULL
OR tags->'bicycle:conditional' IS NOT NULL
) AS data
properties:
minzoom: 20
- id: addresses
geometry: point
<<: *extents
Expand Down

0 comments on commit 8d29ca9

Please sign in to comment.