[Solved]How to Create markers based upon latitude and longitude data present in the database

Topics: SharpMap Project, SharpMap v2.0, WinForms Controls
Oct 6, 2010 at 12:07 PM
Edited Oct 18, 2010 at 7:48 PM

Hi Team,

I want to display markers based upon the data, present tin the databse I have langitude and latitude with some address and name information and I want to dispaly the data on map with marker image.

and I want to show one popup message if you click on marker which will provide information of the address, name in popup.


I am using this layers.


Please help up me out .
Thanks in advance,
Vivek Kumar


Oct 6, 2010 at 1:57 PM

Hello Vivek Kumar,

You need to follow these steps:

  1. Depending on your database pick a suitable provider
    • SqlServer2008
    • PostGis
    • SpatiaLite
    • Shapefile
    • ...
  2. Add a VectorLayer to your map
    var pointLayer = new VectorLayer("GeoLocations", new ...Provider(<...Provider arguments>);
    ((VectorStyle)PointLayer.Style).Symbol = <Load some symbol>;
    map.Layers.Add pointLayer;
  3. Add map to MapBox|Image control
  4. Set ActiveTool for MapBox|Image to 'Query'
  5. Handle MapQueried event to setup ToolTip

Hth FObermaier

Oct 7, 2010 at 8:36 AM


Hi FObermaier,

Just want to know how I can put markers on map.

Please let me know any code sample.

Thanks for your time.

Vivek Kumar