Skip to content

Commit

Permalink
return on null and reduce indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Feb 28, 2017
1 parent f02b2ef commit 8333fde
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/GeoExt/selection/FeatureModel.js
Expand Up @@ -359,14 +359,15 @@ Ext.define('GeoExt.selection.FeatureModel', {
recenterToSelectionExtent: function() {
var map = this.selectControl.map;
var selectionExtent = this.getSelectionExtent();
if (selectionExtent !== null) {
var selectionExtentZoom = map.getZoomForExtent(selectionExtent, false);
if (selectionExtentZoom > map.getZoom()) {
map.setCenter(selectionExtent.getCenterLonLat());
}
else {
map.zoomToExtent(selectionExtent);
}
if (selectionExtent === null) {
return;
}
var selectionExtentZoom = map.getZoomForExtent(selectionExtent, false);
if (selectionExtentZoom > map.getZoom()) {
map.setCenter(selectionExtent.getCenterLonLat());
}
else {
map.zoomToExtent(selectionExtent);
}
},

Expand Down

0 comments on commit 8333fde

Please sign in to comment.