Add a 'more quests'-screen

This commit is contained in:
Pieter Vander Vennet 2020-07-29 15:48:21 +02:00
parent 19f69b31a4
commit f9e0735378
6 changed files with 113 additions and 56 deletions

39
test.ts
View file

@ -1,37 +1,4 @@
import {MoreScreen} from "./UI/MoreScreen";
import {UIEventSource} from "./UI/UIEventSource";
import { And, Tag, Or } from "./Logic/TagsFilter";
import { Overpass } from "./Logic/Overpass";
function anyValueExcept(key: string, exceptValue: string) {
return new And([
new Tag(key, "*"),
new Tag(key, exceptValue, true)
])
}
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())
new MoreScreen(new UIEventSource<{zoom: number, lat: number, lon: number}>({zoom: 16, lat: 51.3, lon: 3.2})).AttachTo("maindiv")