| type | Workspace Key | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Layer features | ||||||||||||||||||||||||||||||||||||||||||||||||
| description | Inline layer features, and featureSet and featureLookup which restrict and enrich the features a layer displays; use for layers without a table or showing a subset of one. | ||||||||||||||||||||||||||||||||||||||||||||||||
| resource | ../../../apps/mapp/lib/layer/featureStyle.mjs | ||||||||||||||||||||||||||||||||||||||||||||||||
| tags |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| status | draft | ||||||||||||||||||||||||||||||||||||||||||||||||
| x-xyz-keys |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| sources |
|
Inline features. A vector format layer with features parses them with
featureFormat, which defaults to format, and never requests data;
reload only re-renders.1 geojson features are GeoJSON Feature
objects with id, geometry and properties; wkt features are records
[id, wkt_geometry, …fields]. The geometry is read in srid, so srid and
qID are still required.2 There is no vector feature
format: a vector layer with features sets featureFormat.
featureSet lists the feature IDs which are displayed. The MAPP library
converts the array to a Set; features whose id is not in it are not styled,
and clustering ignores them.3
featureLookup is an array of objects. A feature is displayed only when an
object's featureLookupId property, id by default, equals the feature ID;
the object's properties are then assigned to the feature, so themes and
labels can use them. On an MVT layer a featureLookup requests tiles with
geometry and ID only, so the lookup supplies the properties.4
The zoom to extent button of a layer with a featureSet or featureLookup queries the extent of those IDs only.5 Location layer entries set featureSet and featureLookup from the location's data at runtime.
- IDs are compared with
===:["1", "2"]matches no integer IDs. Use the type the query returns forqID. - An empty
featureSetdisplays every feature; an emptyfeatureLookupdisplays none. featureLookuptakes precedence overfeatureSetfor the extent query.
The devdb locations restricted to two IDs, and an inline GeoJSON point.
{
"dbs": "DEVDB",
"locale": {
"layers": {
"capitals": {
"display": true,
"format": "wkt",
"table": "example.locations",
"geom": "geom",
"srid": "4326",
"qID": "id",
"featureSet": [2, 3]
},
"inline": {
"display": true,
"format": "vector",
"featureFormat": "geojson",
"srid": "4326",
"qID": "id",
"features": [
{
"type": "Feature",
"id": 1,
"geometry": { "type": "Point", "coordinates": [-0.1276, 51.5072] },
"properties": { "name": "Geolytix" }
}
]
}
}
}
}