Some refactoring

This commit is contained in:
Pieter Vander Vennet 2022-01-14 03:14:56 +01:00
parent 85af8a20b0
commit a03313fb3d
9 changed files with 18 additions and 20 deletions

View file

@ -213,7 +213,7 @@ This is a priviliged meta_layer which exports _every_ point in OSM. This only wo
This layer shows notes on OpenStreetMap. This layer shows notes on OpenStreetMap. Having this layer in your theme will trigger the 'add new note' functionality in the 'addNewPoint'-popup (or if your theme has no presets, it'll enable adding notes)
[Go to the source code](../assets/layers/note/note.json) [Go to the source code](../assets/layers/note/note.json)

View file

@ -489,7 +489,7 @@ id_of_object_to_apply_this_one | _undefined_ | If specified, applies the the tag
### close_note ### close_note
Button to close a note - eventually with a prefixed text Button to close a note. A predifined text can be defined to close the note with. If the note is already closed, will show a small text.
name | default | description name | default | description
------ | --------- | ------------- ------ | --------- | -------------

View file

@ -10,7 +10,7 @@ import {UIEventSource} from "./UIEventSource";
import {LocalStorageSource} from "./Web/LocalStorageSource"; import {LocalStorageSource} from "./Web/LocalStorageSource";
import LZString from "lz-string"; import LZString from "lz-string";
import * as personal from "../assets/themes/personal/personal.json"; import * as personal from "../assets/themes/personal/personal.json";
import {FixLegacyTheme, PrepareTheme} from "../Models/ThemeConfig/LegacyJsonConvert"; import {FixLegacyTheme, PrepareTheme} from "../Models/ThemeConfig/Conversion/LegacyJsonConvert";
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson"; import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
import SharedTagRenderings from "../Customizations/SharedTagRenderings"; import SharedTagRenderings from "../Customizations/SharedTagRenderings";
import * as known_layers from "../assets/generated/known_layers.json" import * as known_layers from "../assets/generated/known_layers.json"

View file

@ -1,9 +1,9 @@
import * as OsmToGeoJson from "osmtogeojson";
import {TagsFilter} from "../Tags/TagsFilter"; import {TagsFilter} from "../Tags/TagsFilter";
import RelationsTracker from "./RelationsTracker"; import RelationsTracker from "./RelationsTracker";
import {Utils} from "../../Utils"; import {Utils} from "../../Utils";
import {UIEventSource} from "../UIEventSource"; import {UIEventSource} from "../UIEventSource";
import {BBox} from "../BBox"; import {BBox} from "../BBox";
import osmtogeojson from "osmtogeojson";
/** /**
* Interfaces overpass to get all the latest data * Interfaces overpass to get all the latest data
@ -52,8 +52,7 @@ export class Overpass {
} }
self._relationTracker.RegisterRelations(json) self._relationTracker.RegisterRelations(json)
// @ts-ignore const geojson = osmtogeojson(json);
const geojson = OsmToGeoJson.default(json);
const osmTime = new Date(json.osm3s.timestamp_osm_base); const osmTime = new Date(json.osm3s.timestamp_osm_base);
return [geojson, osmTime]; return [geojson, osmTime];
} }

View file

@ -1,13 +1,13 @@
import LineRenderingConfigJson from "./Json/LineRenderingConfigJson"; import {LayoutConfigJson} from "../Json/LayoutConfigJson";
import LayerConfig from "./LayerConfig"; import DependencyCalculator from "../DependencyCalculator";
import Constants from "../Constants"; import LayerConfig from "../LayerConfig";
import {LayoutConfigJson} from "./Json/LayoutConfigJson"; import {Translation} from "../../../UI/i18n/Translation";
import {LayerConfigJson} from "./Json/LayerConfigJson"; import LayoutConfig from "../LayoutConfig";
import DependencyCalculator from "./DependencyCalculator"; import {Utils} from "../../../Utils";
import {TagRenderingConfigJson} from "./Json/TagRenderingConfigJson"; import {TagRenderingConfigJson} from "../Json/TagRenderingConfigJson";
import {Utils} from "../../Utils"; import LineRenderingConfigJson from "../Json/LineRenderingConfigJson";
import LayoutConfig from "./LayoutConfig"; import {LayerConfigJson} from "../Json/LayerConfigJson";
import {Translation} from "../../UI/i18n/Translation"; import Constants from "../../Constants";
export interface DesugaringContext { export interface DesugaringContext {
tagRenderings: Map<string, TagRenderingConfigJson> tagRenderings: Map<string, TagRenderingConfigJson>

View file

@ -9,7 +9,7 @@ import {
PrepareLayer, PrepareTheme, PrepareLayer, PrepareTheme,
ValidateLayer, ValidateLayer,
ValidateThemeAndLayers ValidateThemeAndLayers
} from "../Models/ThemeConfig/LegacyJsonConvert"; } from "../Models/ThemeConfig/Conversion/LegacyJsonConvert";
import {Translation} from "../UI/i18n/Translation"; import {Translation} from "../UI/i18n/Translation";
import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson"; import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson";
import * as questions from "../assets/tagRenderings/questions.json"; import * as questions from "../assets/tagRenderings/questions.json";

Binary file not shown.

View file

@ -1,5 +1,5 @@
import T from "./TestHelper"; import T from "./TestHelper";
import {FixLegacyTheme} from "../Models/ThemeConfig/LegacyJsonConvert"; import {FixLegacyTheme} from "../Models/ThemeConfig/Conversion/LegacyJsonConvert";
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"; import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson"; import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson"; import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson";

View file

@ -3,10 +3,9 @@ import * as assert from "assert";
import {LayoutConfigJson} from "../Models/ThemeConfig/Json/LayoutConfigJson"; import {LayoutConfigJson} from "../Models/ThemeConfig/Json/LayoutConfigJson";
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"; import LayoutConfig from "../Models/ThemeConfig/LayoutConfig";
import * as bookcaseLayer from "../assets/generated/layers/public_bookcase.json" import * as bookcaseLayer from "../assets/generated/layers/public_bookcase.json"
import {PrepareLayer, PrepareTheme} from "../Models/ThemeConfig/LegacyJsonConvert"; import {PrepareTheme} from "../Models/ThemeConfig/Conversion/LegacyJsonConvert";
import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson"; import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson";
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson"; import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
import LayerConfig from "../Models/ThemeConfig/LayerConfig";
import Constants from "../Models/Constants"; import Constants from "../Models/Constants";
export default class ThemeSpec extends T { export default class ThemeSpec extends T {