Permalink
Browse files

Monkeyed with label CSS for water bodies and green areas

  • Loading branch information...
1 parent 84d9608 commit f6327e148d53f2eeeae41404d8f6f7854b498109 Michal Migurski committed Jun 19, 2012
Showing with 1,141 additions and 335 deletions.
  1. +9 −8 mapnik/datasources.ini
  2. +100 −94 mapnik/labels.mss
  3. +364 −83 mapnik/style-toner-standard.xml
  4. +334 −75 mapnik/toner-hybrid-only-labels.xml
  5. +334 −75 mapnik/toner-hybrid-with-labels.xml
View
@@ -29,6 +29,7 @@ user = nev
[postgis_toner_merc]
dbname = toner
estimate_extent = false
+extent = -20037508,-20037508,20037508,20037508
host = localhost
layer_srs = %(srs3)s
password = None
@@ -112,11 +113,11 @@ table = airports_simple_0d29_less_merc
[buildings]
template = postgis_toner_merc
-table = osm_buildings
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_buildings) AS areas
[buildings_z13]
template = postgis_toner_merc
-table = osm_buildings_z13
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_buildings_z13) AS areas
@@ -158,15 +159,15 @@ table = admin_0_countries_50m
[green_areas]
template = postgis_toner_merc
-table = osm_green_areas
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_green_areas) AS areas
[green_areas_z13]
template = postgis_toner_merc
-table = osm_green_areas_z13
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_green_areas_z13) AS areas
[green_areas_z10]
template = postgis_toner_merc
-table = osm_green_areas_z10
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_green_areas_z10) AS areas
[lakes_10m__shore]
template = postgis_ne11_merc
@@ -328,15 +329,15 @@ table = (SELECT way,
[water_areas]
template = postgis_toner_merc
-table = osm_water_areas
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_water_areas) AS areas
[water_areas_z13]
template = postgis_toner_merc
-table = osm_water_areas_z13
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_water_areas_z13) AS areas
[water_areas_z10]
template = postgis_toner_merc
-table = osm_water_areas_z10
+table = (SELECT osm_id, name, type, geometry, ST_Area(geometry) AS area FROM osm_water_areas_z10) AS areas
[z10_roads]
template = postgis_planet_osm
View
@@ -344,103 +344,109 @@ Note: make sure that layer is 'on' in the MML
Park labels
*/
-#water-bodies-labels-low[zoom=9][area>100000000][type=reservoir] name,
-#water-bodies-labels-low[zoom=10][area>100000000][type=reservoir] name,
-#water-bodies-labels-med[zoom=11][area>25000000] name
+#water-bodies-labels-low[zoom=9][area>100000000][type=reservoir],
+#water-bodies-labels-low[zoom=10][area>100000000][type=reservoir],
+#water-bodies-labels-med[zoom=11][area>25000000],
+#water-bodies-labels-med[zoom=12][area>5000000][type=reservoir],
+#green-areas-labels-med[zoom=12][area>5000000],
+#water-bodies-labels-med[zoom=13][area>2000000][type=reservoir],
+#green-areas-labels-med[zoom=13][area>2000000],
+#water-bodies-labels-high[zoom=14][area>200000],
+#green-areas-labels-high[zoom=14][area>200000],
+#water-bodies-labels-high[zoom=15][area>50000],
+#green-areas-labels-high[zoom=15][area>50000],
+#water-bodies-labels-high[zoom=16][area>10000],
+#water-bodies-labels-high[zoom>=17],
+#green-areas-labels-high[zoom=16][area>10000],
+#green-areas-labels-high[zoom>=17]
{
- text-face-name: 'Arial Unicode MS Italic';
- text-size: 12;
- text-placement: point;
- text-max-char-angle-delta: 30;
- text-halo-radius: 2;
- text-spacing: 200;
- text-allow-overlap: false;
- text-wrap-width: 50;
-}
-
-
-#water-bodies-labels-med[zoom=12][area>5000000][type=reservoir] name,
-#green-areas-labels-med[zoom=12][area>5000000] name
-{
- text-face-name: 'Arial Unicode MS Italic';
- text-size: 12;
- text-placement: point;
- text-max-char-angle-delta: 30;
- text-halo-radius: 2;
- text-spacing: 200;
- text-allow-overlap: false;
- text-wrap-width: 70;
-}
-
-
-#water-bodies-labels-med[zoom=13][area>2000000][type=reservoir] name,
-#green-areas-labels-med[zoom=13][area>2000000] name
-{
- text-face-name: 'Arial Unicode MS Italic';
- text-size: 12;
- text-placement: point;
- text-max-char-angle-delta: 30;
- text-halo-radius: 2;
- text-spacing: 100;
- text-allow-overlap: false;
- text-wrap-width: 70;
-}
-#water-bodies-labels-high[zoom=14][area>200000] name,
-#green-areas-labels-high[zoom=14][area>200000] name
-{
- text-face-name: 'Arial Unicode MS Italic';
- text-size: 12;
- text-placement: point;
- text-max-char-angle-delta: 30;
- text-halo-radius: 2;
- text-spacing: 100;
- text-allow-overlap: false;
- text-wrap-width: 70;
-}
-#water-bodies-labels-high[zoom=15][area>50000] name,
-#green-areas-labels-high[zoom=15][area>50000] name
+ /* note: no colors defined here */
+
+ name
+ {
+ text-face-name: 'Arial Unicode MS Italic';
+ text-placement: point;
+ text-max-char-angle-delta: 30;
+ text-wrap-width: 40;
+ text-halo-radius: 2;
+ text-allow-overlap: false;
+ }
+
+ &[zoom>=9][zoom<12] name
+ {
+ text-size: 12;
+ text-spacing: 200;
+ text-wrap-width: 50;
+ }
+
+ &[zoom=12] name
+ {
+ text-size: 12;
+ text-spacing: 200;
+ text-wrap-width: 70;
+ }
+
+ &[zoom=13] name
+ {
+ text-size: 12;
+ text-spacing: 100;
+ text-wrap-width: 70;
+ }
+
+ &[zoom=14] name
+ {
+ text-size: 12;
+ text-spacing: 100;
+ text-wrap-width: 70;
+ }
+
+ &[zoom=15] name
+ {
+ text-size: 12;
+ text-spacing: 100;
+ text-wrap-width: 30;
+ }
+
+ &[zoom>=15] name
+ {
+ text-size: 13;
+ text-spacing: 100;
+ text-wrap-width: 40;
+ }
+}
+
+#water-bodies-labels-low[zoom=9],
+#water-bodies-labels-low[zoom=10],
+#water-bodies-labels-med[zoom=11],
+#water-bodies-labels-med[zoom=12],
+#water-bodies-labels-med[zoom=13],
+#water-bodies-labels-high[zoom=14],
+#water-bodies-labels-high[zoom=15],
+#water-bodies-labels-high[zoom=16],
+#water-bodies-labels-high[zoom>=17]
{
- text-face-name: 'Arial Unicode MS Italic';
- text-size: 12;
- text-placement: point;
- text-max-char-angle-delta: 30;
- text-halo-radius: 2;
- text-spacing: 100;
- text-allow-overlap: false;
- text-wrap-width: 30;
-}
-
-#water-bodies-labels-high[zoom=16][area>10000] name,
-#water-bodies-labels-high[zoom>=17] name,
-#green-areas-labels-high[zoom=16][area>10000] name,
-#green-areas-labels-high[zoom>=17] name
+ name
+ {
+ text-fill: #fff;
+ text-halo-fill: #000;
+ }
+
+ &[zoom>=9][zoom<16] name { text-size: 13 !important }
+ &[zoom>=16] name { text-size: 14 !important }
+}
+
+#green-areas-labels-med[zoom=12][area>5000000],
+#green-areas-labels-med[zoom=13][area>2000000],
+#green-areas-labels-high[zoom=14][area>200000],
+#green-areas-labels-high[zoom=15][area>50000],
+#green-areas-labels-high[zoom=16][area>10000],
+#green-areas-labels-high[zoom>=17]
{
- text-face-name: 'Arial Unicode MS Italic';
- text-size: 13;
- text-placement: point;
- text-max-char-angle-delta: 30;
- text-wrap-width: 40;
- text-halo-radius: 2;
- text-spacing: 100;
- text-allow-overlap: false;
- text-wrap-width: 40;
-}
-
-.water-bodies-labels[zoom>=9] name
-{
- text-fill: #fff;
- text-halo-fill: #000;
- text-size: 13 !important;
-}
-.water-bodies-labels[zoom>=16] name
-{
- text-size: 14 !important;
-}
-
-.green-areas-labels[zoom>=12] name
-{
- text-fill: #000;
- text-halo-fill: #fff;
+ name
+ {
+ text-fill: #000;
+ text-halo-fill: #fff;
+ }
}
Oops, something went wrong.

0 comments on commit f6327e1

Please sign in to comment.