Add check to new points as not to add points for disabled layers
This commit is contained in:
parent
f544ca805a
commit
16394bb08f
2 changed files with 16 additions and 0 deletions
|
@ -46,6 +46,9 @@ export class SimpleAddUI extends UIElement {
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
for (const layer of State.state.filteredLayers.data) {
|
for (const layer of State.state.filteredLayers.data) {
|
||||||
|
|
||||||
|
this.ListenTo(layer.isDisplayed);
|
||||||
|
|
||||||
for (const preset of layer.layerDef.presets) {
|
for (const preset of layer.layerDef.presets) {
|
||||||
|
|
||||||
let icon: string = "./assets/bug.svg";
|
let icon: string = "./assets/bug.svg";
|
||||||
|
@ -130,6 +133,15 @@ export class SimpleAddUI extends UIElement {
|
||||||
const userDetails = State.state.osmConnection.userDetails;
|
const userDetails = State.state.osmConnection.userDetails;
|
||||||
|
|
||||||
if (this._confirmPreset.data !== undefined) {
|
if (this._confirmPreset.data !== undefined) {
|
||||||
|
|
||||||
|
if(!this._confirmPreset.data.layerToAddTo.isDisplayed.data){
|
||||||
|
return new Combine([
|
||||||
|
Translations.t.general.add.layerNotEnabled.Subs({layer: this._confirmPreset.data.layerToAddTo.layerDef.name})
|
||||||
|
.SetClass("alert"),
|
||||||
|
|
||||||
|
this.cancelButton
|
||||||
|
]).Render();
|
||||||
|
}
|
||||||
|
|
||||||
let tagInfo = "";
|
let tagInfo = "";
|
||||||
const csCount = State.state.osmConnection.userDetails.data.csCount;
|
const csCount = State.state.osmConnection.userDetails.data.csCount;
|
||||||
|
|
|
@ -379,6 +379,10 @@ export default class Translations {
|
||||||
fr: "Ajouter un/une {category} ici",
|
fr: "Ajouter un/une {category} ici",
|
||||||
gl: "Engadir {category} aquí",
|
gl: "Engadir {category} aquí",
|
||||||
de: "Hier eine {category} hinzufügen"
|
de: "Hier eine {category} hinzufügen"
|
||||||
|
}),
|
||||||
|
layerNotEnabled: new T({
|
||||||
|
"en":"The layer {layer} is not enabled. Enable this layer to add a point",
|
||||||
|
"nl":"De laag {layer} is gedeactiveerd. Activeer deze om een punt toe te voegn"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pickLanguage: new T({
|
pickLanguage: new T({
|
||||||
|
|
Loading…
Reference in a new issue