Skip to content

Commit

Permalink
For edit feature from result, need to pass feature from editing layer…
Browse files Browse the repository at this point in the history
… source
  • Loading branch information
volterra79 committed Jan 12, 2023
1 parent 256aecd commit 8a3b960
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/editingservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,12 @@ proto.editResultLayerFeature = function({layer, feature}={}){
}
})
.then(({features=[]}) => {
const feature = features.find(feature => feature.getId() == featureId);
//const feature = features.find(feature => feature.getId() == featureId);
/**
*
* Need to get feature from Editing layer source because it has a style layer
*/
const feature = toolBox.getLayer().getEditingLayer().getSource().getFeatures().find(feature => feature.getId() == featureId);
if (feature){
feature.getGeometry() && this._mapService.zoomToGeometry(feature.getGeometry());
toolBox.setSelected(true);
Expand Down

0 comments on commit 8a3b960

Please sign in to comment.