Opened 20 years ago

Closed 19 years ago

#804 closed defect (fixed)

SWF multiple output, ElementSelected when a layer is off

Reported by: assefa Owned by: mapserverbugs
Priority: high Milestone:
Component: Output-SWF Version: 4.3
Severity: normal Keywords:
Cc: bluecarto@…

Description

original message from :


I'm just trying to implement the flash output and I gotta some problems using 
the multiple one.

1 - Imagine you've got a mapfile with two layers :

-----------------------
LAYER
NAME layer1
TYPE POLYGON
DATA "layer1.shp"
CLASS
  ...
END
METADATA
  "SWFDUMPATTRIBUTES" "LAYER1_FIELD"
END
END

LAYER
NAME layer2
TYPE POLYGON
DATA "layer2.shp"
CLASS
  ...
END
METADATA
  "SWFDUMPATTRIBUTES" "LAYER2_FIELD"
END
END
---------------------

If I use the multiple output, Mapserver renders a main swf movie 
(file_name.swf)
that contains a mapObj object with many variables in it, and a movie for each
layer (file_name_layer_0.swf, file_name_layer_1.swf). I am developping an
interface that can return infos when the mouse rolls over elements (shapes). 
This works well in this configuration.
mapObj.layers contains 2 objects, one for each layer with variables like 
fullname, name, relativename, etc ...

2 - Now imagine you add a MAXSCALE to the first one (layer1) that prevent it 
to be rendered.
Mapserver generates the parent movie (file_name.swf) and only one child movie 
(file_name_layer_0.swf).
Here is the mapObj object returned (in the parent movie) :
----------------
mapObj
.layers
  .0
    .fullname : "/var/www/.../file_name_layer_0.swf"
    .name : "layer1"
    .relativename : "file_name_layer_0.swf"
    .type : "2"
.name : "MYMAP"
.numlayers : 2
---------------
First of all, this may not be correct. There are 2 layers in the mapfile.
Logicaly only one is rendered. But the one that is included in mapObj is not 
the
right one.
Following would probably be better :
----------------
mapObj
.layers
  .0
    .fullname : undefined
    .name : "layer1"
    .relativename : undefined
    .type : "2"
  .1
    .fullname : "/var/www/.../file_name_layer_0.swf"
    .name : "layer2"
    .relativename : "file_name_layer_0.swf"
    .type : "2"
.name : "MYMAP"
.numlayers : 2
---------------

3 -The main problem rise up when trying to use the AScript "ElementSelected" 
function. Its first argument returned is the "layerId". It corresponds to the 
layer order in the mapfile. In the second example, when rolling over a shape 
of layer2 (the only one visible), "layerId" is equal to "1" (second layer in 
the mapfile). But there is no data relative to it in "mapObj.layers".

The example of maxscale value is one among many others. The problem obviously
appears as well when layer status is dynamically set to off.

4 - Is this a bug ? Is there any other way to get the attributes corresponding 
to the layer the mouse is rolling over ? Am I missing something ?

Change History (2)

comment:1 by bluecarto@…, 20 years ago

Cc: bluecarto@… added

comment:2 by assefa, 19 years ago

Resolution: fixed
Status: newclosed
Fixed as decribed in Bug description : layers that are not drawn for some 
reason will be outputted like :

 mapObj
.layers
  .0
    .name : "layer1"
    .type : "2"
    .fullname : undefined
    .relativename : undefined

 Marking it as Fixed.
    
Note: See TracTickets for help on using tickets.