Permalink
Browse files

Merge branch 'hill-farming' of ../highroad

  • Loading branch information...
2 parents f14a5dc + c612bda commit 4e445855ce5cb4070ec5ed6416989f84f25e781b Michal Migurski committed Dec 20, 2011
Showing with 66 additions and 8 deletions.
  1. +39 −1 mapnik/cities-halomask.mml
  2. +13 −5 mapnik/style.mml
  3. +14 −2 mapnik/stylesheet.mss
View
@@ -21,7 +21,19 @@
*/
Map { map-bgcolor: #fff; }
-
+
+ #labels-high[zoom=11][population>0] name,
+ #labels-high[zoom=11][place=city] name,
+ #labels-high[zoom=11][place=town] name
+ {
+ text-face-name: "PT Sans Narrow Regular";
+ text-fill: #fff;
+ }
+
+ #labels-high[font_size=18] name { text-size: 18; }
+ #labels-high[font_size=24] name { text-size: 24; }
+ #labels-high[font_size=32] name { text-size: 32; }
+
.labels name,
#green-areas name
{
@@ -135,6 +147,32 @@
</Datasource>
</Layer>
+ <Layer class="labels" id="labels-high" srs="&epsg900913;">
+ <Datasource>
+ <Parameter name="type">postgis</Parameter>
+ <Parameter name="host">&osm_host;</Parameter>
+ <Parameter name="port">&osm_port;</Parameter>
+ <Parameter name="user">&osm_user;</Parameter>
+ <Parameter name="password">&osm_pass;</Parameter>
+ <Parameter name="dbname">&osm_name;</Parameter>
+ <Parameter name="estimate_extent">false</Parameter>
+ <Parameter name="extent">&epsg900913_extent;</Parameter>
+ <Parameter name="table"><![CDATA[
+ (
+ SELECT place, name, COALESCE(population, 0) AS population, way,
+ (CASE WHEN population >= 250000 THEN 32
+ WHEN population >= 50000 THEN 24
+ WHEN place IN ('city', 'town') THEN 24
+ ELSE 18
+ END) AS font_size
+ FROM places_osm_point
+ WHERE place IN ('city', 'town', 'village', 'hamlet')
+ ORDER BY population DESC
+ ) AS labels
+ ]]></Parameter>
+ </Datasource>
+ </Layer>
+
<Layer id="green-areas" srs="&epsg900913;">
<Datasource>
View
@@ -306,7 +306,7 @@
</Datasource>
</Layer>
- <Layer status="off" id="place-names" srs="&epsg900913;">
+ <Layer id="place-names" srs="&epsg900913;">
<Datasource>
<Parameter name="type">postgis</Parameter>
<Parameter name="host">&osm_host;</Parameter>
@@ -317,10 +317,18 @@
<Parameter name="estimate_extent">false</Parameter>
<Parameter name="extent">&epsg900913_extent;</Parameter>
<Parameter name="table"><![CDATA[
- (SELECT way, name
- FROM planet_osm_point
- WHERE place IN ('city', 'town', 'village')) AS places
- ]]></Parameter>
+ (
+ SELECT place, name, COALESCE(population, 0) AS population, way,
+ (CASE WHEN population >= 250000 THEN 32
+ WHEN population >= 50000 THEN 24
+ WHEN place IN ('city', 'town') THEN 24
+ ELSE 18
+ END) AS font_size
+ FROM places_osm_point
+ WHERE place IN ('city', 'town', 'village', 'hamlet')
+ ORDER BY population DESC
+ ) AS labels
+ ]]></Parameter>
</Datasource>
</Layer>
View
@@ -625,13 +625,25 @@ Map {
/*//////// Labels! */
-#place-names[zoom>=10] name
+#place-names[zoom>=11][zoom<15][population>0] name,
+#place-names[zoom>=11][zoom<15][place=city] name,
+#place-names[zoom>=11][zoom<15][place=town] name,
+#place-names[zoom>=15][zoom<17] name
{
text-face-name: "PT Sans Narrow Regular";
text-fill: #000;
- text-size: 14;
}
+#place-names[zoom>=12][zoom<17] name
+{
+ text-halo-fill: #f7f7e6;
+ text-halo-radius: 2;
+}
+
+#place-names[font_size=18] name { text-size: 18; }
+#place-names[font_size=24] name { text-size: 24; }
+#place-names[font_size=32] name { text-size: 32; }
+
/*
#airports[zoom=2][natlscale>148],
#airports[zoom=3][natlscale>74],

0 comments on commit 4e44585

Please sign in to comment.