PHP MapScript / dynamic points from MySQL / possible to query?
Geoff Rowland
geoffrey.rowland at NOAA.GOV
Tue Jul 19 09:36:02 PDT 2005
I am pulling some lat/lon coordinates out of a database and drawing them
on a map using code like this (not sure if this is really the best way,
but it's the code I came up with, heh)
$map= ms_newMapObj('world.map');
$layer = $map->getLayerByName('alerts');
for ($j=0; $j < mysql_num_rows($result); $j++)
{
$row = mysql_fetch_assoc($result);
${$pt} = ms_newPointObj();
${$pt}->setXY($row[lat],$row[lon]);
${$pt}->draw($map, $layer, $img, 0 ,$row[location]);
}
$url = $img->saveWebImage();
works great. However I really want to make it so that when a user
clicks on the point, information about the point will come up. I assume
this is not possible with the way I currently have this setup, is that
correct? What would be the best way to go about doing this?
Cheers,
Geoff
--
Geoffrey Rowland
Technical Officer
Climate Information Project
NOAA Research
Office of Global Programs
http://www.cip.noaa.gov
http://www.ranetproject.net
Contractor,
RGII Technologies, Inc., a Computer Horizons Company
http://www.rg2.com
Phone: 301-427-2344
Fax : 301-427-2082
geoffrey.rowland at noaa.gov
More information about the MapServer-users
mailing list