Replies: 1 comment 4 replies
-
The idea is that Mapsui should not become a data access layer. That part should be under the users control. Mapsui is a way to visualize that data. Even for that scenario there is room for improvement, but there are some options: GenericCollectionLayerSee the 'Demo | Add Pins' WriteableLayerUse the WriteableLayer, or your own implementation of it. It is used in the editing samples. Assign MemoryLayer.FeaturesAnother way is to use a MemoryLayer and assign the MemoryLayer.Features with your data collection from which you can add and remove. Make sure it is a thread save collection if it gets mutated. Custom IProviderAnother way is to create your own provider: public class MyProvider : IProvider
{
public string? CRS { get; set; } = "EPSG:4326"; // If they lat/lon coordinates
public MRect? GetExtent()
{
// Return the extent of the entire data set. You may want to cache it, but update it when you modify the data.
}
public Task<IEnumerable<IFeature>> GetFeaturesAsync(FetchInfo fetchInfo)
{
// Return the features from which ever source you like.
}
public Add(IFeature feature)
{
// Add in a thread save way
}
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can create a LineString layer with lines, but I don't see a way to add lines as time goes on to that same layer. Every example I've seen adds all the lines when the layer is created. Is there an example of adding lines to an existing LineString layer and not just when the layer is created?
Beta Was this translation helpful? Give feedback.
All reactions