Various small fixes
This commit is contained in:
parent
2bfeb67a3a
commit
bd43e2537f
8 changed files with 32 additions and 18 deletions
|
@ -114,7 +114,6 @@ export class NatureReserves extends LayerDefinition {
|
||||||
|
|
||||||
let colormapping = {
|
let colormapping = {
|
||||||
0: "#00bb00",
|
0: "#00bb00",
|
||||||
1: "#00ff00",
|
|
||||||
10: "#dddd00",
|
10: "#dddd00",
|
||||||
20: "#ff0000"
|
20: "#ff0000"
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,19 +25,21 @@ export class Layout {
|
||||||
public startLat: number;
|
public startLat: number;
|
||||||
|
|
||||||
public locationContains: string[];
|
public locationContains: string[];
|
||||||
|
|
||||||
public enableAdd: boolean = true;
|
public enableAdd: boolean = true;
|
||||||
public enableUserBadge: boolean = true;
|
public enableUserBadge: boolean = true;
|
||||||
public enableSearch: boolean = true;
|
public enableSearch: boolean = true;
|
||||||
public enableLayers: boolean = true;
|
public enableLayers: boolean = true;
|
||||||
|
public enableMoreQuests: boolean = true;
|
||||||
public hideFromOverview : boolean = false;
|
public enableShareScreen: boolean = true;
|
||||||
|
|
||||||
|
public hideFromOverview: boolean = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The BBOX of the currently visible map are widened by this factor, in order to make some panning possible.
|
* The BBOX of the currently visible map are widened by this factor, in order to make some panning possible.
|
||||||
* This number influences this
|
* This number influences this
|
||||||
*/
|
*/
|
||||||
public widenFactor : number = 0.07;
|
public widenFactor: number = 0.07;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -56,5 +56,7 @@ export class Groen extends Layout {
|
||||||
this.locationContains = ["buurtnatuur.be"]
|
this.locationContains = ["buurtnatuur.be"]
|
||||||
this.socialImage = "assets/BuurtnatuurFront.jpg"
|
this.socialImage = "assets/BuurtnatuurFront.jpg"
|
||||||
this.description = "Met deze tool kan je natuur in je buurt in kaart brengen en meer informatie geven over je favoriete plekje"
|
this.description = "Met deze tool kan je natuur in je buurt in kaart brengen en meer informatie geven over je favoriete plekje"
|
||||||
|
this.enableMoreQuests = false;
|
||||||
|
this.enableShareScreen = false
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -53,13 +53,22 @@ export class InitUiElements {
|
||||||
welcome = new CustomLayersPanel();
|
welcome = new CustomLayersPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tabs = [
|
||||||
const fullOptions = new TabbedComponent([
|
|
||||||
{header: `<img src='${layoutToUse.icon}'>`, content: welcome},
|
{header: `<img src='${layoutToUse.icon}'>`, content: welcome},
|
||||||
{header: `<img src='${'./assets/osm-logo.svg'}'>`, content: Translations.t.general.openStreetMapIntro},
|
{header: `<img src='${'./assets/osm-logo.svg'}'>`, content: Translations.t.general.openStreetMapIntro},
|
||||||
{header: `<img src='${'./assets/share.svg'}'>`, content: new ShareScreen()},
|
|
||||||
{header: `<img src='${'./assets/add.svg'}'>`, content: new MoreScreen()},
|
]
|
||||||
])
|
|
||||||
|
if (State.state.featureSwitchShareScreen.data) {
|
||||||
|
tabs.push({header: `<img src='${'./assets/share.svg'}'>`, content: new ShareScreen()});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (State.state.featureSwitchMoreQuests.data) {
|
||||||
|
tabs.push({header: `<img src='${'./assets/add.svg'}'>`, content: new MoreScreen()});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const fullOptions = new TabbedComponent(tabs);
|
||||||
|
|
||||||
return fullOptions;
|
return fullOptions;
|
||||||
|
|
||||||
|
@ -129,9 +138,7 @@ export class InitUiElements {
|
||||||
static InitBaseMap(){
|
static InitBaseMap(){
|
||||||
State.state.bm = new Basemap("leafletDiv", State.state.locationControl, new VariableUiElement(
|
State.state.bm = new Basemap("leafletDiv", State.state.locationControl, new VariableUiElement(
|
||||||
State.state.locationControl.map((location) => {
|
State.state.locationControl.map((location) => {
|
||||||
const mapComplete = "<a href='https://github.com/pietervdvn/MapComplete' target='_blank'>Mapcomple</a> " +
|
const mapComplete = `<a href='https://github.com/pietervdvn/MapComplete' target='_blank'>Mapcomple ${State.vNumber}</a> <a href='https://github.com/pietervdvn/MapComplete/issues' target='_blank'><img src='./assets/bug.svg' alt='Report bug' class='small-userbadge-icon'></a>`;
|
||||||
" " +
|
|
||||||
"<a href='https://github.com/pietervdvn/MapComplete/issues' target='_blank'><img src='./assets/bug.svg' alt='Report bug' class='small-userbadge-icon'></a>";
|
|
||||||
let editHere = "";
|
let editHere = "";
|
||||||
if (location !== undefined) {
|
if (location !== undefined) {
|
||||||
editHere = " | " +
|
editHere = " | " +
|
||||||
|
|
|
@ -236,9 +236,8 @@ export class FilteredLayer {
|
||||||
const style = self._style(feature.properties);
|
const style = self._style(feature.properties);
|
||||||
if (State.state.selectedElement.data?.feature === feature) {
|
if (State.state.selectedElement.data?.feature === feature) {
|
||||||
if (style.weight !== undefined) {
|
if (style.weight !== undefined) {
|
||||||
style.weight = style.weight * 2;
|
style.weight = style.weight * 1.8;
|
||||||
}else{
|
}else{
|
||||||
style.weight = 20;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
|
|
|
@ -241,7 +241,7 @@ export class Changes {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let changes = "<osmChange version='0.6' generator='Mapcomplete 0.0.1'>";
|
let changes = `<osmChange version='0.6' generator='Mapcomplete ${State.vNumber}'>`;
|
||||||
|
|
||||||
if (creations.length > 0) {
|
if (creations.length > 0) {
|
||||||
changes +=
|
changes +=
|
||||||
|
|
7
State.ts
7
State.ts
|
@ -24,7 +24,7 @@ export class State {
|
||||||
// The singleton of the global state
|
// The singleton of the global state
|
||||||
public static state: State;
|
public static state: State;
|
||||||
|
|
||||||
public static vNumber = "0.0.1";
|
public static vNumber = "0.0.2";
|
||||||
|
|
||||||
public static runningFromConsole: boolean = false;
|
public static runningFromConsole: boolean = false;
|
||||||
|
|
||||||
|
@ -91,6 +91,8 @@ export class State {
|
||||||
public readonly featureSwitchAddNew: UIEventSource<boolean>;
|
public readonly featureSwitchAddNew: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchWelcomeMessage: UIEventSource<boolean>;
|
public readonly featureSwitchWelcomeMessage: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchIframe: UIEventSource<boolean>;
|
public readonly featureSwitchIframe: UIEventSource<boolean>;
|
||||||
|
public readonly featureSwitchMoreQuests: UIEventSource<boolean>;
|
||||||
|
public readonly featureSwitchShareScreen: UIEventSource<boolean>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,7 +150,8 @@ export class State {
|
||||||
this.featureSwitchAddNew = featSw("fs-add-new", (layoutToUse) => layoutToUse?.enableAdd);
|
this.featureSwitchAddNew = featSw("fs-add-new", (layoutToUse) => layoutToUse?.enableAdd);
|
||||||
this.featureSwitchWelcomeMessage = featSw("fs-welcome-message", () => true);
|
this.featureSwitchWelcomeMessage = featSw("fs-welcome-message", () => true);
|
||||||
this.featureSwitchIframe = featSw("fs-iframe", () => false);
|
this.featureSwitchIframe = featSw("fs-iframe", () => false);
|
||||||
|
this.featureSwitchMoreQuests = featSw("fs-more-quests", () => layoutToUse?.enableMoreQuests);
|
||||||
|
this.featureSwitchShareScreen = featSw("fs-share-screen", () => layoutToUse?.enableShareScreen);
|
||||||
|
|
||||||
this.osmConnection = new OsmConnection(
|
this.osmConnection = new OsmConnection(
|
||||||
QueryParameters.GetQueryParameter("test", "false").data === "true",
|
QueryParameters.GetQueryParameter("test", "false").data === "true",
|
||||||
|
|
|
@ -68,7 +68,9 @@ export class SimpleAddUI extends UIElement {
|
||||||
() => {
|
() => {
|
||||||
self.confirmButton = new SubtleButton(preset.icon,
|
self.confirmButton = new SubtleButton(preset.icon,
|
||||||
new Combine([
|
new Combine([
|
||||||
|
"<b>",
|
||||||
Translations.t.general.add.confirmButton.Subs({category: preset.title}),
|
Translations.t.general.add.confirmButton.Subs({category: preset.title}),
|
||||||
|
"</b><br/>",
|
||||||
preset.description !== undefined ? preset.description : ""]));
|
preset.description !== undefined ? preset.description : ""]));
|
||||||
self.confirmButton.onClick(self.CreatePoint(preset.tags, layer));
|
self.confirmButton.onClick(self.CreatePoint(preset.tags, layer));
|
||||||
self._confirmPreset.setData({
|
self._confirmPreset.setData({
|
||||||
|
|
Loading…
Reference in a new issue