forked from MapComplete/MapComplete
		
	Add deploy script, fix realtime updating of the icons
This commit is contained in:
		
							parent
							
								
									07afc597c9
								
							
						
					
					
						commit
						7c1c9bc80a
					
				
					 1 changed files with 9 additions and 11 deletions
				
			
		|  | @ -110,16 +110,6 @@ export class FilteredLayer { | |||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public updateStyle() { | ||||
|         if (this._geolayer === undefined) { | ||||
|             return; | ||||
|         } | ||||
|         const self = this; | ||||
|         this._geolayer.setStyle(function (feature) { | ||||
|             return self._style(feature.properties); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public AddNewElement(element) { | ||||
|         this._newElements.push(element); | ||||
|         console.log("Element added"); | ||||
|  | @ -186,7 +176,15 @@ export class FilteredLayer { | |||
|             onEachFeature: function (feature, layer) { | ||||
|                 let eventSource = self._storage.addOrGetElement(feature); | ||||
|                 eventSource.addCallback(function () { | ||||
|                     self.updateStyle(); | ||||
|                     if (layer.setIcon) { | ||||
|                         layer.setIcon(self._style(feature.properties).icon) | ||||
|                     } else { | ||||
|                         console.log("UPdating", layer); | ||||
| 
 | ||||
|                         self._geolayer.setStyle(function (feature) { | ||||
|                             return self._style(feature.properties); | ||||
|                         }); | ||||
|                     } | ||||
|                 }); | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue