forked from MapComplete/MapComplete
Merge develop
This commit is contained in:
commit
423618847b
334 changed files with 9307 additions and 6025 deletions
|
@ -58,7 +58,7 @@ import { GeolocationControlState } from "../UI/BigComponents/GeolocationControl"
|
|||
import Zoomcontrol from "../UI/Zoomcontrol"
|
||||
import {
|
||||
SummaryTileSource,
|
||||
SummaryTileSourceRewriter
|
||||
SummaryTileSourceRewriter,
|
||||
} from "../Logic/FeatureSource/TiledFeatureSource/SummaryTileSource"
|
||||
import summaryLayer from "../assets/generated/layers/summary.json"
|
||||
import last_click_layerconfig from "../assets/generated/layers/last_click.json"
|
||||
|
@ -175,7 +175,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
"oauth_token",
|
||||
undefined,
|
||||
"Used to complete the login"
|
||||
)
|
||||
),
|
||||
})
|
||||
this.userRelatedState = new UserRelatedState(
|
||||
this.osmConnection,
|
||||
|
@ -254,8 +254,8 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
bbox.asGeoJson({
|
||||
zoom: this.mapProperties.zoom.data,
|
||||
...this.mapProperties.location.data,
|
||||
id: "current_view_" + currentViewIndex
|
||||
})
|
||||
id: "current_view_" + currentViewIndex,
|
||||
}),
|
||||
]
|
||||
})
|
||||
)
|
||||
|
@ -272,7 +272,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
featurePropertiesStore: this.featureProperties,
|
||||
osmConnection: this.osmConnection,
|
||||
historicalUserLocations: this.geolocation.historicalUserLocations,
|
||||
featureSwitches: this.featureSwitches
|
||||
featureSwitches: this.featureSwitches,
|
||||
},
|
||||
layout?.isLeftRightSensitive() ?? false,
|
||||
(e, extraMsg) => this.reportError(e, extraMsg)
|
||||
|
@ -300,7 +300,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
"leftover features, such as",
|
||||
features[0].properties
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
this.perLayer = perLayer.perLayer
|
||||
|
@ -356,7 +356,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
{
|
||||
currentZoom: this.mapProperties.zoom,
|
||||
layerState: this.layerState,
|
||||
bounds: this.visualFeedbackViewportBounds
|
||||
bounds: this.visualFeedbackViewportBounds,
|
||||
}
|
||||
)
|
||||
this.hasDataInView = new NoElementsInViewDetector(this).hasFeatureInView
|
||||
|
@ -453,7 +453,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
doShowLayer,
|
||||
metaTags: this.userRelatedState.preferencesAsTags,
|
||||
selectedElement: this.selectedElement,
|
||||
fetchStore: (id) => this.featureProperties.getStore(id)
|
||||
fetchStore: (id) => this.featureProperties.getStore(id),
|
||||
})
|
||||
})
|
||||
return filteringFeatureSource
|
||||
|
@ -480,7 +480,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
doShowLayer: flayerGps.isDisplayed,
|
||||
layer: flayerGps.layerDef,
|
||||
metaTags: this.userRelatedState.preferencesAsTags,
|
||||
selectedElement: this.selectedElement
|
||||
selectedElement: this.selectedElement,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -554,11 +554,11 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
this.previewedImage.setData(undefined)
|
||||
return
|
||||
}
|
||||
if(this.searchState.showSearchDrawer.data){
|
||||
if (this.searchState.showSearchDrawer.data){
|
||||
this.searchState.showSearchDrawer.set(false)
|
||||
return
|
||||
}
|
||||
if(this.guistate.closeAll()){
|
||||
if (this.guistate.closeAll()){
|
||||
return
|
||||
}
|
||||
this.selectedElement.setData(undefined)
|
||||
|
@ -573,17 +573,14 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
Hotkeys.RegisterHotkey(
|
||||
{
|
||||
nomod: " ",
|
||||
onUp: true
|
||||
onUp: true,
|
||||
},
|
||||
docs.selectItem,
|
||||
() => {
|
||||
if (this.selectedElement.data !== undefined) {
|
||||
return false
|
||||
}
|
||||
if (
|
||||
this.guistate.isSomethingOpen() ||
|
||||
this.previewedImage.data !== undefined
|
||||
) {
|
||||
if (this.guistate.isSomethingOpen() || this.previewedImage.data !== undefined) {
|
||||
return
|
||||
}
|
||||
if(document.activeElement.tagName === "button" || document.activeElement.tagName === "input"){
|
||||
|
@ -605,7 +602,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
Hotkeys.RegisterHotkey(
|
||||
{
|
||||
nomod: "" + i,
|
||||
onUp: true
|
||||
onUp: true,
|
||||
},
|
||||
doc,
|
||||
() => this.selectClosestAtCenter(i - 1)
|
||||
|
@ -624,7 +621,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
}
|
||||
Hotkeys.RegisterHotkey(
|
||||
{
|
||||
nomod: "b"
|
||||
nomod: "b",
|
||||
},
|
||||
docs.openLayersPanel,
|
||||
() => {
|
||||
|
@ -635,7 +632,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
)
|
||||
Hotkeys.RegisterHotkey(
|
||||
{
|
||||
nomod: "s"
|
||||
nomod: "s",
|
||||
},
|
||||
Translations.t.hotkeyDocumentation.openFilterPanel,
|
||||
() => {
|
||||
|
@ -713,12 +710,12 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
|
||||
Hotkeys.RegisterHotkey(
|
||||
{
|
||||
shift: "T"
|
||||
shift: "T",
|
||||
},
|
||||
Translations.t.hotkeyDocumentation.translationMode,
|
||||
() => {
|
||||
const tm = this.userRelatedState.translationMode
|
||||
if(tm.data === "false"){
|
||||
if (tm.data === "false") {
|
||||
tm.setData("true")
|
||||
} else {
|
||||
tm.setData("false")
|
||||
|
@ -750,7 +747,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
this.mapProperties.zoom.map((z) => Math.max(Math.floor(z), 0)),
|
||||
this.mapProperties,
|
||||
{
|
||||
isActive: this.mapProperties.zoom.map((z) => z < maxzoom)
|
||||
isActive: this.mapProperties.zoom.map((z) => z < maxzoom),
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -837,7 +834,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
doShowLayer: flayer.isDisplayed,
|
||||
layer: flayer.layerDef,
|
||||
metaTags: this.userRelatedState.preferencesAsTags,
|
||||
selectedElement: this.selectedElement
|
||||
selectedElement: this.selectedElement,
|
||||
})
|
||||
})
|
||||
const summaryLayerConfig = new LayerConfig(<LayerConfigJson>summaryLayer, "summaryLayer")
|
||||
|
@ -845,7 +842,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
features: specialLayers.summary,
|
||||
layer: summaryLayerConfig,
|
||||
// doShowLayer: this.mapProperties.zoom.map((z) => z < maxzoom),
|
||||
selectedElement: this.selectedElement
|
||||
selectedElement: this.selectedElement,
|
||||
})
|
||||
|
||||
const lastClickLayerConfig = new LayerConfig(
|
||||
|
@ -856,14 +853,14 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
lastClickLayerConfig.isShown === undefined
|
||||
? specialLayers.last_click
|
||||
: specialLayers.last_click.features.mapD((fs) =>
|
||||
fs.filter((f) => {
|
||||
const matches = lastClickLayerConfig.isShown.matchesProperties(
|
||||
f.properties
|
||||
)
|
||||
console.debug("LastClick ", f, "matches", matches)
|
||||
return matches
|
||||
})
|
||||
)
|
||||
fs.filter((f) => {
|
||||
const matches = lastClickLayerConfig.isShown.matchesProperties(
|
||||
f.properties
|
||||
)
|
||||
console.debug("LastClick ", f, "matches", matches)
|
||||
return matches
|
||||
})
|
||||
)
|
||||
new ShowDataLayer(this.map, {
|
||||
features: new StaticFeatureSource(lastClickFiltered),
|
||||
layer: lastClickLayerConfig,
|
||||
|
@ -874,9 +871,9 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
}
|
||||
this.map.data.flyTo({
|
||||
zoom: Constants.minZoomLevelToAddNewPoint,
|
||||
center: GeoOperations.centerpointCoordinates(feature)
|
||||
center: GeoOperations.centerpointCoordinates(feature),
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -968,7 +965,13 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
} catch (e) {
|
||||
// pass
|
||||
}
|
||||
message = "XMLHttpRequest with status code " + req.status + ", " + req.statusText + ", received: " + body
|
||||
message =
|
||||
"XMLHttpRequest with status code " +
|
||||
req.status +
|
||||
", " +
|
||||
req.statusText +
|
||||
", received: " +
|
||||
body
|
||||
}
|
||||
|
||||
if (extramessage) {
|
||||
|
@ -990,8 +993,8 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
userid: this.osmConnection.userDetails.data?.uid,
|
||||
pendingChanges: this.changes.pendingChanges.data,
|
||||
previousChanges: this.changes.allChanges.data,
|
||||
changeRewrites: Utils.MapToObj(this.changes._changesetHandler._remappings)
|
||||
})
|
||||
changeRewrites: Utils.MapToObj(this.changes._changesetHandler._remappings),
|
||||
}),
|
||||
})
|
||||
} catch (e) {
|
||||
console.error("Could not upload an error report")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue