Zooming to shapes found by queryByAttributes

Didrik Pinte dpinte at ITAE.BE
Mon Jun 12 09:12:39 EDT 2006


Le lundi 12 juin 2006 à 15:44 +0300, Volkan Ulukut a écrit :
> Hey list;
> 
> I’m having trouble zooming to the exact location of the shape after
> doing a search with queryByAttributes. I’m trying to use zoomrectangle
> and zoomscale but they both need pixel position. So i try to convert
> my georef coordinates to pixel coordinates. I believe that was
> successful too, but the problem is that the shape is too small (a
> street in the worldmap) and the pixel i calculate is not an integer
> value. The zoom actually happens but not exactly on the shape just a
> bit miles west and north. I tried to workaround this by zooming step
> by step. By that i mean zooming to that location a little then zooming
> to the centre till i get to the shape. But that won’t give the same
> result on every search as you may guess. I’m stuck now cause i can’t
> zoom to the right place with pixel coordinates. Is there any way that
> i can zoom with georef coordinates(lat/long)? 

Using the resultset.bounds, you get an extent of the resultset. With the
setExtent method, you can apply it to the map.

Didrik

PS : if you're querying points, don't forget to manage the case of only
one point in the resultset.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060612/888e46b3/attachment.bin


More information about the mapserver-users mailing list