[Mapserver-users] SWF problem

Hau Lu hau.lu at msa.hinet.net
Sun May 9 11:03:31 EDT 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&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>Dear List=20
user:</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>&nbsp;&nbsp;&nbsp;=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&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>part of my php code=20
looks like this:</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>......Initialize $map=20
object</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004>$map-&gt;selectOutputFormat("SWF");</SPAN></FO=
NT><FONT=20
face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004><BR>$image =3D=20
$map-&gt;draw();<BR>$image_url=3D$map-&gt;saveWebImage(); // error =
occurs=20
here</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>.....output the=20
$image_url var to Flash app</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; 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&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>MAP<BR>IMAGETYPE=20
JPEG<BR>INTERLACE =
OFF<BR>EXTENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
201621.496941 -294488.284025 1425518.020722=20
498254.511514<BR>SIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
400 300<BR>SHAPEPATH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
"data"<BR>IMAGECOLOR&nbsp;&nbsp;&nbsp;&nbsp; 255 255 =
255</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>OUTPUTFORMAT=20
<BR>&nbsp;NAME swf <BR>&nbsp;MIMETYPE "application/x-shockwave-flash"=20
<BR>&nbsp;DRIVER swf <BR>&nbsp;IMAGEMODE PC256 <BR>&nbsp;FORMATOPTION=20
"OUTPUT_MOVIE=3DSINGLE" <BR>END </SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004>WEB<BR>&nbsp;IMAGEPATH=20
"C:/Apache/htdocs/tmp/"<BR>&nbsp;IMAGEURL "/tmp/"<BR>&nbsp;MAXSCALE=20
150000000<BR>&nbsp;MINSCALE 200<BR>END</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>PROJECTION<BR>&nbsp;=20
"proj=3Dlaea"<BR>&nbsp; "ellps=3Dclrk66"<BR>&nbsp; =
"lat_0=3D45"<BR>&nbsp;=20
"lon_0=3D-100"<BR>END</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004># Start of LAYER=20
DEFINITIONS ---------------------------------------------<BR>LAYER # =
States=20
polygon layer begins here<BR>&nbsp;=20
NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
states_poly<BR>&nbsp;=20
DATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
states_ugl<BR>&nbsp;=20
STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DEFAULT<BR>&nbsp;=20
TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
POLYGON</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>&nbsp;=20
PROJECTION<BR>&nbsp;&nbsp;&nbsp; "init=3Depsg:4326"<BR>&nbsp;=20
END</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>&nbsp;=20
CLASS<BR>&nbsp;&nbsp;&nbsp; COLOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 232 232=20
232<BR>&nbsp; END<BR>END # States polygon layer ends =
here</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>LAYER # States line=20
layer begins here<BR>&nbsp; =
NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
states_line<BR>&nbsp; =
DATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
states_ugl<BR>&nbsp; STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
DEFAULT<BR>&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
LINE</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>&nbsp;=20
PROJECTION<BR>&nbsp;&nbsp;&nbsp; "init=3Depsg:4326"<BR>&nbsp;=20
END</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>&nbsp;=20
CLASS<BR>&nbsp;&nbsp;&nbsp; COLOR 32 32 32<BR>&nbsp; END<BR>END # States =
line=20
layer ends here<BR># End of LAYER DEFINITIONS=20
-------------------------------</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>END # end of map=20
file<BR></SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT><FONT=20
face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>I get the following=20
error :</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>&nbsp;&nbsp;&nbsp;=20
"</SPAN></FONT><FONT face=3D&#26032;&#32048;&#26126;&#39636; =
size=3D2><SPAN class=3D212195413-09052004><FONT=20
size=3D3><FONT size=3D2>PHP Fatal error:&nbsp; 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&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT><FONT=20
face=3D&#26032;&#32048;&#26126;&#39636; 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&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004></SPAN></FONT><FONT=20
face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004><FONT size=3D2>Searching through=20
the list archive, I&nbsp;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>=
&nbsp;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&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN =
class=3D212195413-09052004>Best=20
Regards,</SPAN></FONT></DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; size=3D2><SPAN=20
class=3D212195413-09052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#26032;&#32048;&#26126;&#39636; 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