Skip to content

Commit

Permalink
Added optional custom zoomToFeature action
Browse files Browse the repository at this point in the history
  • Loading branch information
kappu committed Nov 2, 2016
1 parent 2ab0ab2 commit 92b2984
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/client/components/data/featuregrid/FeatureGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const FeatureGrid = React.createClass({
toolbar: React.PropTypes.object,
dataSource: React.PropTypes.object,
selectAll: React.PropTypes.func,
selectAllActive: React.PropTypes.bool
selectAllActive: React.PropTypes.bool,
zoomToFeatureAction: React.PropTypes.func
},
contextTypes: {
messages: React.PropTypes.object
Expand Down Expand Up @@ -245,7 +246,11 @@ const FeatureGrid = React.createClass({
zoomToFeature(params) {
let geometry = params.data.geometry;
if (geometry.coordinates) {
this.changeMapView([geometry], this.props.zoom);
if (this.props.zoomToFeatureAction) {
this.props.zoomToFeatureAction(params.data, params.data.geometry);
} else {
this.changeMapView([geometry], this.props.zoom);
}
}
},
zoomToFeatures() {
Expand Down

0 comments on commit 92b2984

Please sign in to comment.