Sample for drawing an SVG pin? #2229
-
I need to draw an SVG symbol/pin on the map, the intention being to display a circle with transparent fill. Is there a sample of how to do this? I assume I create a Pin with an SVG type... |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
See Samples/Mapsui.Samples.Common/Maps/Styles/SvgSample.cs |
Beta Was this translation helpful? Give feedback.
-
You need to know that the Mapsui hit detection is based on color. So, if the center of the circle is fully transparent a tap inside it will not be detected as a hit. Sometimes that is what you want, so fine. If not, you could work around it by using a fill color which is almost fully transparent, like this: public static Color AlmostTransparent => new() { A = 1, R = 255, G = 255, B = 255 }; |
Beta Was this translation helpful? Give feedback.
-
Thanks - that's definitely worth knowing!
…________________________________
From: Paul den Dulk ***@***.***>
Sent: 22 October 2023 09:29
To: Mapsui/Mapsui ***@***.***>
Cc: James Lavery ***@***.***>; State change ***@***.***>
Subject: Re: [Mapsui/Mapsui] Sample for drawing an SVG pin? (Discussion #2229)
You need to know that the Mapsui hit detection is based on color. So, if the center of the circle is fully transparent a tap inside it will not be detected as a hit. Sometimes that is what you want, so fine. If not, you could work around it by using a fill color which is almost fully transparent, like this:
public static Color AlmostTransparent => new() { A = 1, R = 255, G = 255, B = 255 };
—
Reply to this email directly, view it on GitHub<#2229 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3IWLFD5BYACN2OZ2GPFPWLYATKNPAVCNFSM6AAAAAA6J5HBFSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGNBZHEYTA>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
See Samples/Mapsui.Samples.Common/Maps/Styles/SvgSample.cs