forked from MapComplete/MapComplete
Change centerpoint from _lat, _lon to calculated centerpoint, fixes #738
This commit is contained in:
parent
cce838669f
commit
3f5a166f86
1 changed files with 3 additions and 1 deletions
|
@ -30,6 +30,7 @@ import Img from "../Base/Img";
|
||||||
import FeaturePipelineState from "../../Logic/State/FeaturePipelineState";
|
import FeaturePipelineState from "../../Logic/State/FeaturePipelineState";
|
||||||
import Title from "../Base/Title";
|
import Title from "../Base/Title";
|
||||||
import {OsmConnection} from "../../Logic/Osm/OsmConnection";
|
import {OsmConnection} from "../../Logic/Osm/OsmConnection";
|
||||||
|
import {GeoOperations} from "../../Logic/GeoOperations";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the question element.
|
* Shows the question element.
|
||||||
|
@ -414,9 +415,10 @@ export default class TagRenderingQuestion extends Combine {
|
||||||
|
|
||||||
const tagsData = tags.data;
|
const tagsData = tags.data;
|
||||||
const feature = state.allElements.ContainingFeatures.get(tagsData.id)
|
const feature = state.allElements.ContainingFeatures.get(tagsData.id)
|
||||||
|
const center = GeoOperations.centerpointCoordinates(feature)
|
||||||
const input: InputElement<string> = ValidatedTextField.ForType(configuration.freeform.type).ConstructInputElement({
|
const input: InputElement<string> = ValidatedTextField.ForType(configuration.freeform.type).ConstructInputElement({
|
||||||
country: () => tagsData._country,
|
country: () => tagsData._country,
|
||||||
location: [tagsData._lat, tagsData._lon],
|
location: [center[1], center[0]],
|
||||||
mapBackgroundLayer: state.backgroundLayer,
|
mapBackgroundLayer: state.backgroundLayer,
|
||||||
unit: applicableUnit,
|
unit: applicableUnit,
|
||||||
args: configuration.freeform.helperArgs,
|
args: configuration.freeform.helperArgs,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue