[mapserver-users] MapScript -> flash output

Jan Hartmann jhart at frw.uva.nl
Thu May 2 10:09:29 EDT 2002


I have experimented with Flash output for MapServer using Ming and
PHP-MapScript. Basically there seem to be three possibilities:

1) Generate a mapfile (PNG or JPG) and convert it to SWF. You can use the
Ming routines within PHP. Ming only supports JPG, which as a rule is not
very suitable for maps. PNG files first have to be converted to something
called DBL (DefineBitsLossless) format; a conversion program is in the Util
directory of the Ming distribution. It is slow, but it works.
Much faster is incorporating SWF output directly into MapServer, linking it
with the Ming C-library. I replaced the call to gdImageJpeg in maputil.c
with my own subroutines (hacked together from Ming and GD source code), so
now my version of MapServer outputs SWF when it thinks it is generating JPG.
This also works with the CGI version. Of course this is just a hack: a full
implemetation of SWF output within MapServer would require adding code for
an additional output type and embedding it in configure/make for both Unix
and Windows (my source tree is Windows only). I don't have enough experience
with the internals of Mapserver for this, but if anyone of the MS developers
would care to implement this, I would be glad to contribute my conversion
code.

2) Read out the coordinate values of the ShapeObjects (see
http://mapserver.gis.umn.edu/wilma/mapserver-users/0204/msg00559.html how
to). You can use these coordinates to generate an SWF-file with Ming
server-side, or send them in some kind of ASCII-format (e.g. XML) to the
browser and handle them there with ActionScript. This is not suitable for
complete maps, but for individual items, such as point or query layers, you
can get very nice results, even animated ones. For final results you can use
a combination of bitmap and vector outputs.

3) Ideally, MapServer should be able to produce vector output directly in
formats like SVG, GML or Flash SWF. There has  been some discussion on this
list, including a posting by Steve Lime last year that GML output would be
available soon (
http://mapserver.gis.umn.edu/wilma/mapserver-users/0108/msg00249.html ), but
I don't know how far thing have moved forward by now.  I would appreciate
some information on this.


Jan Hartmann
Department of Geography
University of Amsterdam
jhart at frw.uva.nl


-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu]On Behalf Of Enrique
Motilla
Sent: Thursday, May 02, 2002 5:14 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [mapserver-users] MapScript -> flash output


Hello,

My name is Enrique, I would like to implement a Flash (from Macromedia)
output to the MapScript from a php script, probably using a library such as
ming or freemovie. I think there are two ways to do it, either get the
Layer, Shape, Line and Point Objects within a PHP script (which by the way I
have no clue -apart from the point object- of how to get it) and from those
objects generate the map output as an interactive animation (SWF file). A
second option which would be faster and more reliable would be to make an
additional Drawing function using the ming library within the mapServer, but
so far I have no experience with the internals of MapServer and would
appreciate feedback in people willing to do this.

The goal of doing this is just to enhance the mapping experience by panning,
zooming and so using the flexibility of flash (so far I have made a map to
zoom and pan with no HTML refresh, and XML-RPC connections, but now I would
like to use MapServer as the platform in the backend).

if you want to see an excellent example of mapping using this output take a
look into: www.geofactory.com
ming -> tool for generating SWF files from a php script:
http://opaque.net/ming/index.html

Hence, if anyone interested in giving a boost to the output of the MapServer
either from MapScripting or directly from inside MapServer code, then it
would be great. I'd be glad to share my experience as ActionScript
programmer to make this an very nice way to interact with MapServer.

Kindest regards from the sunny Mexico,

E
----
Enrique Motilla Moreno, MSc. Log.
emotilla at ipicyt.edu.mx
Departamento de Matemáticas Aplicadas y Sistemas Computacionales,
Instituto Potosino de Investigación Científica y Tecnológica, A.C.
Av. Venustiano Carranza #2425-A
Col. Lomas, C.P. 78210
San Luis Potosi, S.L.P.
MEXICO
t: +52 (444) 833 5411 ext 2043
f: +52 (444) 833 5412





More information about the mapserver-users mailing list