[Mapserver-users] Mapserver and flash

Yewondwossen Assefa assefa at dmsolutions.ca
Tue Aug 19 11:22:31 EDT 2003


The way to do it is to use at a layer level a metadata called 
SWFDUMPATTRIBUTES. The value used for this metadata are the names of the 
attributes you want to export to the swf file. Please refer to section 
"How to configure the map file to export attributes"  and "Events and 
Highlights" in the document 
http://www2.dmsolutions.ca/mapserver/dl/FlashMapserverUserDoc.html

  Once the attributes are exported to the swf file, when the user clicks 
on these objects, there is a mouse event which is triggered and makes an 
Action Script call to: _root.ElementSelecetd(LayerId, ShapeId, Event). 
The Flash application who want to receive these events should define the 
function ElementSelected and use the information receive to do actions 
like retrieving the attribute values from the specific SWF for the 
specified shape and display it.


Later,

Geoffrey Rowland wrote:
> I was playing around with this a bit the other day.  Is there a way to 
> identify features in the swf file?  for example if I am displaying a 
> county layer (from a shapefile), and I want to get the names of the 
> counties....is that possible using the swf output?
> 
> Thanks,
> Geoff
> 
> 
> William A. Bronsema, C.E.T. wrote:
> 
>> Lars-Göran,
>>
>> It is fairly easy to view the SWF output using actionscript.  Set the 
>> outputformat in the map file to the following:
>>
>>   OUTPUTFORMAT
>>     NAME swf
>>     MIMETYPE "application/x-shockwave-flash"
>>     DRIVER swf
>>     IMAGEMODE PC256
>>
>>     # the following line is used to output all layers in one swf
>>     FORMATOPTION "OUTPUT_MOVIE=SINGLE"
>>
>>     # the following line is used to output all layers individually
>>     #FORMATOPTION "OUTPUT_MOVIE=MULTIPLE"
>>   END
>>
>>
>> After mapserver has generated the temp swf file(s) you can use the 
>> "loadMovie" actionscript function to load the swf file into a 
>> pre-existing container.  For example, create a new swf file with a 
>> movie clip called "clip1" and add the following line in actionscript:
>>
>> loadMovie ( "http://url/to/swf/mymap.swf", "clip1" );
>>
>> I use PHP and php_mapscript to help manage the files on the fly and 
>> Flash to manage my actionscript.
>>
>> I hope this quick overview helps.
>>
>> Regards,
>> Bill
>>
>> Lars-goran Edholm wrote:
>>
>>> Hi!
>>> Does anybody have an example of using Mapserver with swf vector output.
>>> How do i use the swf-actionscript file to view the layers?
>>>
>>>
>>>  Mvh
>>> Lars-Göran Edholm    tel 026/24 14 36
>>> 1:e byggnadsinspektör
>>> Bygg- och miljökontoret
>>> 811 80 Sandviken
>>> lars-goran.edholm at sandviken.se
>>>
>>>
>>> _______________________________________________
>>> Mapserver-users mailing list
>>> Mapserver-users at lists.gis.umn.edu
>>> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>>>
>>
>>
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------






More information about the mapserver-users mailing list