[OpenLayers-Users] setCenter zooming problem.

bzrudi bzrudi at centarea.com
Wed Feb 11 11:05:00 EST 2009


Hi Christopher,

your guess is absolutely right and all is working well now. I'm pretty
new to JS and therefore fighting a bit with the "specials" ;-)

Anyway, again thanks for your prompt help!

cheers bzrudi

Christopher Schmidt wrote:
> On Wed, Feb 11, 2009 at 04:54:46PM +0100, 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?
> 
> "Share your code."
> 
> My guess is that you're passing a string as the zoomlevel: "16" or some
> such. run parseInt(zoomLevel) before passing it to setCenter, and see if
> that helps.
> 
> However, with no code or working example, it's impossible to know if
> this is right.
> 
> Regards,



More information about the Users mailing list