Dear All m facing a problem related to feature layers. we have only esri:ArcGISDynamicMapServiceLayer for our application. and i want to select a layer where mouse get clicked. means on the map where ever i clicked by mouse it shows that layer inormation by <esri:infoWindowRenderer> tag. but problem is that when i use <esri:ArcGISTiledMapServiceLayer/> my code work fine, but as per our resources we have only dynaminMapServiceLayer, so i hv to work with dynaminMapServiceLayer. so when i remove <esri:ArcGISTiledMapServiceLayer/> tag, then my code does not working....
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" height="100%" width="100%" creationComplete="populateDistricts()" xmlns:esri="http://www.esri.com/2008/ags" xmlns:ns1="com.nic.gis.flexi.nicComponents.*" pageTitle="NIC Map Demo" backgroundColor="#D5F2F9" > <fx:Style> @namespace mapInfoWindow "com.nic.gis.flexi.designer.css.nicmapInfoWindow"; global { chrome-color: #76C5F2; content-background-color: #9BE5F8; } </fx:Style> <fx:Style source="com/nic/gis/flexi/designer/css/nicMap.css"/> <!--<fx:Script source="com/nic/gis/flexi/designer/scripts/Classes.as"/>--> <fx:Script> <![CDATA[ import com.nic.gis.flexi.nicComponents2.switchLocation; import mx.events.FlexEvent; import mx.managers.PopUpManager; public var nicDynamicMapService:String="http://10.131.2.64:8080/GeoServiceRest/services/VidishaGoogleMap/MapServer"; public var nicFeatureLayer:String="http://10.131.2.64:8080/GeoServiceRest/services/VidishaGoogleMap/MapServer/2"; public var nicFeatureLayerLake:String="http://10.131.2.64:8080/GeoServiceRest/services/VidishaGoogleMap/MapServer/6"; private var arcGISTopoWorldMap:String="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"; private var bingDemographicMap:String="http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_1990-2000_Population_Change/M..."; private var googleDemographicMap:String="http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_1990-2000_Population_Change/M..."; private var backGroundTiledMap:String=arcGISTopoWorldMap; public var isEnabledVbox:Boolean=true; [Bindable] [Embed(source="com/nic/gis/flexi/designer/images/cursorsIcons/road_sign.png")] private var roadIcon:Class; [Bindable] [Embed(source="com/nic/gis/flexi/designer/images/cursorsIcons/cursor_arrow.png")] private var curArrow:Class; private var roadIconId:int; protected function roadLayerHandler(event:MouseEvent):void { //Alert.show("Clicked Road"); } protected function lakeLayerHandler(event:MouseEvent):void { Alert.show("Clicked on Lake"); } protected function featureLayer_mouseOverHandler(event:MouseEvent):void { var visibleLayers:ArrayCollection = this.dynServLyr.visibleLayers; //Alert.show(visibleLayers.getItemIndex(2)+''); if(visibleLayers.getItemIndex(2)!= -1){ cursorManager.setCursor(roadIcon); isEnabledVbox=true; }else{ } } protected function featureLayer_mouseOutHandler(event:MouseEvent):void { cursorManager.removeAllCursors(); } protected function featureLayerLake_mouseOverHandler(event:MouseEvent):void { // TODO Auto-generated method stub curArrow cursorManager.setCursor(curArrow); }
protected function button1_clickHandler(event:MouseEvent):void { import mx.managers.PopUpManager; var newLocation:switchLocation=new switchLocation(); PopUpManager.addPopUp(newLocation,this,false); newLocation.move(415, 65); }