MapCSS/Examples
From OpenStreetMap Wiki
< MapCSS
Other languages — Help us translating this wiki
• Afrikaans • አማርኛ • العربية • অসমীয়া • Asturianu • Azərbaycanca • Български • বাংলা • Brezhoneg • Bosanski • Català • Corsu • Česky • Dansk • Deutsch • ދިވެހިބަސް • Ελληνικά • Esperanto • Español • Eesti • Euskara • فارسی • Suomi • Frysk • Gaeilge • Kréyòl gwadloupéyen • Gàidhlig • Galego • Alemannisch • ગુજરાતી • هَوُسَ • עברית • हिन्दी • Hrvatski • Kreyòl ayisyen • Magyar • Հայերեն • Interlingua • Bahasa Indonesia • Igbo • Íslenska • Italiano • 日本語 • Basa Jawa • ქართული • Қазақша • ភាសាខ្មែរ • ಕನ್ನಡ • 한국어 • Kurdî • Lëtzebuergesch • ລາວ • Lietuvių • Latviešu • Malagasy • Македонски • മലയാളം • मराठी • Bahasa Melayu • Malti • မြန်မာဘာသာ • नेपाली • Nederlands • Norsk (nynorsk) • Norsk (bokmål) • Occitan • Oromoo • ଓଡ଼ିଆ • ਪੰਜਾਬੀ • Polski • پښتو • Português • Português do Brasil • Română • Română (Moldova) • Русский • سنڌي • සිංහල • Slovenčina • Slovenščina • Soomaaliga • Shqip • Српски / Srpski • Svenska • தமிழ் • తెలుగు • Тоҷикӣ • ไทย • Türkçe • Українська • اردو • O'zbek • Tiếng Việt • Wolof • isiXhosa • Yorùbá • 中文(简体) • 中文(繁體) • isiZulu
Here shall come an easy to handle collection of short MapCSS rulesets
How to use own MapCSS rule files easily in JOSM:
- Copy all text of each example to an own text file.
- Open JOSM and choose the mappaint style button at the left screen side, so that at the right screen side a box with all available mapstyles comes up.
- There, choose the very right button when you hover over it with the mouse, so the settings for mappaint style comes up.
- Choose the plus symbol to ad d a new style -> there you can choose your text file.
More information at http://josm.openstreetmap.de/wiki/Styles ... see the links there for tutorial and reference.
Display of administrative boundary polygons
I tries the following in JOSM. Source data file can be one country or a smaller area downloaded via geofabrik.de or cloudmade.com which were minimized by Osmfilter via --keep="boundary=" or similar.
Maybe you can even have a "filtered" download via one of the recent API servers.
--- start copy&paste here ---
canvas {
background-color: #ffffea;
default-points: false;
default-lines: false;
}
relation[boundary=administrative][admin_level=7]:closed
{
width: 1;
color: black;
opacity: 1;
fill-color: orange;
fill-opacity: 0.3;
font-size: 16;
text-color: green;
text: admin_level;
text-position: center;
}
relation[boundary=administrative][admin_level=8]:closed
{
width: 1;
color: black;
opacity: 1;
fill-color: blue;
fill-opacity: 0.3;
font-size: 16;
text-color: red;
text: admin_level;
text-position: center;
}
relation[boundary=administrative][admin_level=6]:closed
{
width: 1;
color: black;
opacity: 1;
fill-color: brown;
fill-opacity: 0.3;
font-size: 16;
text-color: white;
text: admin_level;
text-position: center;
}
--- end copy&paste here ---
Result:
Note: all areas with dark blue seems to be double ... so there are some logical errors in the boundary relations!!
