Replies: 3 comments 2 replies
-
I can't think of any way for a single MLNComputedShapeSourceDataSource to split features into multiple layers. In the past i have used both approaches you mentioned, including a "type" attribute and using an in-app http server to server to generate and serve vector tiles. Depending on the data, one big upside of serving vector tiles is you can have maplibre cache them instead of regenerating on every map load. |
Beta Was this translation helpful? Give feedback.
-
The serving of vector tiles work very well, except for rapid changing vector tiles like for fleet monitoring. I have not found a Is there a way to do this in a better way? |
Beta Was this translation helpful? Give feedback.
-
For the rapid changing layers with multiple generated layer-names, at least in my case, seem to be to create a single MLNComputedShapeSource and use an attribute for the feature type and filter on that in the style. That way, I can re-use the (relative) expensive querying of the data source across feature types and still have the smooth refresh of MLNComputedShapeSource with invalidBounds. Seem to work good for me now. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to define source-layer pr MLNFeature in a MLNComputedShapeSourceDataSource?
Now, I have one MLNComputedShapeSourceDataSource for each source-layer (feature type), but that is inefficient as some of the MLNComputedShapeSourceDataSource uses the same underlying data store, but create different geometries.
I can merge them to one MLNComputedShapeSourceDataSource and introduce a type-attribute that the style layers can filter on, but using source-layer seem to be more in line with how it is done with vector tiles.
Or I can skip MLNComputedShapeSourceDataSource all together and go for in-app created vector tiles. That has its own complexities.
Beta Was this translation helpful? Give feedback.
All reactions