.name)
identifyFeatures(fs.features[0])
Sean,
In Flash Builder do you have the Build Automatically option selected under the project menu?
<mx:Image id="iDrawPnt" width="30" height="30" buttonMode="true" click="driveTime_openHandler(event)" name="{DrawTool.MAPPOINT}" rollOut="iconRollOutHandler(event)" rollOver="iconRollOverHandler(event)" source="assets/images/i_servicearea.png" toolTip="{driveLabel}" useHandCursor="true"
protected function driveTime_openHandler(event:Event):void { map.addEventListener(MapMouseEvent.MAP_CLICK,mapClickHandler) }
Sean,
It is not recommended at ALL that you add or manage your own mapclick functions when using the viewer.
The DriveTime is expecting a MapPoint and you can get that by using the activateIdentifyTool function that the rest of the IdentifyWidget uses as this sends the setMapAction and uses the DrawTool. If you look in the activateIdentifyTool function the name that you are asking about is what type of geometry the DrawTool will draw on the map. Once the DrawTool is done the drawEnd function is fired and there is where you can use the selectedDrawingIcon.name to determine if the button clicked is yours or not (of course you will have to set it to something unique and then add the unique name to the switch statement in the activateIdentifyTool function), and finally fire off your drive time analysis using the MapPoint.
private function drawEnd(event:DrawEvent):void { var point:MapPoint; var geometry:Geometry = event.graphic.geometry; point = geometry as MapPoint; computeServiceArea(point); }
<mx:Image id="iDTPnt" name="DriveTime" width="40" height="40" buttonMode="true" click="{activateIdentifyTool(event)}" rollOut="iconRollOutHandler(event)" rollOver="iconRollOverHandler(event)" source="assets/images/i_servicearea.png" toolTip="Calculate Drive Times" useHandCursor="true"/> private function activateIdentifyTool(event:MouseEvent, lTool:String = ""):void { addSharedData("Deactivate_DrawTool", null); // to be able to deactivate drawTool on other widgets // apply glow if(event){ selectedDrawingIcon = Image(event.currentTarget); }else{ switch(lTool){ case "DriveTime" : { selectedDrawingIcon = iDTPnt; break; } case DrawTool.EXTENT : { selectedDrawingIcon = iDrawExt; break; } case DrawTool.POLYGON : { selectedDrawingIcon = iDrawPoly; break; } case DrawTool.MAPPOINT : { selectedDrawingIcon = iDrawPnt; break; } case DrawTool.POLYLINE : { selectedDrawingIcon = iDrawLine; break; } default: { selectedDrawingIcon = iDrawPnt; } } } clearSelectionFilter(); selectedDrawingIcon.filters = [ glowFilter ]; var status:String; var value:String = selectedDrawingIcon.name; if(!drawTool) drawTool = new DrawTool(); drawTool.showDrawTips = false; lastTool = selectedDrawingIcon.name; setMapNavigation("none", ""); map.panEnabled = false; switch (value) { case "DriveTime": { status = pointLabel; drawTool.markerSymbol = identMarkerSymbol; drawTool.activate(DrawTool.MAPPOINT); break; } case DrawTool.MAPPOINT: { status = pointLabel; drawTool.markerSymbol = identMarkerSymbol; drawTool.activate(DrawTool.MAPPOINT); break; } case DrawTool.POLYLINE: { status = lineLabel; drawTool.lineSymbol = identLineSymbol; drawTool.activate(DrawTool.POLYLINE); break; } case DrawTool.EXTENT: { status = rectLabel; drawTool.fillSymbol = identFillSymbol; drawTool.activate(DrawTool.EXTENT); break; } case DrawTool.POLYGON: { status = polyLabel; drawTool.fillSymbol = identFillSymbol; drawTool.activate(DrawTool.POLYGON); break; } } } private function drawEnd(event:DrawEvent):void { clear(); if(keepActive){ activateIdentifyTool(null, lastTool); }else{ event.target.deactivate(); map.panEnabled = true; if (selectedDrawingIcon) { selectedDrawingIcon.filters = []; selectedDrawingIcon = null; } } if(lastTool == "DriveTime"){ computeServiceArea(event.graphic.geometry as MapPoint); }else{ identifyFeatures(event.graphic.geometry); } }
trace("hello world");
var params:Object = { "Input_Location": featureSet, "Drive_Times": driveTimes }; trace (params.Input_Location);
FeatureSet[index0.ApplicationSkin2._ApplicationSkin_Group1.contentGroup.viewerContainer.mapManager.MapManagerSkin8.managerView.map.UIComponent11.LayerContainer12.GraphicsLayer466.Graphic469]
FeatureSet[GraphicsLayer466.Graphic484]