forked from MapComplete/MapComplete
Merge branches
This commit is contained in:
commit
19f69b31a4
24 changed files with 676 additions and 110 deletions
45
test.ts
45
test.ts
|
@ -1,14 +1,37 @@
|
|||
import {TabbedComponent} from "./UI/Base/TabbedComponent";
|
||||
import {FixedUiElement} from "./UI/Base/FixedUiElement";
|
||||
import {Bookcases} from "./Customizations/Layouts/Bookcases";
|
||||
import {ShareScreen} from "./UI/ShareScreen";
|
||||
import {UIEventSource} from "./UI/UIEventSource";
|
||||
|
||||
import { And, Tag, Or } from "./Logic/TagsFilter";
|
||||
import { Overpass } from "./Logic/Overpass";
|
||||
|
||||
|
||||
const layout = new Bookcases();
|
||||
function anyValueExcept(key: string, exceptValue: string) {
|
||||
return new And([
|
||||
new Tag(key, "*"),
|
||||
new Tag(key, exceptValue, true)
|
||||
])
|
||||
}
|
||||
|
||||
new ShareScreen(layout, new UIEventSource<{zoom: number, lat: number, lon: number}>({
|
||||
zoom: 16,
|
||||
lat: 51.5,
|
||||
lon:3.2
|
||||
})).AttachTo("maindiv")
|
||||
const sellsBikes = new Tag("service:bicycle:retail", "yes")
|
||||
const repairsBikes = anyValueExcept("service:bicycle:repair", "no")
|
||||
const rentsBikes = new Tag("service:bicycle:rental", "yes")
|
||||
const hasPump = new Tag("service:bicycle:pump", "yes")
|
||||
const hasDiy = new Tag("service:bicycle:diy", "yes")
|
||||
const sellsSecondHand = anyValueExcept("service:bicycle:repair", "no")
|
||||
const hasBikeServices = new Or([
|
||||
sellsBikes,
|
||||
repairsBikes,
|
||||
rentsBikes,
|
||||
hasPump,
|
||||
hasDiy,
|
||||
sellsSecondHand
|
||||
])
|
||||
|
||||
const overpassFilter = new And([
|
||||
new Tag("shop", "bicycle", true),
|
||||
hasBikeServices
|
||||
])
|
||||
|
||||
const overpass = new Overpass(overpassFilter)
|
||||
|
||||
// console.log(overpass.buildQuery('bbox:51.12246976163816,3.1045767593383795,51.289518504257174,3.2848313522338866'))
|
||||
|
||||
console.log(overpassFilter.asOverpass())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue