More cleaning up

This commit is contained in:
Pieter Vander Vennet 2021-01-04 04:36:21 +01:00
parent 778044d0fb
commit 4948524f91
22 changed files with 36 additions and 65 deletions

View file

@ -3,7 +3,7 @@ import Link from "../Base/Link";
import Svg from "../../Svg";
import Combine from "../Base/Combine";
import {UIEventSource} from "../../Logic/UIEventSource";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails from "../../Logic/Osm/OsmConnection";
import Constants from "../../Models/Constants";
import LayoutConfig from "../../Customizations/JSON/LayoutConfig";
import Loc from "../../Models/Loc";
@ -19,7 +19,7 @@ export default class Attribution extends UIElement {
constructor(location: UIEventSource<Loc>,
userDetails: UIEventSource<UserDetails>,
layoutToUse: UIEventSource<LayoutConfig>,
leafletMap: UIEventSource<L.Map>) {
leafletMap: UIEventSource<LeafletMap>) {
super(location);
this._layoutToUse = layoutToUse;
this.ListenTo(layoutToUse);
@ -49,7 +49,7 @@ export default class Attribution extends UIElement {
if (location !== undefined &&
this._leafletMap.data !== undefined &&
userDetails.csCount >= Constants.userJourney.tagsVisibleAndWikiLinked) {
const bounds = this._leafletMap.data.getBounds();
const bounds : any= this._leafletMap.data.getBounds();
const top = bounds.getNorth();
const bottom = bounds.getSouth();
const right = bounds.getEast();

View file

@ -3,7 +3,7 @@ import {DropDown} from "../Input/DropDown";
import Translations from "../i18n/Translations";
import State from "../../State";
import {UIEventSource} from "../../Logic/UIEventSource";
import {BaseLayer} from "../../Models/BaseLayer";
import BaseLayer from "../../Models/BaseLayer";
export default class BackgroundSelector extends UIElement {

View file

@ -12,6 +12,7 @@ import Combine from "../Base/Combine";
import {FixedUiElement} from "../Base/FixedUiElement";
import Translations from "../i18n/Translations";
import Constants from "../../Models/Constants";
import LayerConfig from "../../Customizations/JSON/LayerConfig";
export default class SimpleAddUI extends UIElement {
private readonly _addButtons: UIElement[];
@ -24,7 +25,7 @@ export default class SimpleAddUI extends UIElement {
icon: UIElement,
tags: Tag[],
layerToAddTo: {
name: UIElement | string,
layerDef: LayerConfig,
isDisplayed: UIEventSource<boolean> }
}>
= new UIEventSource(undefined);
@ -128,7 +129,7 @@ export default class SimpleAddUI extends UIElement {
if(!this._confirmPreset.data.layerToAddTo.isDisplayed.data){
return new Combine([
Translations.t.general.add.layerNotEnabled.Subs({layer: this._confirmPreset.data.layerToAddTo.name})
Translations.t.general.add.layerNotEnabled.Subs({layer: this._confirmPreset.data.layerToAddTo.layerDef.name})
.SetClass("alert"),
this.openLayerControl,

View file

@ -4,7 +4,7 @@
import {UIEventSource} from "../../Logic/UIEventSource";
import {UIElement} from "../UIElement";
import {VariableUiElement} from "../Base/VariableUIElement";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails from "../../Logic/Osm/OsmConnection";
import Svg from "../../Svg";
import State from "../../State";
import Combine from "../Base/Combine";

View file

@ -6,7 +6,7 @@ import {LayoutConfigJson} from "../../Customizations/JSON/LayoutConfigJson";
import Combine from "../Base/Combine";
import {GenerateEmpty} from "./GenerateEmpty";
import LayerPanelWithPreview from "./LayerPanelWithPreview";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails from "../../Logic/Osm/OsmConnection";
import {MultiInput} from "../Input/MultiInput";
import TagRenderingPanel from "./TagRenderingPanel";
import SingleSetting from "./SingleSetting";

View file

@ -1,5 +1,5 @@
import {UIElement} from "../UIElement";
import {OsmConnection, UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails, {OsmConnection} from "../../Logic/Osm/OsmConnection";
import {UIEventSource} from "../../Logic/UIEventSource";
import SingleSetting from "./SingleSetting";
import GeneralSettings from "./GeneralSettings";
@ -11,7 +11,6 @@ import AllLayersPanel from "./AllLayersPanel";
import SharePanel from "./SharePanel";
import {LayoutConfigJson} from "../../Customizations/JSON/LayoutConfigJson";
import {SubtleButton} from "../Base/SubtleButton";
import State from "../../State";
import {FixedUiElement} from "../Base/FixedUiElement";
import SavePanel from "./SavePanel";
import {LocalStorageSource} from "../../Logic/Web/LocalStorageSource";

View file

@ -16,8 +16,7 @@ import {TagRenderingConfigJson} from "../../Customizations/JSON/TagRenderingConf
import {MultiInput} from "../Input/MultiInput";
import {LayerConfigJson} from "../../Customizations/JSON/LayerConfigJson";
import PresetInputPanel from "./PresetInputPanel";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import State from "../../State";
import UserDetails from "../../Logic/Osm/OsmConnection";
import {FixedUiElement} from "../Base/FixedUiElement";
import ValidatedTextField from "../Input/ValidatedTextField";
import Svg from "../../Svg";

View file

@ -8,7 +8,7 @@ import {FromJSON} from "../../Customizations/JSON/FromJSON";
import Combine from "../Base/Combine";
import PageSplit from "../Base/PageSplit";
import TagRenderingPreview from "./TagRenderingPreview";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails from "../../Logic/Osm/OsmConnection";
export default class LayerPanelWithPreview extends UIElement{

View file

@ -3,7 +3,7 @@ import {UIEventSource} from "../../Logic/UIEventSource";
import {LayoutConfigJson} from "../../Customizations/JSON/LayoutConfigJson";
import Combine from "../Base/Combine";
import {VariableUiElement} from "../Base/VariableUIElement";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails from "../../Logic/Osm/OsmConnection";
export default class SharePanel extends UIElement {
private _config: UIEventSource<LayoutConfigJson>;

View file

@ -12,8 +12,7 @@ import {MultiInput} from "../Input/MultiInput";
import MappingInput from "./MappingInput";
import {AndOrTagConfigJson} from "../../Customizations/JSON/TagConfigJson";
import {TagRenderingConfigJson} from "../../Customizations/JSON/TagRenderingConfigJson";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import State from "../../State";
import UserDetails from "../../Logic/Osm/OsmConnection";
import {VariableUiElement} from "../Base/VariableUIElement";
import ValidatedTextField from "../Input/ValidatedTextField";
import SpecialVisualizations from "../SpecialVisualizations";

View file

@ -9,7 +9,7 @@ import Svg from "../../Svg";
import {VariableUiElement} from "../Base/VariableUIElement";
import {SaveButton} from "../Popup/SaveButton";
import CheckBoxes from "../Input/Checkboxes";
import {UserDetails} from "../../Logic/Osm/OsmConnection";
import UserDetails from "../../Logic/Osm/OsmConnection";
export default class ReviewForm extends InputElement<Review> {

View file

@ -39,12 +39,10 @@ export default class ShowDataLayer {
const feats = features.data.map(ff => ff.feature);
const geoLayer = self.CreateGeojsonLayer(feats);
if (oldGeoLayer) {
mp.removeLayer(oldGeoLayer);
}
geoLayer.addTo(mp);
mp.addLayer(geoLayer);
oldGeoLayer = geoLayer;
}