forked from MapComplete/MapComplete
Fix various bugs; improve UK-addresses theme
This commit is contained in:
parent
e20cf0abfa
commit
8ca9e4f36c
20 changed files with 357 additions and 164 deletions
|
|
@ -23,8 +23,8 @@ export default class EditableTagRendering extends Toggle {
|
|||
) {
|
||||
|
||||
// The tagrendering is hidden if:
|
||||
// The answer is unknown. The questionbox will then show the question
|
||||
// There is a condition hiding the answer
|
||||
// - The answer is unknown. The questionbox will then show the question
|
||||
// - There is a condition hiding the answer
|
||||
const renderingIsShown = tags.map(tags =>
|
||||
configuration.IsKnown(tags) &&
|
||||
(configuration?.condition?.matchesProperties(tags) ?? true))
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
|||
|
||||
/**
|
||||
* Returns true if this tag rendering has a minimap in some language.
|
||||
* Note: this might be hidden by conditions
|
||||
* Note: this minimap can be hidden by conditions
|
||||
*/
|
||||
private static hasMinimap(renderingConfig: TagRenderingConfig): boolean {
|
||||
const translations: Translation[] = Utils.NoNull([renderingConfig.render, ...(renderingConfig.mappings ?? []).map(m => m.then)]);
|
||||
|
|
|
|||
|
|
@ -68,10 +68,11 @@ export default class QuestionBox extends VariableUiElement {
|
|||
if (tagRendering.IsKnown(tags)) {
|
||||
continue;
|
||||
}
|
||||
if (tagRendering.condition &&
|
||||
!tagRendering.condition.matchesProperties(tags)) {
|
||||
// Filtered away by the condition, so it is kindof known
|
||||
continue;
|
||||
if (tagRendering.condition) {
|
||||
if (!tagRendering.condition.matchesProperties(tags)) {
|
||||
// Filtered away by the condition, so it is kindof known
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// this value is NOT known - this is the question we have to show!
|
||||
|
|
@ -79,7 +80,7 @@ export default class QuestionBox extends VariableUiElement {
|
|||
}
|
||||
return undefined; // The questions are depleted
|
||||
}, [skippedQuestions]);
|
||||
|
||||
|
||||
const questionsToAsk: UIEventSource<BaseUIElement[]> = tagsSource.map(tags => {
|
||||
if (tags === undefined) {
|
||||
return [];
|
||||
|
|
|
|||
|
|
@ -148,11 +148,12 @@ export default class ShowDataLayer {
|
|||
const mp = options.leafletMap.data;
|
||||
|
||||
if(mp === null){
|
||||
return true; // Unregister as the map is destroyed
|
||||
return true; // Unregister as the map has been destroyed
|
||||
}
|
||||
if (mp === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._cleanCount++
|
||||
// clean all the old stuff away, if any
|
||||
if (this.geoLayer !== undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue