Dots on Mapsui WPF Sample

May 23, 2011 at 12:49 PM


i try to figure out, where the dots are come from. I Would like to make Dots on the card, but i dont know how, because of this i look for the line where the dots are created.

Later i want draw on the map, is there something what i can use to draw on the map?


Thank you

May 29, 2011 at 8:35 PM


Here is sample to create a layer with a single dot:

            var layer = new Layer("test");
            layer.DataSource = new MemoryProvider(new SharpMap.Geometries.Point(0, 0));
            layer.Styles.Add(new SymbolStyle() { Width = 20, Height = 20, Fill = new Brush() { Color = Color.White }, Outline = null });

another sample is the city layer in here:


Jun 6, 2011 at 9:45 AM

Thx pauldendulk,

this works fine. I Try to Draw on the Map in realtime with a digital pen. But if i try to draw Points with your posted method i get
performance problems.  Is there a faster way to draw on the map?



Jun 6, 2011 at 1:27 PM

Not at the moment. The current symbol rendering is a slow as can be :). You can think of ways to make it somewhat faster, but my hopes are for SL5's XNA rendering. 


Jun 6, 2011 at 2:23 PM
Edited Jun 6, 2011 at 3:38 PM

Hmm okay, i will first complete my application and then starting with optimisation.

Is there a way to use somethink like that in MapSui?

I would like to transform from image coordinations to world coordinations

Thanks :)


I find where to do it.

In the view object there is a function to do this:


Jul 3, 2011 at 4:15 PM
Edited Jul 4, 2011 at 10:14 AM

I use now only one layer to draw multiple LineStrings. Performance is very good.

But if i create one more it slows down. I am looking at the moment for a way to draw multiple linestings with

different colors. Do you know a way how to do this?

I set the color of the linestrings over the Layer...

Jul 4, 2011 at 7:13 AM

`You could use a ThemeStyle. There are samples for countries and cities in ShapefileSample.cs:


Jul 4, 2011 at 9:12 PM

I use ThemeStyle in this way:

featureContainer = new Dictionary(); 

   private void iTHEME()
            ThemeStyle t = new ThemeStyle(testc);

        public IStyle testc(IFeature i)
            if (featureContainer.ContainsKey(i.GetHashCode()))
                Console.WriteLine("ist da");
            return createStyleForRegion(20, 50, 0, 0);

But i dont know how to identify a Feature. I dont undestand where this happen in your example which you have posted.

Is this the right way to do this?

Thank you

Jul 5, 2011 at 4:50 AM

you could create a ThemeStyle 

in the sample add a method:

        private static IStyle GetMyStyle(IFeature f)
            var style1 = new VectorStyle();
            style1.Outline = new Pen { Color = Color.Black };
            style1.Fill = new Brush { Color = Color.Red };

            var style2 = new VectorStyle();
            style2.Outline = new Pen { Color = Color.Black };
            style2.Fill = new Brush { Color = Color.Blue };
            if (Convert.ToDouble(f["POPDENS"]) > 10) 
                return style1;
                return style2;

and replace:



countries.Styles.Add(new ThemeStyle(GetMyStyle));

and run Mapsui.WinForms

Jul 5, 2011 at 10:04 AM

Thank You :)

I dont know that i can do this =>  f["blub"] = "lala";

Jul 10, 2011 at 8:53 PM
Edited Jul 11, 2011 at 10:28 AM

Which coordinate system are you yousing? I have some points (longitude, latitude) and want to draw them on the map. But i

dont know how to transform them.


I found my answer here :)