how to use GetCenter() in VB to return the center of a polygon? [...] I need the center point to tag the popup to which I am not having any luck in doing...
Hi - it's pretty straightforward to do this - some code is below which you can try out in a Button - after the user tracks a Polygon on the map, a temporary Graphic will be added, with a Popup that has a Target which is the center of the Polygon.Dim pgon As ESRI.ArcGISExplorer.Geometry.Polygon = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.TrackPolygon()
Dim pt = pgon.GetCenter()
Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
disp.Graphics.Add(New Graphic(pgon, Symbol.Fill.Solid.Blue, "Note"))
Dim tempPopup As Popup = New Popup(disp, Nothing, String.Format("Popup at {0},{1}", pt.X, pt.Y), "Note With Target", pt)
tempPopup.Activate()
You dont describe what kind of trouble you're having with GetCenter, but if the code above works for you, I'd suggest looking at the Polygon geometry that you're getting back from your DockWindow - check its a valid geometry, check IsEmpty. What do you actually get back from GetCenter - is it null, or a valid Point?