Various small fixes

This commit is contained in:
Pieter Vander Vennet 2020-08-07 00:45:33 +02:00
parent 2bfeb67a3a
commit bd43e2537f
8 changed files with 32 additions and 18 deletions

View file

@ -114,7 +114,6 @@ export class NatureReserves extends LayerDefinition {
let colormapping = {
0: "#00bb00",
1: "#00ff00",
10: "#dddd00",
20: "#ff0000"
};

View file

@ -30,14 +30,16 @@ export class Layout {
public enableUserBadge: boolean = true;
public enableSearch: boolean = true;
public enableLayers: boolean = true;
public enableMoreQuests: boolean = true;
public enableShareScreen: boolean = true;
public hideFromOverview : boolean = false;
public hideFromOverview: boolean = false;
/**
* The BBOX of the currently visible map are widened by this factor, in order to make some panning possible.
* This number influences this
*/
public widenFactor : number = 0.07;
public widenFactor: number = 0.07;
/**
*

View file

@ -56,5 +56,7 @@ export class Groen extends Layout {
this.locationContains = ["buurtnatuur.be"]
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.enableMoreQuests = false;
this.enableShareScreen = false
}
}

View file

@ -53,13 +53,22 @@ export class InitUiElements {
welcome = new CustomLayersPanel();
}
const fullOptions = new TabbedComponent([
const tabs = [
{header: `<img src='${layoutToUse.icon}'>`, content: welcome},
{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;
@ -129,9 +138,7 @@ export class InitUiElements {
static InitBaseMap(){
State.state.bm = new Basemap("leafletDiv", State.state.locationControl, new VariableUiElement(
State.state.locationControl.map((location) => {
const mapComplete = "<a href='https://github.com/pietervdvn/MapComplete' target='_blank'>Mapcomple</a> " +
" " +
"<a href='https://github.com/pietervdvn/MapComplete/issues' target='_blank'><img src='./assets/bug.svg' alt='Report bug' class='small-userbadge-icon'></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>`;
let editHere = "";
if (location !== undefined) {
editHere = " | " +

View file

@ -236,9 +236,8 @@ export class FilteredLayer {
const style = self._style(feature.properties);
if (State.state.selectedElement.data?.feature === feature) {
if (style.weight !== undefined) {
style.weight = style.weight * 2;
style.weight = style.weight * 1.8;
}else{
style.weight = 20;
}
}
return style;

View file

@ -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) {
changes +=

View file

@ -24,7 +24,7 @@ export class State {
// The singleton of the global state
public static state: State;
public static vNumber = "0.0.1";
public static vNumber = "0.0.2";
public static runningFromConsole: boolean = false;
@ -91,6 +91,8 @@ export class State {
public readonly featureSwitchAddNew: UIEventSource<boolean>;
public readonly featureSwitchWelcomeMessage: 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.featureSwitchWelcomeMessage = featSw("fs-welcome-message", () => true);
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(
QueryParameters.GetQueryParameter("test", "false").data === "true",

View file

@ -68,7 +68,9 @@ export class SimpleAddUI extends UIElement {
() => {
self.confirmButton = new SubtleButton(preset.icon,
new Combine([
"<b>",
Translations.t.general.add.confirmButton.Subs({category: preset.title}),
"</b><br/>",
preset.description !== undefined ? preset.description : ""]));
self.confirmButton.onClick(self.CreatePoint(preset.tags, layer));
self._confirmPreset.setData({