forked from MapComplete/MapComplete
		
	Small bugfixes for NP theme
This commit is contained in:
		
							parent
							
								
									550a2030ad
								
							
						
					
					
						commit
						abbd617ca2
					
				
					 2 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -124,14 +124,18 @@ export default class GeoJsonSource implements FeatureSource {
 | 
			
		|||
                }
 | 
			
		||||
 | 
			
		||||
                // Yup, this is cheating to just get the bounds here
 | 
			
		||||
                const bounds = State.state.leafletMap.data.getBounds()
 | 
			
		||||
                const bounds = State.state.leafletMap.data?.getBounds()
 | 
			
		||||
                if(bounds === undefined){
 | 
			
		||||
                    // We'll retry later
 | 
			
		||||
                    return undefined
 | 
			
		||||
                }
 | 
			
		||||
                const tileRange = Utils.TileRangeBetween(zoomLevel, bounds.getNorth(), bounds.getEast(), bounds.getSouth(), bounds.getWest())
 | 
			
		||||
                const needed = Utils.MapRange(tileRange, (x, y) => {
 | 
			
		||||
                    return url.replace("{x}", "" + x).replace("{y}", "" + y);
 | 
			
		||||
                })
 | 
			
		||||
                return new Set<string>(needed);
 | 
			
		||||
            }
 | 
			
		||||
            , [flayer.isDisplayed]);
 | 
			
		||||
            , [flayer.isDisplayed, State.state.leafletMap]);
 | 
			
		||||
        neededTiles.stabilized(250).addCallback((needed: Set<string>) => {
 | 
			
		||||
            if (needed === undefined) {
 | 
			
		||||
                return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -105,7 +105,7 @@ export default class ExportPDF {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    private cleanup() {
 | 
			
		||||
        //   new FixedUiElement("Screenshot taken!").AttachTo(this.freeDivId)
 | 
			
		||||
        new FixedUiElement("Screenshot taken!").AttachTo(this.freeDivId)
 | 
			
		||||
        this._screenhotTaken = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue