public void onClick ( ClickEvent clickEvent ) { List < Feature > features = new ArrayList < Feature > ( ) ; for ( VectorLayer layer : mapWidget . getMapModel ( ) . getVectorLayers ( ) ) { features . addAll ( layer . getSelectedFeatureValues ( ) ) ; } // only zoom when there where really some items selected if ( features . size ( ) > 0 ) { mapWidget . getMapModel ( ) . panToFeatures ( features ) ; } }
Pan to the selected features .