diff --git a/Logic/SimpleMetaTagger.ts b/Logic/SimpleMetaTagger.ts index af00de028..714da8e75 100644 --- a/Logic/SimpleMetaTagger.ts +++ b/Logic/SimpleMetaTagger.ts @@ -7,6 +7,7 @@ import Title from "../UI/Base/Title"; import {FixedUiElement} from "../UI/Base/FixedUiElement"; import LayerConfig from "../Models/ThemeConfig/LayerConfig"; import {CountryCoder} from "latlon2country" +import Constants from "../Models/Constants"; export class SimpleMetaTagger { @@ -40,7 +41,7 @@ export class 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; constructor() { @@ -217,7 +218,7 @@ export default class SimpleMetaTaggers { }, ((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) { return; } diff --git a/Models/Constants.ts b/Models/Constants.ts index e829a39de..abb2ab56c 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -69,6 +69,7 @@ export default class Constants { * In seconds */ static zoomToLocationTimeout = 60; + static countryCoderEndpoint: string = "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/latlon2country"; private static isRetina(): boolean { if (Utils.runningFromConsole) {