[Mapserver-users] SWF problem
Hau Lu
hau.lu at msa.hinet.net
Sun May 9 08:03:31 PDT 2004
This is a multi-part message in MIME format.
------=_NextPart_000_0003_01C43619.D96F0330
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Dear List user:
I'm trying to use Mapserver (using the Windows binary ms402_png_pg.zip
provided on the mapserver download site which should support SWF output) to
output swf files that I can load from a Flash app ( using loadMovie(..)
function).
part of my php code looks like this:
......Initialize $map object
$map->selectOutputFormat("SWF");
$image = $map->draw();
$image_url=$map->saveWebImage(); // error occurs here
.....output the $image_url var to Flash app
and the map file looks like this (it's actually one of the example map files
from the tutorial):
MAP
IMAGETYPE JPEG
INTERLACE OFF
EXTENT 201621.496941 -294488.284025 1425518.020722 498254.511514
SIZE 400 300
SHAPEPATH "data"
IMAGECOLOR 255 255 255
OUTPUTFORMAT
NAME swf
MIMETYPE "application/x-shockwave-flash"
DRIVER swf
IMAGEMODE PC256
FORMATOPTION "OUTPUT_MOVIE=SINGLE"
END
WEB
IMAGEPATH "C:/Apache/htdocs/tmp/"
IMAGEURL "/tmp/"
MAXSCALE 150000000
MINSCALE 200
END
PROJECTION
"proj=laea"
"ellps=clrk66"
"lat_0=45"
"lon_0=-100"
END
# Start of LAYER DEFINITIONS ---------------------------------------------
LAYER # States polygon layer begins here
NAME states_poly
DATA states_ugl
STATUS DEFAULT
TYPE POLYGON
PROJECTION
"init=epsg:4326"
END
CLASS
COLOR 232 232 232
END
END # States polygon layer ends here
LAYER # States line layer begins here
NAME states_line
DATA states_ugl
STATUS DEFAULT
TYPE LINE
PROJECTION
"init=epsg:4326"
END
CLASS
COLOR 32 32 32
END
END # States line layer ends here
# End of LAYER DEFINITIONS -------------------------------
END # end of map file
I get the following error :
"PHP Fatal error: Failed writing image to
C:/Apache/htdocs/tmp/108411324937081.swf ....."
when the Flash app tries to call the php program, the SWF file is created
with properly content (viewable in a stanalone flash player) in the
designated directory but the PHP program just stopped without responding to
the Flash app. Using the same code, I can output JPEG images to the Flash
app without any problem. I've also tried to output the SWF from mapserv.exe
using CGI calls but that also failed.
Searching through the list archive, I found some people having the same
problem that I have but there's no answer. I've read the user doc at
http://www2.dmsolutions.ca/mapserver/dl/FlashMapserverUserDoc.html but don't
have a clue on what I did wrong, can anybody give me a hand here?
Best Regards,
Hau
------=_NextPart_000_0003_01C43619.D96F0330
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>Dear List=20
user:</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004> =20
I'm trying to use Mapserver (using the Windows binary ms402_png_pg.zip =
provided=20
on the mapserver download site which should support SWF output) to =
output swf=20
files that I can load from a Flash app ( using loadMovie(..)=20
function).</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>part of my php code=20
looks like this:</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>......Initialize $map=20
object</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004>$map->selectOutputFormat("SWF");</SPAN></FO=
NT><FONT=20
face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004><BR>$image =3D=20
$map->draw();<BR>$image_url=3D$map->saveWebImage(); // error =
occurs=20
here</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>.....output the=20
$image_url var to Flash app</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>and the map file=20
looks like this (it's actually one of the example map files from the=20
tutorial):</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>MAP<BR>IMAGETYPE=20
JPEG<BR>INTERLACE =
OFF<BR>EXTENT =20
201621.496941 -294488.284025 1425518.020722=20
498254.511514<BR>SIZE &nbs=
p; =20
400 300<BR>SHAPEPATH =20
"data"<BR>IMAGECOLOR 255 255 =
255</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>OUTPUTFORMAT=20
<BR> NAME swf <BR> MIMETYPE "application/x-shockwave-flash"=20
<BR> DRIVER swf <BR> IMAGEMODE PC256 <BR> FORMATOPTION=20
"OUTPUT_MOVIE=3DSINGLE" <BR>END </SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004>WEB<BR> IMAGEPATH=20
"C:/Apache/htdocs/tmp/"<BR> IMAGEURL "/tmp/"<BR> MAXSCALE=20
150000000<BR> MINSCALE 200<BR>END</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>PROJECTION<BR> =20
"proj=3Dlaea"<BR> "ellps=3Dclrk66"<BR> =
"lat_0=3D45"<BR> =20
"lon_0=3D-100"<BR>END</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004># Start of LAYER=20
DEFINITIONS ---------------------------------------------<BR>LAYER # =
States=20
polygon layer begins here<BR> =20
NAME =
states_poly<BR> =20
DATA =
states_ugl<BR> =20
STATUS DEFAULT<BR> =20
TYPE =
POLYGON</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004> =20
PROJECTION<BR> "init=3Depsg:4326"<BR> =20
END</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004> =20
CLASS<BR> COLOR 232 232=20
232<BR> END<BR>END # States polygon layer ends =
here</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>LAYER # States line=20
layer begins here<BR> =
NAME =20
states_line<BR> =
DATA =20
states_ugl<BR> STATUS =20
DEFAULT<BR> TYPE =20
LINE</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004> =20
PROJECTION<BR> "init=3Depsg:4326"<BR> =20
END</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004> =20
CLASS<BR> COLOR 32 32 32<BR> END<BR>END # States =
line=20
layer ends here<BR># End of LAYER DEFINITIONS=20
-------------------------------</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>END # end of map=20
file<BR></SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT><FONT=20
face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>I get the following=20
error :</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004> =20
"</SPAN></FONT><FONT face=3D新細明體 =
size=3D2><SPAN class=3D212195413-09052004><FONT=20
size=3D3><FONT size=3D2>PHP Fatal error: Failed writing image to=20
C:/Apache/htdocs/tmp/108411324937081.swf .....</FONT></FONT><FONT=20
size=3D2>"</FONT></SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT><FONT=20
face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004><FONT size=3D2>when the Flash app=20
tries to call the php program, the SWF file is created with properly =
content=20
(viewable in a stanalone flash player) in the designated directory but =
the PHP=20
program just stopped without responding to the Flash app. Using the same =
code, I=20
can output JPEG images to the Flash app without any problem. I've also =
tried to=20
output the SWF from mapserv.exe using CGI calls but that also=20
failed.</FONT></SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT><FONT=20
face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004><FONT size=3D2>Searching through=20
the list archive, I found some people having the same problem that =
I have=20
but there's no answer. I've read the user doc at <A=20
href=3D"http://www2.dmsolutions.ca/mapserver/dl/FlashMapserverUserDoc.htm=
l">http://www2.dmsolutions.ca/mapserver/dl/FlashMapserverUserDoc.html</A>=
but=20
don't have a clue on what I did wrong, can anybody give me a hand=20
here?</FONT></SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN =
class=3D212195413-09052004>Best=20
Regards,</SPAN></FONT></DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT> </DIV>
<DIV><FONT face=3D新細明體 size=3D2><SPAN=20
class=3D212195413-09052004>Hau</SPAN></FONT></DIV></BODY></HTML>
------=_NextPart_000_0003_01C43619.D96F0330--
More information about the MapServer-users
mailing list