AnsweredAssumed Answered

How to zoom to a point in map

Question asked by joby003 on Apr 23, 2012
Latest reply on Apr 30, 2012 by joby003

I have created an application in silverlight using arcgis api. In that I am saving the location in map using map points.

I got the map points while I try to save the record.

When i try to edit the same record I want to zoom to the particular location. How can I do this

<Grid x:Name="LayoutRoot" Margin="2">
            <esri:PictureMarkerSymbol x:Key="PinPictureMarkerSymbol" Source="/UIControls.AccidentRecordForm;component/Images/Delete_2.png" />
        <esri:Map MouseClick="Map_MouseClick" x:Name="MyMap">
                <esri:ArcGISTiledMapServiceLayer Url=""/>
                    <esri:GraphicsLayer ID="MyGraphicsLayer">
                            <esri:GraphicsLayer.Graphics >
                        <esri:Graphic Symbol="{StaticResource PinPictureMarkerSymbol}">


                    MapPoint mapPoint=new MapPoint(Convert.ToDouble(crashForm.tbLocationEasting.Text), Convert.ToDouble(crashForm.tbLocationNorthing.Text));
                    GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
                    Graphic graphic = new Graphic()
                            Geometry = mercator.FromGeographic(mapPoint),
                            Symbol = LayoutRoot.Resources["PinPictureMarkerSymbol"] as Symbol

this is the code where I add graphics to the map whle editting.

How can I zoom or focus to this location?
Please help.