Skip to content

Commit

Permalink
Fix issue on editResultLayerFeature. readFeature for table layer and …
Browse files Browse the repository at this point in the history
…getFeatures from vector layer
  • Loading branch information
volterra79 committed Jan 20, 2023
1 parent d79bb6e commit 6b2a25e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/editingservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ proto.editResultLayerFeature = function({layer, feature}={}){
*
* Need to get feature from Editing layer source because it has a style layer
*/
const feature = toolBox.getLayer().getEditingLayer().getSource().readFeatures().find(feature => feature.getId() == featureId);
const sourceFeatures = (toolBox.getLayer().getType() === Layer.LayerTypes.VECTOR) ?
toolBox.getLayer().getEditingLayer().getSource().getFeatures() :
toolBox.getLayer().getEditingLayer().getSource().readFeatures()
const feature = sourceFeatures.find(feature => feature.getId() == featureId);
if (feature){
feature.getGeometry() && this._mapService.zoomToGeometry(feature.getGeometry());
toolBox.setSelected(true);
Expand Down

0 comments on commit 6b2a25e

Please sign in to comment.