forked from MapComplete/MapComplete
UX: select closest feature on 'space'
This commit is contained in:
parent
86af270aa0
commit
279eb63f50
1 changed files with 3 additions and 1 deletions
|
@ -357,7 +357,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
||||||
{
|
{
|
||||||
currentZoom: this.mapProperties.zoom,
|
currentZoom: this.mapProperties.zoom,
|
||||||
layerState: this.layerState,
|
layerState: this.layerState,
|
||||||
bounds: this.visualFeedbackViewportBounds,
|
bounds: this.visualFeedbackViewportBounds.map(bounds => bounds ?? this.mapProperties.bounds?.data, [this.mapProperties.bounds]),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
this.featureSummary = this.setupSummaryLayer()
|
this.featureSummary = this.setupSummaryLayer()
|
||||||
|
@ -531,9 +531,11 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
||||||
* Selects the feature that is 'i' closest to the map center
|
* Selects the feature that is 'i' closest to the map center
|
||||||
*/
|
*/
|
||||||
private selectClosestAtCenter(i: number = 0) {
|
private selectClosestAtCenter(i: number = 0) {
|
||||||
|
console.log("Selecting closest",i)
|
||||||
if (this.userRelatedState.a11y.data !== "never") {
|
if (this.userRelatedState.a11y.data !== "never") {
|
||||||
this.visualFeedback.setData(true)
|
this.visualFeedback.setData(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const toSelect = this.closestFeatures.features?.data?.[i]
|
const toSelect = this.closestFeatures.features?.data?.[i]
|
||||||
if (!toSelect) {
|
if (!toSelect) {
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue