forked from MapComplete/MapComplete
		
	Fix bug: fallthrough layers let their features pass again, fixes #349
This commit is contained in:
		
							parent
							
								
									061abd4a76
								
							
						
					
					
						commit
						3d40378628
					
				
					 3 changed files with 5 additions and 5 deletions
				
			
		|  | @ -27,7 +27,7 @@ export default class FeatureSourceMerger implements FeatureSource { | |||
|         // We seed the dictionary with the previously loaded features
 | ||||
|         const oldValues = this.features.data ?? []; | ||||
|         for (const oldValue of oldValues) { | ||||
|             all.set(oldValue.feature.id, oldValue) | ||||
|             all.set(oldValue.feature.id + oldValue.feature._matching_layer_id, oldValue) | ||||
|         } | ||||
| 
 | ||||
|         for (const source of this._sources) { | ||||
|  | @ -35,7 +35,7 @@ export default class FeatureSourceMerger implements FeatureSource { | |||
|                 continue; | ||||
|             } | ||||
|             for (const f of source.features.data) { | ||||
|                 const id = f.feature.properties.id; | ||||
|                 const id = f.feature.properties.id + f.feature._matching_layer_id; | ||||
|                 if (!all.has(id)) { | ||||
|                     // This is a new feature
 | ||||
|                     somethingChanged = true; | ||||
|  |  | |||
|  | @ -20,9 +20,9 @@ export default class RememberingSource implements FeatureSource { | |||
|             } | ||||
|             | ||||
|             // Then new ids
 | ||||
|             const ids = new Set<string>(features.map(f => f.feature.properties.id + f.feature.geometry.type)); | ||||
|             const ids = new Set<string>(features.map(f => f.feature.properties.id + f.feature.geometry.type + f.feature._matching_layer_id)); | ||||
|             // the old data
 | ||||
|             const oldData = oldFeatures.filter(old => !ids.has(old.feature.properties.id + old.feature.geometry.type)) | ||||
|             const oldData = oldFeatures.filter(old => !ids.has(old.feature.properties.id + old.feature.geometry.type + old.feature._matching_layer_id)) | ||||
|             return [...features, ...oldData]; | ||||
|         }) | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue