Point Color Problem

Topics: SharpMap v0.9 / v1.x
Aug 2, 2010 at 5:05 PM

Hello

I'm trying to show a point on map using sharpmap.geometries but the point is shown in red and i can't change the color.

here is the code :

 

            SharpMap.Geometries.Point point = new SharpMap.Geometries.Point(latitude, longtitude);
            SharpMap.Data.Providers.GeometryProvider provider = new SharpMap.Data.Providers.GeometryProvider(point);
            SharpMap.Layers.VectorLayer layer = new SharpMap.Layers.VectorLayer("point", provider);

            layer.Enabled = true;
            layer.MinVisible = double.Epsilon;
            layer.Style.Enabled = true;
            layer.Style.Fill = new SolidBrush(Color.Blue);

            layer.Style.EnableOutline = true;
            layer.Style.Outline = new Pen(Color.Yellow);

            layer.Style.MaxVisible = 200;

            //--> add layer and refresh
            _myMap.Layers.Add(layer);
            _myMap.ZoomToExtents();
            RefreshMap();

and here is the picture of the point :
http://imagenic.net/images/j011l8ajlr55fv6110ex.png

how can i change the color ?
thanks

 

Coordinator
Aug 3, 2010 at 11:17 AM
Hi noyfound you need to change the Symbol property not the fill for Points, assign it to a bitmap of your choice.. cheers jd
Aug 3, 2010 at 12:41 PM

Thanks

i used layer.Style.Symbol and it works.

Aug 16, 2013 at 3:38 PM
Hi noyfound,

Could I ask how do you do that? I have same problem like you.
Coordinator
Aug 18, 2013 at 7:56 PM
Have a look at this example of the Example code snipplets.
There is lots of demonstration code in
  • ExampleCodeSnipplets and
  • WinFormSamples
projects to help you show your way around.