Comments (2)
I think, that should possible with a shader in the SKPaint of the path. I would start with research in SkiaSharp or Skia. Perhaps you find there a solution.
from mapsui.
This is mostly a SkiaSharp question so you could also ask it there (after you searched for previous questions on this topic of course). https://github.com/mono/SkiaSharp
Dash Patterns
It is possible to use dash patterns in SkiaSharp. We use this in our sample "Tests" | "Line", like this:
feature = new GeometryFeature(wktReader.Read("LINESTRING (7000000 12000000, 13000000 12000000)"));
feature.Styles.Add(new VectorStyle { Line = new Pen(Color.Blue) { PenStyle = PenStyle.DashDot } });
A screenshot of the sample copied from the blazor samples (https://mapsui.com/samples/):
Combining colors
As far as I know you can use only one color in such a draw operation. My way to go about this would be to have two draw operations. The first color could be a solid line, and on top of that draw the dashed line, so the solid line fill the gaps in the dashed line.
Note, that for a good solution where the line looks the same while panning and zooming you need to take into account the offset (of the origin of the path is not visible in the image you need to correct for that) and the scale (the dash pattern is different for different scales to make it appear the same to the user).
from mapsui.
Related Issues (20)
- Upgrade 3-> 4 / Help / Question / Viewport HOT 6
- Confusion with WMTS (blank map) #question #helpneeded HOT 5
- MAUI: Double click on map HOT 3
- Memory Leak HOT 10
- [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
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.