Use map.setCenter instead.

mapPanel.map.setCenter(feature.geometry.getBounds().getCenterLonLat(), 5);

replace 5 with the zoom level you want.

Best regards,
Bart

>  Hi,
>
> I have a button to zoom into selected features in a grid. I would like to
> only
> zoom into zoom level 5 though, and not right into the point. Does anyone
> know
> how I could restrict the zoom up to a certain level?
>
>
> Here is the code for the button,
>
>
> bbar: [{
>                 text:"<h1>an Auswahl heranzoomen</h1>",
>                 cls: 'x-btn-text-icon',
>                   icon: '../styles/magnifier.png',
>                 handler:function()
>                     {
>                     
> attribgridPanel_wea.getSelectionModel().each(function(rec){
>                         var feature = rec.get("feature");
>                         
> mapPanel.map.zoomToExtent(feature.geometry.getBounds());
>
>                         })
>                     }
>                 }]
>
>             });
>
>
>
>
> Thanks for any help,
>
> Yours,
>
> Rob
>
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>


_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to