[Mapserver-users] query points

jose.quintal at cfe.gob.mx jose.quintal at cfe.gob.mx
Thu Jan 30 17:59:15 EST 2003


Hello. I am new with PHP/Mapscript and Mapserver.
I have points in a Table of Mysql with its coordinates.

This it is the code that I use to draw the points.
As I can do to him so that when selecting a point appears to me their data


$p=mysql_query($sql) or die("Error al Ejecutar la Consulta");

//  get a layer object representing your pointlayer
$layerObj = $map->getLayerByName("points");

// get a class object representing the first class in the layer
$classObj = $layerObj->getClass(0);

// create a new point object to hold the X Y data
$pointObj = ms_newPointObj();

while($reg=mysql_fetch_array($p)){
  $a=$reg['postes_id'];
  $b=$reg['cor_x'];
  $c=$reg['cor_y'];

//set the X Y values of the point object

 $pointObj->setXY($b,$c);

 $pointObj->draw($map, $layerObj, $image, 0, $a);


}
 $image_url=$image->saveWebImage(MS_PNG,1,1,0);

I use Windows 2000, IIS, Mapserver 3.6.3 with PHP/Mapscript 4.2.2




Thanks for the aid.
                                                                                                
                                                                                                
                                                                                                
                                                                                                
                                                                                                




José Antonio Quintal Castillo










More information about the mapserver-users mailing list