Comments (4)
Hey Paul, just wanted to share that implementation of "The Tile is rasterized with custom effects just once and cached", going to publish app today:
devenv_ecyOsyAATW.mp4
Subclassed the loader: https://github.com/taublast/DrawnUi.Maui/blob/main/src/Addons/DrawnUi.Maui.MapsUi/src/CustomizeDownloadedTiles.cs
from mapsui.
ah, this is at a really low level. You subclassed the HttpTileSource which is part of BruTile. The Encode() returns a png. You could store it to disk as a regular image png. You could also write it to an MbTiles file and open it in QGIS, no Mapsui needed.
from mapsui.
Hi Paul!
What kind of improvement/look would you have in mind? Some presets/properties for ISkiaStyle
, or maybe more ways to hook custom code that would affect the rendering result?
A quick guess is that we could plug almost any functionality inside a custom ISkiaStyleRenderer. In the mentioned demo I didn't do it because the goal was to create a map control for drawnUi but if I were to use plain Maui, for example, I would add hardware acceleration support for Maui and then create a custom RasterStyleRenderer to achieve the same result. At the same time if we need fast rendering and we have a static result we want to achieve we could custom-render received tiles upon loading and save the final result to cache.
Ways i was considering when thinking about customizing raw tiles, I used the option B:
- A. The Tile is rasterized with custom effects just once and cached, to be fast drawn from an existing image later. Would use for production app when you already know your final static modifications. With actual implementation would need to hook inside the loader.
- B. Customization code is dynamically applied to rendering operation at display/browse time, for heavy stuff better have hardware acceleration. Nice for tryouts and affecting any element that supports IRasterStyle, not only tiles.
from mapsui.
Hi Nick!
Sorry for my late reply.
What I had in mind is not too ambitious. In your sample you created a custom renderer which can render the tile in certain styles. My idea was to add those (or some of those) options to the existing RasterStyle so that our users can use it without having to use skia.
I did not intent to add more ways to make Mapsui more pluggable. I hope a custom ISkiaStyleRenderer is enough for all scenarios.
but if I were to use plain Maui, for example, I would add hardware acceleration support for Maui and then create a custom RasterStyleRenderer to achieve the same result.
I don't fully understand this. In Mapsui we use skia and skia has options for GPU support in some of their views and some of their platforms. We don't do anything else but turn it on if available. I don't see how we could make use of Maui hardware acceleration.
- A. The Tile is rasterized with custom effects just once and cached, to be fast drawn from an existing image later. Would use for production app when you already know your final static modifications. With actual implementation would need to hook inside the loader.
- B. Customization code is dynamically applied to rendering operation at display/browse time, for heavy stuff better have hardware acceleration. Nice for tryouts and affecting any element that supports IRasterStyle, not only tiles.
I have a similar thing in the case of SVGs. We currently create a SKPicture which contains the colors as well. If we want a custom color we need to create an altered copy of the SKPicture. The upside is that this is fast. The downside is that you could need many colors and the cache will grow. In the case of SVGs this is a big problem because you could have continuous color values leading to a cache item very every feature (and there could be 10.000 features). The alternative is to use SKPaths and SKPaints.
For tiles it is less likely to be different for every tile. So there a SKPicture per tile might not be a problem. The downside will be that you can not easily change this without clearing the cache. So a slider which changes the darkness of a tile will not transition smoother. Still I think an SKImage and SKPaint might be the best option for us.
Then again, this is a complicate problem for which I don't expect a perfect solution. We are currently working on changes to the cache so this is not something to change things to in the current code base.
from mapsui.
Related Issues (20)
- [Question/Feature Request] Is there a way to distinguish ViewportChanged events between "manual" and "programmatical" ? HOT 3
- Pinch zoom causes map to pan even with PanLock on HOT 4
- PanLock prevents programmatic moving of the map HOT 2
- WPF: Zoom is laggy after MapControl is re-created HOT 4
- RasterizingLayer performance and display HOT 18
- Let Map be Disposable but not the MapControl
- WPF: Shape layer performance issue HOT 3
- Blazor map control crashes when AOT compiled HOT 8
- System.Text.Json has a vulnerability in version 8.0.3 HOT 3
- Country reappears after it gets back into the viewport HOT 6
- Features are not in the right namespace HOT 2
- Sprite was removed without replacement HOT 1
- How to create Custom calllout
- MapControl from Mapsui.Uno.WinUI doesn't work when targeting windows
- [iOS][4.X.X] Recording of map touches in widgets works selectively HOT 2
- Feature export problem with Mapsui.Rendering.Skia.MapRenderer().RenderToBitmapStream HOT 2
- Problem with the map rotating 5.0.0-Beta2, iOS HOT 1
- Maui Android laggy map navigation
- MapControl in WINUI 3 crashes with WindowsAppSdk 1.6.240829007 HOT 5
- Add documentation on loading bitmaps on MAUI 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.