SWF viewer: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
Line 19: Line 19:


On my TSL 2.2 Linux system, I had to add the bison and libungif-devel rpm packages to get ming to compile. I had to install libungif on the target server.
On my TSL 2.2 Linux system, I had to add the bison and libungif-devel rpm packages to get ming to compile. I had to install libungif on the target server.
==Mapserver build notes==


Once I had the php module installed correctly I created this
Once I had the php module installed correctly I created this
[http://mapserver.wildsong.biz/swf/simple.php simple SWF example] as a test.
[http://mapserver.wildsong.biz/swf/simple.php simple SWF example] as a test.
More test samples are on the [[PHP/SWF tests]] page.
More test samples are on the [[PHP/SWF tests]] page.
==Mapserver build notes==


Mapserver can generate SWF files directly, if you have compiled it with
Mapserver can generate SWF files directly, if you have compiled it with

Revision as of 00:13, 2 November 2005

What does it take to build a simple SWF (Flash) based vector map viewer? (As opposed to plain html+javascript or java.)

Depends on what you mean by a "SWF-based map viewer".

There are two ways to think about using SWF with a mapserver. The first obvious way (to me) is that the imagemap portion of the page is generated as a SWF file, meaning that the map itself can be animated. For example, you can support very nice zoom and pan operations.

The second way is to use mapserver to generate static image files in png or jpeg format, and to use SWF in the user interface. That way you can support things like fancy rollover buttons.

An aside: there is actually a scripting language embedded in Flash called actionscript. Actionscript is just a subset of javascript (or both are subsets of ecmascript if you prefer). Therefore, if you are a happy javascript programmer you can quickly adapt your skills to actionscript.

To create the user interface you can build the page with Dreamweaver; or you could use the PHP SWF extension or the external Ming library for PHP, and write PHP code to generate the SWF page. Or you can combine them.

Since I don't have Dreamweaver access at the moment I am working with ming.

Ming build notes

I built ming as a loadable extension for PHP (which is easier than building a new version of php.) Current ming is 0.3beta1 and php is 4.4.0.

On my TSL 2.2 Linux system, I had to add the bison and libungif-devel rpm packages to get ming to compile. I had to install libungif on the target server.

Once I had the php module installed correctly I created this simple SWF example as a test. More test samples are on the PHP/SWF tests page.

Mapserver build notes

Mapserver can generate SWF files directly, if you have compiled it with support for the ming library. So next I rebuilt mapserver with the added command line option to 'configure': --with-ming

Then I revamped my City of Corvallis simple example yet again to generate SWF output instead of png. Or rather, I will do that on Tuesday next week after I figure out why the compile of mapserver dies now! Botheration! Fuss fuss.

Links

PHP reference for ming

I like the simple user interface on this server: http://www.downtownbethesda.com/

Layers turn on and off at different scales, there are basically no controls; just pan and zoom. Pan by dragging, and zoom with slider or scroll wheel.