forked from MapComplete/MapComplete
		
	Move country coder endpoint config into 'Constants'
This commit is contained in:
		
							parent
							
								
									14956e229c
								
							
						
					
					
						commit
						c202ba606b
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		|  | @ -7,6 +7,7 @@ import Title from "../UI/Base/Title"; | ||||||
| import {FixedUiElement} from "../UI/Base/FixedUiElement"; | import {FixedUiElement} from "../UI/Base/FixedUiElement"; | ||||||
| import LayerConfig from "../Models/ThemeConfig/LayerConfig"; | import LayerConfig from "../Models/ThemeConfig/LayerConfig"; | ||||||
| import {CountryCoder} from "latlon2country" | import {CountryCoder} from "latlon2country" | ||||||
|  | import Constants from "../Models/Constants"; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export class SimpleMetaTagger { | export class SimpleMetaTagger { | ||||||
|  | @ -40,7 +41,7 @@ export class SimpleMetaTagger { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export class CountryTagger extends SimpleMetaTagger { | export class CountryTagger extends SimpleMetaTagger { | ||||||
|     private static readonly coder = new CountryCoder("https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/latlon2country", Utils.downloadJson); |     private static readonly coder = new CountryCoder(Constants.countryCoderEndpoint, Utils.downloadJson); | ||||||
|     public runningTasks: Set<any>; |     public runningTasks: Set<any>; | ||||||
| 
 | 
 | ||||||
|     constructor() { |     constructor() { | ||||||
|  | @ -217,7 +218,7 @@ export default class SimpleMetaTaggers { | ||||||
| 
 | 
 | ||||||
|         }, |         }, | ||||||
|         ((feature, _, __, state) => { |         ((feature, _, __, state) => { | ||||||
|             const units = Utils.NoNull([].concat(...state?.layoutToUse?.layers?.map(layer => layer.units ?? []))); |             const units = Utils.NoNull([].concat(...state?.layoutToUse?.layers?.map(layer => layer.units )?? [])); | ||||||
|             if (units.length == 0) { |             if (units.length == 0) { | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  | @ -69,6 +69,7 @@ export default class Constants { | ||||||
|      * In seconds |      * In seconds | ||||||
|      */ |      */ | ||||||
|     static zoomToLocationTimeout = 60; |     static zoomToLocationTimeout = 60; | ||||||
|  |     static countryCoderEndpoint: string = "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/latlon2country"; | ||||||
| 
 | 
 | ||||||
|     private static isRetina(): boolean { |     private static isRetina(): boolean { | ||||||
|         if (Utils.runningFromConsole) { |         if (Utils.runningFromConsole) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue