[Users] zoom in, but not too far!!
Bart van den Eijnden (OSGIS)
bartvde at osgis.nl
Thu Sep 2 15:23:41 CEST 2010
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
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
More information about the Users
mailing list