diff --git a/Logic/FeatureSource/Sources/NewGeometryFromChangesFeatureSource.ts b/Logic/FeatureSource/Sources/NewGeometryFromChangesFeatureSource.ts index 1e44d9a06..d8c6faa9c 100644 --- a/Logic/FeatureSource/Sources/NewGeometryFromChangesFeatureSource.ts +++ b/Logic/FeatureSource/Sources/NewGeometryFromChangesFeatureSource.ts @@ -84,8 +84,8 @@ export class NewGeometryFromChangesFeatureSource implements FeatureSource { } try { - const tags: OsmTags = { - id: (change.type + "/" + change.id), + const tags: OsmTags & {id: OsmId & string} = { + id: (change.type + "/" + change.id), } for (const kv of change.tags) { tags[kv.k] = kv.v diff --git a/Logic/Osm/Actions/ReplaceGeometryAction.ts b/Logic/Osm/Actions/ReplaceGeometryAction.ts index c2020d36d..c8104f55e 100644 --- a/Logic/Osm/Actions/ReplaceGeometryAction.ts +++ b/Logic/Osm/Actions/ReplaceGeometryAction.ts @@ -13,6 +13,7 @@ import { Utils } from "../../../Utils" import { OsmConnection } from "../OsmConnection" import { Feature } from "@turf/turf" import FeaturePipeline from "../../FeatureSource/FeaturePipeline" +import {Geometry, LineString, Point, Polygon} from "geojson"; export default class ReplaceGeometryAction extends OsmChangeAction { /** @@ -84,7 +85,7 @@ export default class ReplaceGeometryAction extends OsmChangeAction { public async getPreview(): Promise { const { closestIds, allNodesById, detachedNodes, reprojectedNodes } = await this.GetClosestIds() - const preview: Feature[] = closestIds.map((newId, i) => { + const preview: Feature [] = closestIds.map((newId, i) => { if (this.identicalTo[i] !== undefined) { return undefined } @@ -121,7 +122,7 @@ export default class ReplaceGeometryAction extends OsmChangeAction { reprojectedNodes.forEach(({ newLat, newLon, nodeId }) => { const origNode = allNodesById.get(nodeId) - const feature: Feature = { + const feature: Feature = { type: "Feature", properties: { move: "yes", @@ -143,7 +144,7 @@ export default class ReplaceGeometryAction extends OsmChangeAction { detachedNodes.forEach(({ reason }, id) => { const origNode = allNodesById.get(id) - const feature: Feature = { + const feature: Feature = { type: "Feature", properties: { detach: "yes", @@ -389,7 +390,7 @@ export default class ReplaceGeometryAction extends OsmChangeAction { const node = allNodesById.get(id) // Project the node onto the target way to calculate the new coordinates - const way = { + const way = > { type: "Feature", properties: {}, geometry: { diff --git a/UI/BigComponents/SimpleAddUI.ts b/UI/BigComponents/SimpleAddUI.ts index b69948eae..e01805883 100644 --- a/UI/BigComponents/SimpleAddUI.ts +++ b/UI/BigComponents/SimpleAddUI.ts @@ -26,6 +26,7 @@ import BaseLayer from "../../Models/BaseLayer" import Loading from "../Base/Loading" import Hash from "../../Logic/Web/Hash" import { GlobalFilter } from "../../Logic/State/MapState" +import {WayId} from "../../Models/OsmFeature"; /* * The SimpleAddUI is a single panel, which can have multiple states: @@ -123,13 +124,13 @@ export default class SimpleAddUI extends Toggle { function confirm( tags: any[], location: { lat: number; lon: number }, - snapOntoWayId?: string + snapOntoWayId?: WayId ) { if (snapOntoWayId === undefined) { createNewPoint(tags, location, undefined) } else { OsmObject.DownloadObject(snapOntoWayId).addCallbackAndRunD((way) => { - createNewPoint(tags, location, way) + createNewPoint(tags, location, way) return true }) } diff --git a/UI/NewPoint/ConfirmLocationOfPoint.ts b/UI/NewPoint/ConfirmLocationOfPoint.ts index 9e9fdc578..4afbfd779 100644 --- a/UI/NewPoint/ConfirmLocationOfPoint.ts +++ b/UI/NewPoint/ConfirmLocationOfPoint.ts @@ -18,6 +18,7 @@ import Title from "../Base/Title" import { GlobalFilter } from "../../Logic/State/MapState" import { VariableUiElement } from "../Base/VariableUIElement" import { Tag } from "../../Logic/Tags/Tag" +import {WayId} from "../../Models/OsmFeature"; export default class ConfirmLocationOfPoint extends Combine { constructor( @@ -35,7 +36,7 @@ export default class ConfirmLocationOfPoint extends Combine { confirm: ( tags: any[], location: { lat: number; lon: number }, - snapOntoWayId: string + snapOntoWayId: WayId | undefined ) => void, cancel: () => void, closePopup: () => void