move map accroding to the graphic

313
2
12-20-2011 02:24 PM
ForamParikh
Occasional Contributor
Hello everyone,
I am facing one problem on my screen there are lots of features available so if user wants to add feature he can add polygon and once it complete drawing i open the window to add related data and my data window resides right side of the map so if user draw polygon at right side then after drawing complete it hide my feature so is there any way that i can move the map?i mean whenever user draw feature any where on the screen the map should move and it should come center of the screen?i mean  that feature is on the graphical layer..so can i move my screen according to my graphic?

Please advise,
0 Kudos
2 Replies
TonyBacon
New Contributor II
Use the PanTo method on the map control sending the new graphics geometry and the new graphic will be centered in the map such as:

mymap.PanTo(mygraphic.Geometry);
0 Kudos
ForamParikh
Occasional Contributor
Thanks tbacon..I got my anser
0 Kudos