This project has moved. For the latest updates, please go here.

How to create symbol in existing Layer

Topics: SharpMap Project
Dec 23, 2009 at 12:52 PM


Recently I’m working on a project using sharpMap, but I’m affront a problem that I can’t resolve it,

I need to add some symbols in a specific layer, that already contains some geometries

But I don’t know how to create symbol,

The method look like :

private void DrawGeometiresInSelectionLayer(Collection<SharpMap.Geometries.Geometry> geoList)


   VectorLayer vectorLayer = GetSelectedObjectsLayer();

   GeometryProvider geoProvider = vectorLayer.DataSource as GeometryProvider;

 foreach (SharpMap.Geometries.Geometry geo in geoList)


//vectorLayer.Style.Symbol = new Bitmap(@"C:\Programme\Barthauer\TabletEdit\Config\Images\GDB\Schacht.png");

 … how to add a symbole ?

 vectorLayer.DataSource = geoProvider;


You help will so much appreciated

Thx .

Dec 23, 2009 at 11:05 PM

Hi case_tunisia, do you mean you need to change the symbol depending on the feature ? if so you need to look at themes .

Or are you trying to add symbols for non pointal gometries -  this cannot be done directly - you will need to add another point layer perhaps based on the centroid and symbolize that.

hth jd

Dec 24, 2009 at 10:35 AM

Hi, thx for you replay, even it is not exactly what I need,

may be my question were not so clear, but I found a solution,

I just add thoes two lines

vectorLayer.Style.Symbol =  new Bitmap('C:\......");

vectorLayer.Style.SymbolScale = 1

Are enough to display a symbol on the Map

<font size="2">

 but it very important to know that the geoProvider contain only one point geometry



thx for All