[Mapserver-users] Re: Zoom after Itemquery (PHP-Mapscript) - Feature request

Daniel Morissette morissette at dmsolutions.ca
Thu Dec 12 17:39:34 EST 2002


Nicol Hermann wrote:
> 
> over one year ago Steve Lime answered the the question if it is possible
> to "zoom in" after an Itemquery that this feature is specific to the
> mapserv CGI.
> 
> http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0109/msg00078.html
> 
> Is this feature meanwhile implemented in the resent PHP-Mapscript
> (3.6.3) or the upcoming 3.7 release and how can i use it?
> 
> Is theres an possibility to do this whitout a specific function?
> 

I'm not aware of this feature being part of or having been added to the
3.6 or 3.7 releases.

However this is easy to do with MapScript:

1- You perform your query operation
2- You loop through the query results, and for each layer that contains
results:
  2a - call $layer->open()
  2b - for each selected shapes in this layer
         - read the shape using $layer->getShape()
         - read the shapeObj's bounds
         - compute your target zoom extents using this shape's bounds
  2c - call $layer->close()
3- use the calculated extents to call $map->setExtent()

I hope that helps, you could also file this in bugzilla as an
enhancement request and if someone has time it may get added to
MapScript.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
-------------------------------------------------------------



More information about the mapserver-users mailing list