Select to view content in your preferred language

Zooming to point using lat/long

1777
2
05-16-2011 05:18 AM
EssamYoussif
New Contributor
how can i zoom to a point using lat/long cordinates
Tags (2)
0 Kudos
2 Replies
PetrTrefil
Deactivated User
In flex 1.3 I use widget  "LocateWidget"

1/ in "CONFIG.XML" you have to insert new widget

<widget label="Lokalizace X,Y" icon="com/esri/solutions/flexviewer/assets/images/icons/i_flag.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/LocateWidget.xml">com/esri/solutions/flexviewer/widgets/LocateWidget.swf</widget>

2/ use in project LocateWidget.xml and LocateWidget.mxml
0 Kudos
sumedhasilla
Emerging Contributor
Hi,

You can also give a try with the Map.centerAt method.
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Map.html#centerAt()

Code snippet:
var mapPt:MapPoint = new MapPoint(1447100, 7477200, new SpatialReference(102100));
var myGraphicMarker:Graphic = new Graphic(mapPt,new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933));
   
    myGraphicsLayer.add(myGraphicMarker);
   
    myMap.centerAt(mapPt);
    myMap.scale = 12000;
0 Kudos