File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
projects/core/src/lib/components/edit Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export class EditComponent implements OnInit {
104104 this . mapService . getMapViewDetails$ ( ) ] ) . pipe (
105105 takeUntilDestroyed ( this . destroyRef ) ,
106106 ) . subscribe ( ( [ selectedEditLayerId , visibleLayers , mapViewDetails ] ) => {
107- const layers = selectedEditLayerId == null ? [ ] : visibleLayers . filter ( layer =>
107+ const layers = selectedEditLayerId === null ? [ ] : visibleLayers . filter ( layer =>
108108 layer . id !== selectedEditLayerId
109109 && ScaleHelper . isInScale ( mapViewDetails . scale , layer . minScale , layer . maxScale )
110110 && this . selectedCopyLayerIds . length == 0 || this . selectedCopyLayerIds . includes ( layer . id ) ) ;
@@ -190,7 +190,7 @@ export class EditComponent implements OnInit {
190190 public createFeatureFromLayer ( id : string ) {
191191
192192 this . selectedCopyLayer$ . pipe ( take ( 1 ) ) . subscribe ( selectedCopyLayer => {
193- if ( id == selectedCopyLayer ) {
193+ if ( id === selectedCopyLayer ) {
194194 this . store$ . dispatch ( setEditCopyOtherLayerFeaturesDisabled ( ) ) ;
195195 return ;
196196 }
Original file line number Diff line number Diff line change @@ -80,12 +80,13 @@ const onLoadCopyFeaturesSuccess = (
8080 return state ;
8181 }
8282
83- // Deselect a feature by checking if the geometry WKT is already in the copiedFeatures array (can't search by fid)
83+ // Deselect a feature by checking if the geometry WKT is already in the copiedFeatures array.
84+ // We can't deselect by checking the FID, because WMS GetFeatureInfo responses have a different FID every time (generated by us), and we
85+ // want to have this work for WMS GFI responses as well.
8486 const sameGeometryIndex = state . copiedFeatures . findIndex ( f => f . geometry === geometry ) ;
8587 const copiedFeatures = sameGeometryIndex !== - 1
86- ? state . copiedFeatures . filter ( ( _ , idx ) => idx !== sameGeometryIndex )
88+ ? [ ... state . copiedFeatures . slice ( 0 , sameGeometryIndex ) , ... state . copiedFeatures . slice ( sameGeometryIndex + 1 ) ]
8789 : [ ...state . copiedFeatures , payload . featureInfo [ 0 ] . features [ 0 ] ] ;
88-
8990 return {
9091 ...state ,
9192 copiedFeatures,
You can’t perform that action at this time.
0 commit comments