-
|
Let's say I have a list of points, each with metadata, that I keep in my app state. I then want to both, pass this list to galileo as a feature layer to render the points as Map-Markers, and also pass them to a gui (e.g. egui). Both, galileo via event handlers, and egui via handlers on gui widgets, may mutate the metadata of each point, and also might add or remove points. I am wondering if it is possible to retain ownership of data in my app state that I pass on to a Currently creating a I looked at the with_egui example which facilitate the sharing of data between galileo and egui via passing (copies) of data on every frame. In the example this is read-only and, as far as I understood the current Galileo API, I would only be able to get (mutable) references of a feature out of a featurelayer ( Is the current state of the API intentional, i.e., galileo will need ownership of the list of items contained in every feature layer, or is this a stopgap? How would one allow manipulation of the collection of features and the features themselves from multiple places? (I started working towards using the (winit) event loop to pass Thanks in advance for any insights! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi, @lennart . Sorry, for the late reply. It's very good that you raised this question since I haven't give much though to ownership of data in Galileo structures. The current API is done as is just because this was what my previous take on mapping libraries did. (It was not in Rust, so there was no question about ownership at all...) To tell the truth, I don't think that the current implementation of As a way forward I would suggest you come up with a simple implementation of the If such layer would prove to have convenient API, we can see how to modify |
Beta Was this translation helpful? Give feedback.
Hi, @lennart . Sorry, for the late reply. It's very good that you raised this question since I haven't give much though to ownership of data in Galileo structures. The current API is done as is just because this was what my previous take on mapping libraries did. (It was not in Rust, so there was no question about ownership at all...)
To tell the truth, I don't think that the current implementation of
FeatureLayeris satisfactory. I tried to make it magically do everything at once: keep track of data changes, apply and control styling, reproject geometries into map CRS etc. And such approach rarely results in comprehensive and convenient API. So I am totally up for ideas on how to make it…