PHP MapScript / dynamic points from MySQL / possible to query?

Dylan Beaudette dylan at IICI.NO-IP.ORG
Wed Jul 20 00:15:33 EDT 2005


Pete,

Are there any examples of this on the web? Also, is there any way to 
use javascript to bring up information on features in the returned 
images- i.e. with some sort of image map?

thanks!

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341


On Jul 19, 2005, at 9:53 AM, Peter Giencke wrote:

> Jeff,
>
> One idea is by writing those points to a javascript array, you could
> implement a js function to access the array (via mouseclick or 
> whatever) and
> present the data in any number of ways. You could keep your code 
> relatively
> intact for this by having the php write all the javascript necessary 
> for
> this.
>
> -pete
>
> Pete Giencke
> Data and Information Management
> Great Lakes Commission
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] 
> On
> Behalf Of Geoff Rowland
> Sent: Tuesday, July 19, 2005 12:36 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] PHP MapScript / dynamic points from 
> MySQL /
> possible to query?
>
> 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