forked from MapComplete/MapComplete
Further work on the road splitting feature
This commit is contained in:
parent
9348a019d6
commit
1da3f8a332
9 changed files with 351 additions and 274 deletions
35
test.ts
35
test.ts
|
@ -1,6 +1,5 @@
|
|||
import SplitRoadWizard from "./UI/Popup/SplitRoadWizard";
|
||||
import State from "./State";
|
||||
import {AllKnownLayouts} from "./Customizations/AllKnownLayouts";
|
||||
import SplitAction from "./Logic/Osm/SplitAction";
|
||||
import {GeoOperations} from "./Logic/GeoOperations";
|
||||
|
||||
const way = {
|
||||
"type": "Feature",
|
||||
|
@ -47,7 +46,31 @@ const way = {
|
|||
}
|
||||
}
|
||||
|
||||
State.state = new State(AllKnownLayouts.allKnownLayouts.get("fietsstraten"));
|
||||
let splitPoint = {
|
||||
"type": "Feature",
|
||||
"properties": {},
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
4.490211009979248,
|
||||
51.2041509326002
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let splitClose = {
|
||||
"type": "Feature",
|
||||
"properties": {},
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
4.489563927054405,
|
||||
51.2047546593862
|
||||
]
|
||||
}
|
||||
}
|
||||
// State.state = new State(AllKnownLayouts.allKnownLayouts.get("fietsstraten"));
|
||||
// add road to state
|
||||
State.state.allElements.addOrGetElement(way);
|
||||
new SplitRoadWizard("way/23583625").AttachTo("maindiv")
|
||||
// State.state.allElements.addOrGetElement(way);
|
||||
new SplitAction(way).DoSplit([splitPoint, splitClose].map(p => GeoOperations.nearestPoint(way,<[number, number]> p.geometry.coordinates)))
|
Loading…
Add table
Add a link
Reference in a new issue