Set the focus to a point on the map

Topics: SharpMap Project, SharpMap v0.9 / v1.x, WinForms Controls
Oct 19, 2009 at 7:39 AM


I need to set the focus to a certain location on the map.  I mean, I need to center the map at that location (polygon) and also adjust the zoom level automatically when the map is rendered..

How could I do it?


Thanks in advance. Hope for a reply soon.

Oct 19, 2009 at 2:01 PM

Hi sanduni, you can use map.ZoomToBox(featureBoundingBox) or a combination of map.Center and map.Zoom hth jd

Oct 21, 2009 at 9:01 AM


Thanks John. Can u please give me a sample code on how to use map.ZoomToBox(featureBoundingBox)?

I am new to sharpmap.