[Users] Zoom to Multiselect

Robert Buckley robertdbuckley at yahoo.com
Tue Oct 26 16:54:57 CEST 2010


Thanks for the response.

I wanted to zoom into the total bounding box of the selected features in a grid. 
This is my code which works for one selected feature in a grid, if I select more 
than one in the grid only the bounding box of first 

feature is zoomed on...

bbar: [{
            text: "an Auswahl heranzoomen",
            handler: function(){
                wea_attribgridPanel.getSelectionModel().each(function(rec){
                    var feature = rec.get("feature");
                    wea_mapPanel.map.zoomToExtent(feature.geometry.getBounds());
                })
            }
        },toolbarItems]
    });
    // 2 x Click in grid
    wea_attribgridPanel.on('rowdblclick', function(){
        wea_attribgridPanel.getSelectionModel().each(function(rec){
            var feature = rec.get("feature");
            
wea_mapPanel.map.setCenter(feature.geometry.getBounds().getCenterLonLat(), 15);
        })
    });


Thanks for any pointers...





More information about the Users mailing list