"The explosive growth of the GeoWeb and geographic information has made GIS powerful media for the general public to communicate, but perhaps more importantly, GIS have also become media for constructive dialogs and interactions about social issues." - Sui & Goodchild
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
geoinf18:oltuto2 [2018/12/06 23:03] oertz [B. Pilotage client-side avec OL3 & l'API CARTO] |
geoinf18:oltuto2 [2019/01/08 19:35] oertz [B. Personnaliser un style avec l'extension GeoCSS] |
||
---|---|---|---|
Line 86: | Line 86: | ||
* Ajouter un label avec l'attribut ''Name'' (voir https://docs.geoserver.org/stable/en/user/styling/css/properties.html#text-symbology-labeling-part-1) | * Ajouter un label avec l'attribut ''Name'' (voir https://docs.geoserver.org/stable/en/user/styling/css/properties.html#text-symbology-labeling-part-1) | ||
* Limiter l'affichage du labeling à partir d'un certain niveau d'échelle (voir https://docs.geoserver.org/stable/en/user/styling/css/filters.html#filtering-by-rendering-context-scale) | * Limiter l'affichage du labeling à partir d'un certain niveau d'échelle (voir https://docs.geoserver.org/stable/en/user/styling/css/filters.html#filtering-by-rendering-context-scale) | ||
+ | |||
+ | <code> | ||
+ | /* This should work as a scale-controlled display of labels */ | ||
+ | * { | ||
+ | stroke: #000000; | ||
+ | stroke-width: 2; | ||
+ | | ||
+ | /* no fill | ||
+ | fill: #ffcc00; | ||
+ | fill-opacity: 0.6; | ||
+ | */ | ||
+ | | ||
+ | [@sd <= 800k] { | ||
+ | label: [Name]; | ||
+ | label-anchor: 0.5, 0.5; | ||
+ | | ||
+ | font-fill: black; | ||
+ | font-size: 40; | ||
+ | font-weight: bold; | ||
+ | | ||
+ | halo-color: white; | ||
+ | halo-radius: 2; | ||
+ | } | ||
+ | } | ||
+ | </code> | ||