[mapserver-users] Itemquery in Mapscript(PHP)

Obe, Regina DND\MIS Regina.Obe.PFD at ci.boston.ma.us
Mon Sep 10 08:58:00 EDT 2001


I'm trying to simulate the item query functionality that is in mapserve in
PHP mapscript.  I followed another example I found on this list serv and
that worked fine except I can't get it to zoom in.   It highlights the area
but doesn't zoom in and wondering if this is possible without having to
query a table that has the list of extents for each feature.

This is what my code looks like

$map = ms_newMapObj("bosstreets.map"); 

$lzone = $map->getlayerbyname("zones"); //get neighborhood layer
$lzone->set("status", MS_ON);
$qclass = $lzone->getClass(0);
$qclass->setexpression("Dorchester");
$acolor = $map->addColor(255,40,250);
$qclass->set("color", $acolor);
$img = $map->draw() or die('Unable to draw map');
$url = $img->saveWebImage(MS_GIF, 0, 0, -1);


This is the portion of my map file that I think is relevant

LAYER
  NAME "zones"
  DATA Pdnad83_region
  STATUS DEFAULT
  TYPE POLYGON
  CLASSITEM "NAME"
  CLASS 
	NAME "NAME"
	OUTLINECOLOR 50 230 0
  END	
END

(I'm using mapscript for PHP 3.5 (pre-alpha) (Jul 20,2001) on PHP 4.0.6
running on top of IIS)

Thanks.  I'm really impressed with Mapscript and the Mapserv CGI exe so far.
Never thought mapping could be this easy.


Regina Obe
Senior Programmer
Department Of Neighborhood Development
City of Boston



More information about the mapserver-users mailing list