Skip to content

Commit

Permalink
Merge branch 'hill-farming' of ../highroad
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Migurski committed Dec 20, 2011
2 parents f14a5dc + c612bda commit 4e44585
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 8 deletions.
40 changes: 39 additions & 1 deletion mapnik/cities-halomask.mml
Expand Up @@ -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
{
Expand Down Expand Up @@ -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>
Expand Down
18 changes: 13 additions & 5 deletions mapnik/style.mml
Expand Up @@ -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>
Expand All @@ -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>

Expand Down
16 changes: 14 additions & 2 deletions mapnik/stylesheet.mss
Expand Up @@ -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],
Expand Down

0 comments on commit 4e44585

Please sign in to comment.