[OpenLayers-Users] setCenter zooming problem.

bzrudi bzrudi at centarea.com
Wed Feb 11 11:07:31 EST 2009


Hi Christoph,

right, the zoom level is returned from database and it seems I didn't
take care about string -> int (even so it's int in DB) conversion
because I didn't know it ;-)

It works now, thanks alot!

cheers bzrudi

Christoph Boehme wrote:
> Hi,
> 
> I had the same problem when I loaded the location and zoom level from a
> cookie. It turned out that the problem was caused by the cookie
> (obviously) returning string values. The zoom-in code in OL contains a
> line which computes zoomLevel+1 which works fine for numbers but results
> in concatenation if zoomLevel is a string. After making sure that
> setCenter receives the zoom as a number (with Number(zoom)) it was
> working fine.
> 
> Christoph
> 
> bzrudi wrote:
>> Hi all!
>>
>> I have a strange problem and one may know a simple solution. I use
>> setCenter() to center and zoom the map to a given location.
>> This works as expected without any problem. The problem is I can't zoom
>> in before zooming out one level first.
>> So in detail, open the map:
>>
>> - use doubleclick, mousewheel or use zoompanel to zoom in -> nothing
>> - use doubleclick, mousewheel or use zoompanel to zoom out -> works!
>>
>> now you can zoom in without any problem.
>> I don't have the problem when not using setCenter(). E.g. zooming in
>> from max entent works.
>>
>> Any idea?
>>
>> Thanks in advance!
>>
>> cheers bzrudi
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list