Comments (2)
I looked into this. I think we need to implement IDisposable
for the samples. I think Thomas mentioned this somewhere before and then the argument came up that the samples are there to show the users how things work and should not be cluttered too much with this kind of thing. In this case it will affect performance noticeably so I think we now have too.
How to keep the samples readable:
- Perhaps only Dispose the fields if really needed, and ignore it in other situations.
- Reorganize Mapsui so that the layers and providers are not disposable. The data fetcher should be a central component (most of the time it is the http request or db requests that needs to be disposed) and let the layer be simple data definitions.
from mapsui.
Looked a bit more at the code. Disposing samples would need us to store the previous sample, which we don't do at the moment. Perhaps we need to introduce some SampleService for that. A class which could be shared through all our samples. Perhaps some more logic around the samples could be moved in there, for instance access to the list of samples returned by the AllSamples.GetSamples() method, selecting the sample corresponding to the name.
I suggest that the first version of the disposable samples would not add IDisposable to the sample interface, but just for specific ones we decide to dispose, and check for each sample if they implement the interface.
from mapsui.
Related Issues (20)
- Polygon Drag Not Refreshing Until Map Is Panned HOT 2
- Convert all our scripts to PowerShell
- Add LayerListWidget HOT 5
- Custom IViewportLimiter's Limit function is not called HOT 1
- MAUI Flyout Locks Map (regression) HOT 9
- Make the MapControl disposable and not the Map
- GeometryFeature disappears while panning HOT 9
- BitmapRegistry.Unregister() doesn't remove bitmap from lookup array HOT 3
- Callout not always on top HOT 6
- Drawing order different to map info order HOT 4
- More shared touch/mouse handling over all platforms HOT 7
- When touching and holding a long press, mapControl becomes blank HOT 6
- OSM MapControl does not work in Avalonia Browser when using .NET 8 HOT 8
- Regression tests crash on GeoTiff HOT 5
- Incorrect zoom behavior HOT 3
- Suddenly blank map is displayed for all KnownTileSources HOT 4
- Add feature sorting mechanism HOT 2
- Rewrite test-image-copier.cmd to powershell
- Remove the number prefix from all our samples HOT 1
- System.NullReferenceException when replacing TileLayer. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapsui.