I am adding a graphics layer from a featurelayer upon loading the application. I need to implement a cutom identify for the graphics layer. I am able to select graphics with in extent, but need to select a graphics while clicking on map. can anybody help me in this.......
private function ShowIdentify():void{
jnjMap.addEventListener(MapMouseEvent.MAP_CLICK,IdentifyFunction);
}
protected function IdentifyFunction(event:MapMouseEvent):void
{
var selGraphic:Graphic;
var ext:Number = jnjMap.extent.width / jnjMap.width * 5;
var x:Number = event.mapPoint.x;
var y:Number = event.mapPoint.y;
var queryExtent:Extent = new Extent(x - ext, y - ext, x + ext, y + ext, event.mapPoint.spatialReference);
var identifyResults:ArrayCollection = new ArrayCollection;
var Identifygraphic:Graphic;
var storeInfo:StoreInfoWindow ;
// var ac:ArrayCollection = myGraphicsLayer.graphicProvider as ArrayCollection;
//Stuck up here .... 😞
//Get the selected extent
if (queryExtent.contains(MapPoint(selGraphic.geometry)))
{
selGraphic.symbol = highlightedSymbol;
identifyResults.addItem(selGraphic.attributes.CITY_NAME);
}
//else if point was previously highlighted, reset its symbology
else if (selGraphic.symbol == highlightedSymbol)
{
selGraphic.symbol = defaultSymbol;
}
selectionGraphicsLayer.add(selGraphic);
Thanks!