[Mapserver-users] Annotations not appearing on map?

Mikeyahoo mike_5102 at yahoo.com.tw
Sat Dec 21 05:47:07 EST 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&nbsp;and =
MapServer=20
version 3.5.</FONT><FONT face=3DMingLiu>I need to put annotations in the =
map that=20
make sure&nbsp;the html can appear the word on the map,but&nbsp;my html =
doesn't=20
show the&nbsp;"text" on&nbsp;it.</FONT></DIV>
<DIV><FONT face=3DMingLiu></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu>following is my&nbsp;phtml and&nbsp;map=20
file:</FONT></DIV><FONT face=3DMingLiu>
<DIV><FONT face=3DMingLiu></FONT><BR>pon.phtml</DIV>
<DIV><FONT face=3DMingLiu></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu>&lt;?php</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu>dl('php_mapscript.so');</FONT></DIV>
<DIV>&nbsp;</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-&gt;addcolor(255,0,0);</FONT></DIV>
<DIV><FONT face=3DMingLiu>$layer =3D=20
$map-&gt;getlayerbyname(Maps);<BR>$layer-&gt;set(status,1);<BR><FONT=20
color=3D#ff0000>$layer-&gt;set(annotate,1);&nbsp; //question=20
1</FONT><BR>$rectangle=3D$map-&gt;extent;<BR>echo=20
"rect:$rectangle-&gt;maxx";<BR>$layer-&gt;querybyrect($rectangle);<BR>$cl=
ass=3D$layer-&gt;getclass(0);<BR>$Numresult=3D$layer-&gt;getNumResults();=
<BR>$layer-&gt;open($map-&gt;shapepath);<BR>echo=20
"Numresult=3D$Numresult\n";<BR>$preimage=3D$map-&gt;prepareImage();<BR>$i=
=3D1;</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu><FONT=20
color=3D#ff0000>$suce=3D$oShape-&gt;draw($map,$layer,$preimage,$resulte-&=
gt;classindex,"pon");&nbsp;=20
//question2<BR></FONT>echo "suce=3D$suce";</FONT></DIV>
<DIV><FONT face=3DMingLiu></FONT>&nbsp;</DIV>
<DIV>pon.map</DIV>
<DIV>&nbsp;</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>&nbsp; TEMPLATE tuto3.html<BR>&nbsp;=20
IMAGEPATH "/var/www/html/tmp/"<BR>&nbsp; IMAGEURL=20
"/tmp/"<BR>END<BR></FONT></DIV>
<DIV><FONT face=3DMingLiu><FONT face=3DMingLiu>LAYER<BR>&nbsp; NAME =
test<BR>&nbsp;=20
CONNECTIONTYPE postgis<BR>&nbsp; NAME Maps<BR>&nbsp; CONNECTION =
"user=3Dpostgres=20
dbname=3Dnewdb"<BR>&nbsp; DATA "shape from ogc_map"<BR>&nbsp; FILTER =
"build is not=20
NULL"<BR>&nbsp; STATUS off<BR>&nbsp; TYPE POLYGON<BR>&nbsp; LABELCACHE=20
ON<BR>&nbsp; LABELITEM "build"<BR>&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; =
COLOR 0 255=20
255<BR>&nbsp;&nbsp;&nbsp; OUTLINECOLOR 0 0 0<BR>&nbsp;&nbsp;&nbsp;=20
LABEL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE=20
TRUETYPE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS=20
TRUE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WRAP "=20
"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FONT=20
chinese<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE=20
9<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0 0<BR>&nbsp;&nbsp;&nbsp;=20
END<BR>&nbsp;&nbsp;&nbsp; TEMPLATE "mcd90py2.html"<BR>&nbsp; =
END<BR>&nbsp;=20
CLASS<BR>&nbsp;&nbsp;&nbsp; COLOR 255 255 255<BR>&nbsp;&nbsp;&nbsp; =
OUTLINECOLOR=20
0 0 0<BR>&nbsp;&nbsp;&nbsp; LABEL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE =

TRUETYPE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS=20
TRUE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WRAP "=20
"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FONT=20
chinese<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE=20
9<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0 0<BR>&nbsp;&nbsp;&nbsp;=20
END<BR>&nbsp;&nbsp;&nbsp; TEMPLATE "mcd90py2.html"<BR>&nbsp;=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()"&nbsp;.Is any problems in this=20
description:</FONT></DIV>
<DIV><FONT size=3D3><FONT=20
color=3D#ff0000>$layer-&gt;set(annotate,1);</FONT></FONT></DIV>
<DIV><FONT size=3D3></FONT>&nbsp;</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-&gt;<FONT=20
color=3D#ff0000>draw($map,$layer,$preimage,$resulte-&gt;classindex,"pon")=
;</FONT></FONT></DIV>
<DIV><FONT color=3D#ff0000 size=3D3></FONT>&nbsp;</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