Problem using zoomPoint() map object method in Python Mapscript

Sean Gillies sgillies at FRII.COM
Thu Sep 2 12:19:00 EDT 2004


On Sep 2, 2004, at 9:59 AM, Bill Hudspeth wrote:

> Sean Gillies wrote:
>
>> On Sep 2, 2004, at 9:37 AM, Bill Hudspeth wrote:
>>
>>> Hello,
>>> Having trouble with the map object zoomPoint() function in python
>>> mapscript. I set up the current view extents in utm coords, a point
>>> to
>>> zoom to in pixel units, and then call zoomPoint() function. Nothing
>>> changes on my view. I translated this code directly from a set of
>>> pan/zoom functions that work in PHP. The logic is exactly the same,
>>> but
>>> I don't get any resultant changes on screen. If anyone can spot what
>>> I
>>> might be missing, I would much appreciate some feedback. Otherwise, a
>>> possible problem with zoomPoint() function or my usage of it?
>>>

...

>>> Thanks, Bill
>>>
>>
>> Bill,
>>
>> The zoomPoint method passes the unit tests I've written for it,
>> but I'm not testing the case of a zoom factor of 1.  I'm wondering
>> if your constraining rectangle isn't the problem.  Your constraining
>> rectangle (6th arg) is the same as your starting rectangle (5th arg)
>> and I think this should practically prevent any zooming with a
>> factor of 1.  Could you try again with
>>
>> self.nmMap.zoomPoint(zoomFactor, zoomToPt, self.img_width,
>> self.img_height, prevExtent, None)
>>
>> and let me know if that solves it?
>>
>> Sean
>>
>>
>>
>>
>> --
>> Sean Gillies
>> sgillies at frii dot com
>> http://users.frii.com/sgillies
>
> That did indeed take care of the problem. Thanks again, Sean
>
> Bill
>
>

Great.  Am cc'ing the list so that your confirmation is archived.

Sean



More information about the mapserver-users mailing list