forked from MapComplete/MapComplete
Add feature to the featureInfoBox so that geometry is available there as well
This commit is contained in:
parent
1373bd106e
commit
8268c0d054
7 changed files with 39 additions and 18 deletions
10
index.ts
10
index.ts
|
@ -118,7 +118,8 @@ const secondsTillChangesAreSaved = new UIEventSource<number>(0);
|
|||
// This message is shown full screen on mobile devices
|
||||
const fullScreenMessage = new UIEventSource<UIElement>(undefined);
|
||||
|
||||
const selectedElement = new UIEventSource<any>(undefined);
|
||||
// The latest element that was selected - used to generate the right UI at the right place
|
||||
const selectedElement = new UIEventSource<{feature: any}>(undefined);
|
||||
|
||||
|
||||
const locationControl = new UIEventSource<{ lat: number, lon: number, zoom: number }>({
|
||||
|
@ -179,9 +180,10 @@ let minZoom = 0;
|
|||
|
||||
for (const layer of layoutToUse.layers) {
|
||||
|
||||
const generateInfo = (tagsES) => {
|
||||
const generateInfo = (tagsES, feature) => {
|
||||
|
||||
return new FeatureInfoBox(
|
||||
feature,
|
||||
tagsES,
|
||||
layer.title,
|
||||
layer.elementsToShow,
|
||||
|
@ -229,7 +231,8 @@ new StrayClickHandler(bm, selectedElement, fullScreenMessage, () => {
|
|||
/**
|
||||
* Show the questions and information for the selected element on the fullScreen
|
||||
*/
|
||||
selectedElement.addCallback((data) => {
|
||||
selectedElement.addCallback((feature) => {
|
||||
const data = feature.feature.properties;
|
||||
// Which is the applicable set?
|
||||
for (const layer of layoutToUse.layers) {
|
||||
|
||||
|
@ -238,6 +241,7 @@ selectedElement.addCallback((data) => {
|
|||
// This layer is the layer that gives the questions
|
||||
|
||||
const featureBox = new FeatureInfoBox(
|
||||
feature.feature,
|
||||
allElements.getElement(data.id),
|
||||
layer.title,
|
||||
layer.elementsToShow,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue