Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF: Shape layer performance issue #2704

Open
EmaDozer opened this issue Jul 8, 2024 · 4 comments
Open

WPF: Shape layer performance issue #2704

EmaDozer opened this issue Jul 8, 2024 · 4 comments

Comments

@EmaDozer
Copy link

EmaDozer commented Jul 8, 2024

Mapsui Version
4.1.7

Mapsui Platform
WPF

Device
Windows

Describe the bug
Relative small shapes cause the map to be laggy. I use RasterizingTileLayer with SqlitePersistentCache and without projection between map and shape.

I attached a sample project:
ShapeLayer.zip

Method to create shape layer:

private static ILayer CreateShapeLayer()
 {
     var shapeFile = new Mapsui.Nts.Providers.Shapefile.ShapeFile(
        Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "shapes", "EZG_KB_LM.shp"), false)
     { CRS = "EPSG:3857" };

     var sqlitePersistentCache = new SqlitePersistentCache("shapes");
     sqlitePersistentCache.Clear();

     var layer = new Layer
     {
         Name = "Test",
         DataSource = shapeFile,
         Style = CreateVectorThemeStyle(),
     };

     return new RasterizingTileLayer(layer, persistentCache: sqlitePersistentCache);
 }

To Reproduce
Open the sample project and zoom to the shape.

@pauldendulk
Copy link
Member

If there is no persistentCache there is no such lag?

@EmaDozer
Copy link
Author

I tried it also without the persistentCache, made not really a difference.

@EmaDozer
Copy link
Author

EmaDozer commented Aug 14, 2024

I added another sample where you can enable 2 different layers (size 1MB and 3.6MB). Currently its hard to use Mapsui with shapes on WPF or maybe i am missing something fundamental?

zip:
Uploading shape perfromance issue.zip…

video:
https://github.com/user-attachments/assets/0122be6d-140d-4f18-9389-9c686ac62e6f

@jamaa
Copy link

jamaa commented Dec 2, 2024

The lagginess occurs even with very small shapes of 5KB, either we are doing something fundamentally wrong or this version of MapsUI is just not able to deal with shapefiles well? If someone with more experience with MapsUI could have a look at the sample project above, maybe they could point us in the right direction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants