Select to view content in your preferred language

Mouse over event on multiple overlapping feature layers

848
1
07-18-2012 05:52 PM
AndrewThomas
Deactivated User
I have a problem which I think I need to design a new solution to get around.

I have a feature layer covering the entire extent of my map. On the layer load I add a graphic add event listener

fLayer.addEventListener(GraphicEvent.GRAPHIC_ADD,fLayer_graphicAddHandler);

~

protected function fLayer_graphicAddHandler(event:GraphicEvent):void
{
 event.graphic.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
 event.graphic.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
}


The mouse over handler takes the attributes from the graphic and displays them on a status bar, so the user has a live display of data under the mouse at all times.

I also have another feature layer which is interactive (assigned to an attribute inspector ). When the user hovers the mouse over that feature, the cursor changes and a tooltip is displayed. Obviously when the user clicks on the feature the attribute inspector is displayed.

However, It seems the mouse can only be over one feature or the other, whichever feature layer is added to the map with the highest index. i guess this is by design.

So if the entire extent layer is on top, the user can never interact with the interactive features, when the interactive features are on top, the user will never see data on the status bar when the mouse is over a feature from the interactive layer.

Is there anything that can be done or do I need to come up with a whole new solution, such as having a distinct tool for the live feed layer, so that when the tool is active, the layer is on top or something?

I'm using an app based on the SampleFlexViewer and the flex api version 2.4 (I could go up to 2.5 or 3 if required)
Tags (2)
0 Kudos
1 Reply
AbhijatC
Deactivated User
Well not answering but adding to the above stated problem. I am also using one rest service to display some layers in a single mxd. If I am using the info tool it only gives the info for one layer only. I tried all combinations of putting layer on top/bottom etc. Kindly help. A little of AS is given below:

              <esri:ArcGISDynamicMapServiceLayer
   url="http://xxx.xxx.xxx.xxx/test/rest/services/Prop_Infra_Layers/MapServer"
   fault="arcGISDynamicMSL_faultHandler(event)"
   loadError="arcGISDynamicMSL_loadErrorHandler(event)"
   updateEnd="arcGISDynamicMSL_updateEndHandler(event)"
   updateStart="arcGISDynamicMSL_updateStartHandler(event)">
   <esri:layerDefinitions>
    <!-- Layers in the order 0..x of the map service -->              
    <fx:Array>                   
     <fx:String>5</fx:String>
     <fx:String>4</fx:String>
     <fx:String>3</fx:String>
     <fx:String>2</fx:String>
     <fx:String>1</fx:String>
     <fx:String>0</fx:String>
    </fx:Array>           
   </esri:layerDefinitions>
  </esri:ArcGISDynamicMapServiceLayer>


Here I have four polygon layers (viz. layer no. 1, 2, 3, 4, 5) and one point layer (viz. layer no. 0). Using my info tool working on these feature layers, it shows info of point layer and polygon layer no.1  only. Why it doesn't work for other layers??? I know polygon layers are kept over each other but then what's the solution. Even writing a single layer in the code doesn't resolves the problem like as:

                         <esri:visibleLayers>
    <mx:ArrayCollection>
     <fx:Number>5</fx:Number>
    </mx:ArrayCollection>
   </esri:visibleLayers>
0 Kudos