Ann,
Code:
protected function pointsXML_resultHandler(event:ResultEvent):void
{
var inSr:SpatialReference = new SpatialReference(4326);
var outSr:SpatialReference = new SpatialReference(3857);
var gArr:Array = new Array();
var myGraphics:Array = new Array();
var x:XML = XML(event.result);
pntList = x..entry;
for (var i:int; i < pntList.length(); i++)
{
var latlong:Array = pntList[i].point.split(" ");
//create graphic attributes
var attributes:Object = new Object();
attributes.name = pntList[i].name; // attributes["name"]
attributes.region = pntList[i].region; // attributes["region"]
attributes.summary = pntList[i].summary; // attributes["summary"]
// you can hold/add/remove/read/... on client side any attribute types you want
attributes.myBool = false; // type Boolean
attributes.creationDate = new Date(); // type date
attributes.myComplexAttribute = new MyComplexAttribute();
attributes.symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.CIRCLE, ...);
var myPoint:Geometry = new MapPoint(latlong[1], latlong[0], inSr);
var coordGraphic:Graphic = new Graphic(myPoint, null, attributes);
gArr.push(myPoint);
myGraphics.push(coordGraphic);
}
geometryService.project(gArr, outSR, new AsyncResponder(onProjectComplete, onProjectFault, myGraphics));
}
Bookmarks