I am using the Flex Viewer to zoom to a coordinate and would like to add a point graphic to the center of the map to show the location of the coordinate. I imagine this must be fairly simple, but have not been able to find an example. Any help is greatly appreciated.
Thanks
This sample shows how to add graphics of different geometry types to a map:
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=AddingGraphics
In your case you want to add a MapPoint with a SimpleMarkerSymbol for example.
Thanks Michael, I saw that sample out there, but wasn't sure where the code would be placed within the Viewer's source code and how to specify the center of the map or use the URL parameters. I appreciate the help.
Are you trying to use url parameters to have the viewer zoom to a location and draw a point?
Yes, that is exactly what I am trying to do. I'm looking at not using the Viewer and combining the URL parameters & graphics samples.
Thanks
private function setMapLocation():void { var params:Object = getURLParameters(); if (params["ll"]) { var latlong:Array = String(params.ll).split(","); if (latlong.length == 2) { var centerPoint:MapPoint = WebMercatorUtil.geographicToWebMercator(new MapPoint(latlong[1], latlong[0])) as MapPoint; var myGraphicMarker:Graphic = new Graphic(centerPoint, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933)); var graphicsLayer:GraphicsLayer = new GraphicsLayer(); graphicsLayer.name = "locationGraphics"; graphicsLayer.add(myGraphicMarker); map.addLayer(graphicsLayer); map.centerAt(centerPoint); } } if (params["scale"]) { map.scale = params.scale; } }