[Mapserver-users] Annotations not appearing on map?
Mikeyahoo
mike_5102 at yahoo.com.tw
Sat Dec 21 02:47:07 PST 2002
This is a multi-part message in MIME format.
------=_NextPart_000_0029_01C2A921.5D04B640
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable
Hello all,
I have PHP ver4.0.6 and MapServer version 3.5.I need to put annotations =
in the map that make sure the html can appear the word on the map,but my =
html doesn't show the "text" on it.
following is my phtml and map file:
pon.phtml
<?php
dl('php_mapscript.so');
$val_zsize=3D3;
$check_pan=3D"CHECKED";
$map_path=3D"/var/www/html/";
$map_file=3D"pon.map";
$map =3D ms_newMapObj($map_path.$map_file);
$color=3D $map->addcolor(255,0,0);
$layer =3D $map->getlayerbyname(Maps);
$layer->set(status,1);
$layer->set(annotate,1); //question 1
$rectangle=3D$map->extent;
echo "rect:$rectangle->maxx";
$layer->querybyrect($rectangle);
$class=3D$layer->getclass(0);
$Numresult=3D$layer->getNumResults();
$layer->open($map->shapepath);
echo "Numresult=3D$Numresult\n";
$preimage=3D$map->prepareImage();
$i=3D1;
$suce=3D$oShape->draw($map,$layer,$preimage,$resulte->classindex,"pon"); =
//question2
echo "suce=3D$suce";
pon.map
NAME EX3
SIZE 500 400
EXTENT 208385 2672226 209810 2673639
FONTSET /var/www/html/fonts.list
UNITS meters
IMAGECOLOR 255 255 255
IMAGETYPE PNG
WEB
TEMPLATE tuto3.html
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
END
LAYER
NAME test
CONNECTIONTYPE postgis
NAME Maps
CONNECTION "user=3Dpostgres dbname=3Dnewdb"
DATA "shape from ogc_map"
FILTER "build is not NULL"
STATUS off
TYPE POLYGON
LABELCACHE ON
LABELITEM "build"
CLASS
COLOR 0 255 255
OUTLINECOLOR 0 0 0
LABEL
TYPE TRUETYPE
ANTIALIAS TRUE
WRAP " "
FONT chinese
SIZE 9
COLOR 0 0 0
END
TEMPLATE "mcd90py2.html"
END
CLASS
COLOR 255 255 255
OUTLINECOLOR 0 0 0
LABEL
TYPE TRUETYPE
ANTIALIAS TRUE
WRAP " "
FONT chinese
SIZE 9
COLOR 0 0 0
END
TEMPLATE "mcd90py2.html"
END
END
question 1
the layerObj have the member "int status" and "int annotate" and the =
method "int set()" .Is any problems in this description:
$layer->set(annotate,1);
question 2
I try to call the draw() method to show the text "pon" on the map.Is =
anything wrong in this description:
$suce=3D$oShape->draw($map,$layer,$preimage,$resulte->classindex,"pon");
thanks for your response!
------=_NextPart_000_0029_01C2A921.5D04B640
Content-Type: text/html;
charset="big5"
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=3Dbig5">
<META content=3D"MSHTML 5.50.4134.100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DMingLiu>Hello all,<BR>I have PHP ver4.0.6 and =
MapServer=20
version 3.5.</FONT><FONT face=3DMingLiu>I need to put annotations in the =
map that=20
make sure the html can appear the word on the map,but my html =
doesn't=20
show the "text" on it.</FONT></DIV>
<DIV><FONT face=3DMingLiu></FONT> </DIV>
<DIV><FONT face=3DMingLiu>following is my phtml and map=20
file:</FONT></DIV><FONT face=3DMingLiu>
<DIV><FONT face=3DMingLiu></FONT><BR>pon.phtml</DIV>
<DIV><FONT face=3DMingLiu></FONT> </DIV>
<DIV><FONT face=3DMingLiu><?php</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT> </DIV>
<DIV><FONT face=3DMingLiu>dl('php_mapscript.so');</FONT></DIV>
<DIV> </DIV>
<DIV><FONT=20
face=3DMingLiu>$val_zsize=3D3;<BR>$check_pan=3D"CHECKED";<BR>$map_path=3D=
"/var/www/html/";<BR>$map_file=3D"pon.map";<BR>$map=20
=3D ms_newMapObj($map_path.$map_file);<BR>$color=3D=20
$map->addcolor(255,0,0);</FONT></DIV>
<DIV><FONT face=3DMingLiu>$layer =3D=20
$map->getlayerbyname(Maps);<BR>$layer->set(status,1);<BR><FONT=20
color=3D#ff0000>$layer->set(annotate,1); //question=20
1</FONT><BR>$rectangle=3D$map->extent;<BR>echo=20
"rect:$rectangle->maxx";<BR>$layer->querybyrect($rectangle);<BR>$cl=
ass=3D$layer->getclass(0);<BR>$Numresult=3D$layer->getNumResults();=
<BR>$layer->open($map->shapepath);<BR>echo=20
"Numresult=3D$Numresult\n";<BR>$preimage=3D$map->prepareImage();<BR>$i=
=3D1;</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT> </DIV>
<DIV><FONT face=3DMingLiu><FONT=20
color=3D#ff0000>$suce=3D$oShape->draw($map,$layer,$preimage,$resulte-&=
gt;classindex,"pon"); =20
//question2<BR></FONT>echo "suce=3D$suce";</FONT></DIV>
<DIV><FONT face=3DMingLiu></FONT> </DIV>
<DIV>pon.map</DIV>
<DIV> </DIV>
<DIV><FONT face=3DMingLiu>NAME EX3<BR>SIZE 500 400<BR>EXTENT 208385 =
2672226 209810=20
2673639<BR>FONTSET /var/www/html/fonts.list<BR>UNITS =
meters<BR>IMAGECOLOR 255=20
255 255<BR>IMAGETYPE PNG<BR>WEB<BR> TEMPLATE tuto3.html<BR> =20
IMAGEPATH "/var/www/html/tmp/"<BR> IMAGEURL=20
"/tmp/"<BR>END<BR></FONT></DIV>
<DIV><FONT face=3DMingLiu><FONT face=3DMingLiu>LAYER<BR> NAME =
test<BR> =20
CONNECTIONTYPE postgis<BR> NAME Maps<BR> CONNECTION =
"user=3Dpostgres=20
dbname=3Dnewdb"<BR> DATA "shape from ogc_map"<BR> FILTER =
"build is not=20
NULL"<BR> STATUS off<BR> TYPE POLYGON<BR> LABELCACHE=20
ON<BR> LABELITEM "build"<BR> CLASS<BR> =
COLOR 0 255=20
255<BR> OUTLINECOLOR 0 0 0<BR> =20
LABEL<BR> TYPE=20
TRUETYPE<BR> ANTIALIAS=20
TRUE<BR> WRAP "=20
"<BR> FONT=20
chinese<BR> SIZE=20
9<BR> COLOR 0 0 0<BR> =20
END<BR> TEMPLATE "mcd90py2.html"<BR> =
END<BR> =20
CLASS<BR> COLOR 255 255 255<BR> =
OUTLINECOLOR=20
0 0 0<BR> LABEL<BR> TYPE =
TRUETYPE<BR> ANTIALIAS=20
TRUE<BR> WRAP "=20
"<BR> FONT=20
chinese<BR> SIZE=20
9<BR> COLOR 0 0 0<BR> =20
END<BR> TEMPLATE "mcd90py2.html"<BR> =20
END<BR>END</FONT></FONT></DIV><FONT face=3DMingLiu size=3D2>
<DIV><BR><FONT color=3D#ff0000 size=3D3>question 1</FONT></DIV>
<DIV><FONT size=3D3>the layerObj have the member "int status" and "int =
annotate"=20
and the method "int set()" .Is any problems in this=20
description:</FONT></DIV>
<DIV><FONT size=3D3><FONT=20
color=3D#ff0000>$layer->set(annotate,1);</FONT></FONT></DIV>
<DIV><FONT size=3D3></FONT> </DIV>
<DIV><FONT color=3D#ff0000 size=3D3>question 2</FONT></DIV>
<DIV><FONT size=3D3>I try to call the draw() method to show the text =
"pon" on the=20
map.Is anything wrong in this description:</FONT></DIV>
<DIV><FONT size=3D3>$suce=3D$oShape-><FONT=20
color=3D#ff0000>draw($map,$layer,$preimage,$resulte->classindex,"pon")=
;</FONT></FONT></DIV>
<DIV><FONT color=3D#ff0000 size=3D3></FONT> </DIV>
<DIV><FONT size=3D3>thanks for your=20
response!</FONT></DIV></FONT></FONT></BODY></HTML>
------=_NextPart_000_0029_01C2A921.5D04B640--
-----------------------------------------------------------------
< ¨C¤Ñ³£ Yahoo!©_¼¯ > www.yahoo.com.tw
More information about the MapServer-users
mailing list