This project has moved and is read-only. For the latest updates, please go here.

how to populate attributes in combo box and zoom in its extent on selection?

Topics: SharpMap v2.0
Oct 19, 2009 at 10:00 AM


I am new to sharp map and facing difficulty in my application.

I have 2 shape files.One is 'state' polygon layer and another is 'city' point layer.Also I have a combo box in the application.I want to click a state and the city names within that state to get populated in the combo box.The attibutes with field name "name" should populate in the combo box.

After that I wan't to select any one city from the combo box which will zoom in its extent and get higlighted in the map.

Please help.

Thanks in advance,


Oct 19, 2009 at 3:07 PM

Hi sanban111, you can:

Use provider.ExecuteIntersectionQuery to retrieve all the features from a layer

Store a list of some structure containing the featurename and possibly including the bounding box of the relevant geometry which you can bind to your combobox.

On combobox selection you can do map.ZoomToBox to zoom in on your feature and you could use a CustomTheme to highlight it when rendering

hth jd