Expose geometry type as metatag
This commit is contained in:
parent
62c34451fd
commit
5e03a06bf7
2 changed files with 20 additions and 21 deletions
|
@ -7,7 +7,6 @@ import Title from "../UI/Base/Title";
|
|||
import {FixedUiElement} from "../UI/Base/FixedUiElement";
|
||||
import LayerConfig from "../Models/ThemeConfig/LayerConfig";
|
||||
import {CountryCoder} from "latlon2country"
|
||||
import ScriptUtils from "../scripts/ScriptUtils";
|
||||
|
||||
|
||||
export class SimpleMetaTagger {
|
||||
|
@ -409,7 +408,21 @@ export default class SimpleMetaTaggers {
|
|||
feature.properties["_loaded:datetime"] = datetime(freshness);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
public static geometryType = new SimpleMetaTagger(
|
||||
{
|
||||
keys:["_geometry:type"],
|
||||
doc: "Adds the geometry type as property. This is identical to the GoeJson geometry type and is one of `Point`,`LineString`, `Polygon` and exceptionally `MultiPolygon` or `MultiLineString`",
|
||||
},
|
||||
(feature, _) => {
|
||||
const changed = feature.properties["_geometry:type"] === feature.geometry.type;
|
||||
feature.properties["_geometry:type"] = feature.geometry.type;
|
||||
return changed
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
public static metatags: SimpleMetaTagger[] = [
|
||||
SimpleMetaTaggers.latlon,
|
||||
SimpleMetaTaggers.layerInfo,
|
||||
|
@ -421,7 +434,8 @@ export default class SimpleMetaTaggers {
|
|||
SimpleMetaTaggers.directionSimplified,
|
||||
SimpleMetaTaggers.currentTime,
|
||||
SimpleMetaTaggers.objectMetaInfo,
|
||||
SimpleMetaTaggers.noBothButLeftRight
|
||||
SimpleMetaTaggers.noBothButLeftRight,
|
||||
SimpleMetaTaggers.geometryType
|
||||
|
||||
];
|
||||
|
||||
|
|
|
@ -184,30 +184,15 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"fill":"no",
|
||||
"fill": "no",
|
||||
"width": {
|
||||
"render": "8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"color": {
|
||||
"render": "#05d7fc44",
|
||||
"render": "8",
|
||||
"mappings": [
|
||||
{
|
||||
"if": {
|
||||
"and": [
|
||||
"name:etymology=",
|
||||
"name:etymology:wikidata="
|
||||
]
|
||||
},
|
||||
"then": "#fcca0544"
|
||||
"if": "_geometry:type=Polygon",
|
||||
"then": "16"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fill":"no",
|
||||
"offset":-12,
|
||||
"width": {
|
||||
"render": "16"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue