Zoom to maximum bounding extent of selected features (PostGIS)

Paul Spencer pspencer at DMSOLUTIONS.CA
Mon Feb 13 20:32:54 EST 2006


Jennifer,

you can just set the extents of the mapObj directly using $oMap- 
 >setextents ...

Cheers

Paul

On 13-Feb-06, at 5:21 PM, Jennifer Shanks wrote:

> Hello,
>
> I'm attempting to customize a query tool written in PHP/Mapscript  
> that selects features from a PostGIS database and highlights them  
> on the map.  I'd like to also zoom to the maximum bounding extents  
> of the selected features.
>
> Does anyone have any code samples that I could look at?
>
> Would I use the PostGIS extent function to get the maximum extent  
> of selected features?  Once I have the extent, could I then use the  
> zoomrectangle method of the MapObj class?
>
> It seems as though I will need to do some calculations in order to  
> get the correct parameters for zoomrectangle.
>
> Any guidance or code snippets would be much appreciated.
>
> Regards,
> Jennifer
>
>
>
>
> ****************************
> Jennifer Shanks
> GreenInfo Network
> 116 New Montgomery, Suite 738
> San Francisco, CA 94105
> (415) 979-0343 x 306
> (415) 979-0371 FAX
> **GreenInfo has completely re-done our web site
> Go to: www.greeninfo.org
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+



More information about the mapserver-users mailing list