How-to modify DATA in LAYER with PHP mapscript?

Dave Nuttall dnuttall at DNLT.COM
Sat Dec 22 18:38:15 PST 2007


I've been able to generate a map using the OGR CONNECTIONTYPE to pull data
from a MySQL table.

Each record contains the geometry and extents and I've figured out how to
set the  extents before drawing the map.  However, if I could dynamically
modify the DATA element of a layer's CONNECTION, the end result would be
much better.

When I dump the $map array, I don't see an element that corresponds to the
CONNECTIONTYPE or the DATA string for the OGR connection.

I'd be grateful if someone could post the equivalent to what I use to change
the EXTENT for the current map.  I use something like this:
  <?php
    $row=mysql_fetch_assoc($result);
    $map->setExtent($row['x1'],$row['y1'],$row['x2'],$row['y2']);
    $image->$map->draw();
   // then show the result
?>

I'm terribly illiterate when it comes to O-O stuff, so if you care to help,
the more explanation the better for me!!!

Thanks in advance.
Dave Nuttall
San Antonio, Texas



More information about the MapServer-users mailing list