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

Peter Giencke pgiencke at GLC.ORG
Wed Jul 20 06:35:05 PDT 2005


Dylan,

With regards to using mapserver for this, I have no specific examples. I did
manage to dig up a a php|mysql|js example which illustrates how to do this
(you would be using an array and a parsing function + onclick event, not
options), which is here
http://forums.devshed.com/archive/t-7293/PHP-and-drop-down-menus. I have a
few examples of php->js from my own web-mapping work, but that too isn't
done with mapserver. I can provide you with links to that if you want.

As far as using js to return info on features/images it would be quite
possible with vector features written in either flash or svg. For 'static'
images/features such as those rendered as jpegs, the opposite would be true
I think.

-pete

-----Original Message-----
From: Dylan Beaudette [mailto:dylan at iici.no-ip.org] 
Sent: Wednesday, July 20, 2005 12:16 AM
To: Peter Giencke
Cc: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] PHP MapScript / dynamic points from MySQL
/ possible to query?

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