查询结果:
GraphicsLayer graphicslayer = null;
int index = this.listStreet.SelectedIndex;
if(index>-1)
{
Graphic selectedGra = lisRoad[index].RoadGraphic;
if (objCurrentMap.Layers["QueryRoadResult"] != null)
{
graphicslayer = objCurrentMap.Layers["QueryRoadResult"] as GraphicsLayer;
graphicslayer.ClearGraphics();
}
else
{
graphicslayer = new GraphicsLayer() { ID = "QueryRoadResult" };
}
selectedGra.Symbol = this.CanvasQueryRoad.Resources["DefaultPointSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
放大到某个几何对象(非点状几何)
objCurrentMap.ZoomTo(selectedGra.Geometry);
平移到某个对象
/objCurrentMap.PanTo(selectedGra.Geometry);
放大到某个几何对象(点几何)
MapPoint objMp = new MapPoint();
objMp =(MapPoint) selectedGra.Geometry ;
Envelope locatorExtent = new Envelope(float.Parse(objMp.X.ToString()) - 0.001, float.Parse(objMp.Y.ToString()) - 0.001, float.Parse(objMp.X.ToString()) + 0.001, float.Parse(objMp.Y.ToString()) + 0.001);
objCurrentMap.ZoomDuration = new TimeSpan(0, 0, 2);
this.objCurrentMap.ZoomTo(locatorExtent);