displaying multiple points from database using phpmapscript
Your Name
waste at SHAZ-BOT.COM
Thu Jun 2 07:58:57 PDT 2005
Hello All,
Not sure if I am doing this correctly. I have a database with x,y
coordinates (pixel format) stored in it (mysql, not using the gis
extensions). I use php to get a list of those coordinates and I want to
display them all at once. However it appears to only draw 1 set of
coordinates. I am new to MapServer and somewhat to PHP so perhaps my
logic is wrong. Here is a code sample:
for ($j=0; $j < mysql_num_rows($reStation); $j++)
{
$row = mysql_fetch_assoc($reStation);
// convert pixel to geocoded
$map_pt = click2map($row["x"],$row["y"],$map->extent);
//Create the point
$pt = ms_newPointObj();
$pt-> setXY($map_pt[0],$map_pt[1]);
$img = $map->draw();
$layer = $map->getLayerByName('POINTLOC');
$pt->draw($map, $layer, $img, 0 ,'yuhuu');
}
$url = $img->saveWebImage();
I have a feeling my logic is wrong.
here is what the POINTLOC layer looks like (if that makes a
difference...but i think my php may be wrong)
NAME "POINTLOC"
TYPE POINT
STATUS ON
CLASS
NAME "0"
STYLE
COLOR 255 0 0
MAXSIZE 300
SYMBOL 'rect'
SIZE 10
END #style
END #class
END #layer
More information about the MapServer-users
mailing list