Closed sensescape closed 11 years ago
and cities
This is what I have currently for cities. Nothing is showing.
text-name: '[name]';
text-face-name: 'Arial Regular';
text-fill: #fff;
text-halo-fill: @land;
text-placement: point;
text-max-char-angle-delta: 30;
text-wrap-width: 40;
text-halo-radius: 2;
text-allow-overlap: false;
text-size: 13;
text-spacing: 100;
text-line-spacing: -5;
text-wrap-width: 70;
}
text-name: '[name]';
text-size: 13;
}
text-name: '[name]';
text-size: 20;
}
text-name: '[name]';
text-size: 13;
}
text-name: '[name]';
text-size: 20;
}
text-name: '[name]';
text-size: 13;
}
text-name: '[name]';
text-size: 20;
}
text-name: '[name]';
text-size: 13;
}
text-name: '[name]';
text-size: 20;
}
What do I use to get neighborhood names?
I created a new layer (#place-labels
), so you'll need to pull to get it. Once it's in, you can use this to fill in labels:
#place-labels
{
[place='city'][zoom>=10],
[place='town'][zoom>=10],
[place='village'][zoom>=12],
[place='suburb'][zoom>=13],
[place='neighborhood'][zoom>=13],
{
text-name: '[name]';
text-face-name: 'Arial Regular';
text-fill: #fff;
text-halo-fill: @land;
text-placement: point;
text-max-char-angle-delta: 30;
text-wrap-width: 40;
text-halo-radius: 2;
text-allow-overlap: false;
text-size: 13;
text-spacing: 100;
text-line-spacing: -5;
text-wrap-width: 70;
}
}
(I think #city-points-*
was generated by Dymo, which isn't really an option for this project because the data is going to be refreshed periodically by Emil etc. and we can't/shouldn't introduce additional [time-consuming] steps into the process.)
Can we adjust font size according to population size for cities?
Yes. Pull from GitHub to get an updated project file that exposes population and then add something like this (within the #place-labels
block):
[population>=50000]
{
text-size: 15;
}
Tried this, but doesn't seem to have effect of the text size:
{ [place='city'][zoom>=10], [place='town'][zoom>=10], [place='village'][zoom>=12], [place='suburb'][zoom>=13], [place='neighborhood'] { text-name: '[name]'; text-face-name: 'Arial Regular'; text-fill: #000; text-halo-fill: @land; text-max-char-angle-delta: 30; text-wrap-width: 40; text-halo-radius: 2; text-allow-overlap: false; text-size: 10; text-spacing: 100; text-line-spacing: 2; text-wrap-width: 70; }
[zoom>=11] { [population>=50000] { text-name: '[name]'; text-face-name: 'Arial Regular'; text-size: 20; } } }
I'm guessing it's a CSS specificity thing. What happens if you comment out the block with the place
types in it?
Almost done. Just not sure if this is working or not: [zoom>=14][zoom<=15] { [population>=40000] { text-name: '[name]'; text-face-name: 'Arial Regular'; text-size: 17; }
[population>=15000]
{
text-name: '[name]';
text-face-name: 'Arial Regular';
text-size: 14;
}
}
done
neighborhood names and cities when zoomed out like this: http://www.ibikecph.dk