charlenni / Mapsui.Forms

Xamarin.Forms wrapper around Mapsui
MIT License
6 stars 3 forks source link

PenStyle is getting ignored? #7

Closed heino126 closed 6 years ago

heino126 commented 6 years ago

I am setting a penstyle with PenStyle.Dash in my pen, but I am not getting any dashed in my line. Am I doing something wrong?


 private static async Task<Feature> CreateLineFeature()
        {
            try
            {
                return new Feature
                {
                    Geometry = await CreateLine(),
                    ["Name"] = "Line 1",
                    Styles = new List<IStyle> { new VectorStyle { Line = new Pen{
                        PenStyle = PenStyle.Dash,
                        Color = Mapsui.Styles.Color.Violet,
                        Width = 6,
                    }} }
                };
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
charlenni commented 6 years ago

Which renderer do you use? Do you see a solid line or no line?

heino126 commented 6 years ago

@charlenni I see a solid line

charlenni commented 6 years ago

And you use which renderer? Skia or XAML?

heino126 commented 6 years ago

@charlenni I use XAML

charlenni commented 6 years ago

I assume, that this is a bug in Mapsui. Try to use

    PenStyle = PenStyle.UserDefined,
    DashArray = {1, 1},
heino126 commented 6 years ago

@charlenni I am sorry for wasting your time. After restarting Visual Studio, my original code somehow worked. Thank you for your time.

I tried

 PenStyle = PenStyle.UserDefined,
 DashArray = {1, 1}, 

And that did also work.