GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
87 stars 25 forks source link

vector_layer and mvt_clone #1268

Open dbauszus-glx opened 4 months ago

dbauszus-glx commented 4 months ago

The vector_layer entry and mvt_clone entry type should essentially work the same but are quite different at the moment.

The vector_layer doesn't support themes.

There is a lot of duplicate code which is hard to maintain.

There should be a core layer entry into which the mvt_clone type uses to add to the clone specific items.

The clone logic isn't really required since an mvt layer can be created from the format method in a similar fashion to the vector layer.

It should be possible to create (draw) and modify geometries on vector and mvt [clone] layer.

simon-leech commented 3 months ago

Using an mvt_clone entry - the style panel is always expanded by default even when display is false, it should be hidden in this scenario. If you toggle it on and then off again the style panel disappears so its just an issue on initial load.

Swapping the mvt_clone thematic / display labels does not work presently as it fails with the error - Uncaught TypeError: e.reload is not a function

dbauszus-glx commented 3 months ago

The styleParser is required for mvt_clone and vector [feature] layers. These entry methods can not be async. The show method has to be async in the revised feature_layer entry method. This draft PR cannot proceeed into review until this issue has been resolved. https://github.com/GEOLYTIX/xyz/pull/1344

simon-leech commented 2 months ago

You cannot toggle label elements on and off for mvt_clone or vector at the minute.

If you don't provide a default style but do provide a theme in the entry, you hit a no default style warning - even though the underlying layer has one.

simon-leech commented 2 months ago

You should be able to use highlight interactions and select these locations

dbauszus-glx commented 2 months ago

The mvt_clone logic is convoluted and must be removed. Adding the type:layer entry method and keeping the mvt_clone type would increase complexity and be a maintenance nightmare.

The mode of filtering features for an mvt_clone layer is a featureLookup object. Populated by a query the lookup feature properties are merged with the mvt geometry feature prior to styling the feature. Layer template themes are not usable for the featureLookup since the properties maybe constructed and not available in the layer data at rest. If a featureLookup is used the style should be defined in the entry. The mvt format will only query MVT geometries with ids if the layer has a featureLookup object.

The recommended mode for filtering mvt layer is a featureSet of IDs. A query with the value_only flag can return an array of IDs for the featureSet by nesting a select statement for the id field inside a SELECT ARRAY () sql statement. Switching themes and selection can only work with a featureSet.

The default layer view is not ideally suited for display inside the location view. Only a customised style panel should be shown by default. https://github.com/GEOLYTIX/xyz/issues/1154