Styling¶
Vector feature styles can be customized via CSS. GBD WebSuite supports standard CSS properties for SVG (for example, fill
) and a few custom properties, which must be prefixed with --
in your CSS.
|
background color for feature labels |
|
foreground color for labels |
|
label font size |
|
label offset from the automatic position |
|
label offset from the automatic position |
|
min resolution to display labels |
|
max resolution to display labels |
|
end of line or edge marker ( |
|
fill color for the marker |
|
marker size |
|
marker stroke color |
|
marker stroke color |
|
point size for Point features |
Styling vector layers¶
For vector layers, like sql
or geojson
layers, you can place your css rules directly in the configuration file under style
:
"layers": [
...
{
"title": "My Vector layer",
"type": "sql",
...
"style": {
"type": "css",
"text": "stroke: rgb(0, 255, 255); stroke-width: 2px; fill: rgba(0, 100, 100, 0.2); --label-fill: rgb(255, 0, 0)"
}
}
Alternatively, you can include the rules in your projecr-related CSS file (see Projects), and set text
to the CSS selector
// In your css file
.myVectorLayer {
stroke: rgb(0, 255, 255);
stroke-width: 2px;
fill: rgba(0, 100, 100, 0.2);
--label-fill: rgb(255, 0, 0);
}
// In your config file
{
"title": "My Vector layer",
"type": "sql",
...
"style": {
"type": "css",
"text": ".myVectorLayer"
}
}
Styling built-in features¶
You can customize styles for built-in features, like search results markers or measurements. There are following predefined CSS selectors:
|
search results marker |
|
point measure |
|
line measure |
|
polygon measure |
|
box measure |
|
circle measure |
Styling dimensions¶
The dimensioning plugin uses these CSS selectors:
|
main dimension line. For dimension main lines, the |
|
a “plumb” line from the end of the main line to the edge of the object |
|
a cross at the end of the main line |
|
an arrow at the end of the main line |
|
dimension label |