From d59278fbf259eef163cb519d803d390769ff4e0a Mon Sep 17 00:00:00 2001 From: Math1985 Date: Tue, 3 Jun 2014 01:47:15 +0100 Subject: [PATCH 1/2] Render names on junctions This renders names of junction=yes and junction=roundabout. Rendering is similar to highway=motorway_junction. --- project.mml | 6 +++--- roads.mss | 49 +++++++++++++++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/project.mml b/project.mml index 390dc62f13..1f28b3fe54 100644 --- a/project.mml +++ b/project.mml @@ -1390,18 +1390,18 @@ ], "Datasource": { "type": "postgis", - "table": " (select way,ref,name\n from planet_osm_point\n where highway='motorway_junction'\n ) as highway_junctions", + "table": " (select way,highway,junction,ref,name\n from planet_osm_point\n where highway='motorway_junction' or NOT junction IS NULL\n ) as junctions", "extent": "-20037508,-20037508,20037508,20037508", "key_field": "", "geometry_field": "way", "dbname": "gis" }, - "id": "highway-junctions", + "id": "junctions", "class": "", "srs-name": "900913", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "advanced": {}, - "name": "highway-junctions" + "name": "junctions" }, { "geometry": "linestring", diff --git a/roads.mss b/roads.mss index 64c3776359..56a2e0212d 100644 --- a/roads.mss +++ b/roads.mss @@ -1730,15 +1730,37 @@ } } -#highway-junctions { - [zoom >= 11] { - ref/text-name: "[ref]"; - ref/text-size: 10; - ref/text-fill: #6666ff; - ref/text-min-distance: 2; - ref/text-face-name: @oblique-fonts; - ref/text-halo-radius: 1.5; - [zoom >= 12] { +#junctions { + [highway = 'motorway_junction'] { + [zoom >= 11] { + ref/text-name: "[ref]"; + ref/text-size: 10; + ref/text-fill: #6666ff; + ref/text-min-distance: 2; + ref/text-face-name: @oblique-fonts; + ref/text-halo-radius: 1.5; + [zoom >= 12] { + name/text-name: "[name]"; + name/text-size: 9; + name/text-fill: #6666ff; + name/text-dy: -9; + name/text-face-name: @oblique-fonts; + name/text-halo-radius: 1; + name/text-wrap-character: ";"; + name/text-wrap-width: 2; + name/text-min-distance: 2; + } + [zoom >= 15] { + ref/text-size: 12; + name/text-size: 11; + name/text-dy: -10; + } + } + } + + [junction = 'yes'], + [junction = 'roundabout'] { + [zoom >= 13] { name/text-name: "[name]"; name/text-size: 9; name/text-fill: #6666ff; @@ -1748,11 +1770,10 @@ name/text-wrap-character: ";"; name/text-wrap-width: 2; name/text-min-distance: 2; - } - [zoom >= 15] { - ref/text-size: 12; - name/text-size: 11; - name/text-dy: -10; + [zoom >= 15] { + name/text-size: 11; + name/text-dy: -10; + } } } } From 9c6b1616f8bb84ec7c8f9cfba937b8ddc05c1328 Mon Sep 17 00:00:00 2001 From: math1985 Date: Sat, 2 Aug 2014 10:11:29 +0100 Subject: [PATCH 2/2] Change junction rendering * Also render name for traffic_signals without junction tag * Don't render junction names on roundabouts * Render junctions in black and in a smaller font * Offset junction names only when the traffic signal icon shows * Start rendering junctions from z14 * Wrap lines --- project.mml | 2 +- roads.mss | 34 +++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/project.mml b/project.mml index 1f28b3fe54..d0d7453f6b 100644 --- a/project.mml +++ b/project.mml @@ -1390,7 +1390,7 @@ ], "Datasource": { "type": "postgis", - "table": " (select way,highway,junction,ref,name\n from planet_osm_point\n where highway='motorway_junction' or NOT junction IS NULL\n ) as junctions", + "table": " (select way,highway,junction,ref,name\n from planet_osm_point\n where highway='motorway_junction' or highway = 'traffic_signals' or junction = 'yes'\n ) as junctions", "extent": "-20037508,-20037508,20037508,20037508", "key_field": "", "geometry_field": "way", diff --git a/roads.mss b/roads.mss index 56a2e0212d..4a9fb281ac 100644 --- a/roads.mss +++ b/roads.mss @@ -1759,20 +1759,28 @@ } [junction = 'yes'], - [junction = 'roundabout'] { - [zoom >= 13] { - name/text-name: "[name]"; - name/text-size: 9; - name/text-fill: #6666ff; - name/text-dy: -9; - name/text-face-name: @oblique-fonts; - name/text-halo-radius: 1; - name/text-wrap-character: ";"; - name/text-wrap-width: 2; - name/text-min-distance: 2; + [highway = 'traffic_signals'] { + [zoom >= 14] { + text-name: "[name]"; + text-size: 8; + text-fill: black; + text-face-name: @book-fonts; + text-halo-radius: 1; + text-wrap-width: 30; + text-min-distance: 2; + [zoom >= 14] { + text-size: 9; + } [zoom >= 15] { - name/text-size: 11; - name/text-dy: -10; + text-size: 10; + } + [zoom >= 17] { + text-size: 11; + /* Offset name on traffic_signals on zoomlevels where they are displayed + in order not to hide the icon */ + [highway = 'traffic_signals'] { + text-dy: 11; + } } } }