Add a wikidata search box

This commit is contained in:
Pieter Vander Vennet 2021-10-08 04:33:39 +02:00
parent 54bc4f24da
commit b5a2ee1757
21 changed files with 4141 additions and 3590 deletions

28
test.ts
View file

@ -1,26 +1,6 @@
import FeatureInfoBox from "./UI/Popup/FeatureInfoBox";
import WikidataPreviewBox from "./UI/Wikipedia/WikidataPreviewBox";
import {UIEventSource} from "./Logic/UIEventSource";
import AllKnownLayers from "./Customizations/AllKnownLayers";
import State from "./State";
import {AllKnownLayouts} from "./Customizations/AllKnownLayouts";
import Wikidata from "./Logic/Web/Wikidata";
import WikidataSearchBox from "./UI/Wikipedia/WikidataSearchBox";
State.state = new State(AllKnownLayouts.allKnownLayouts.get("charging_stations"))
State.state.changes.pendingChanges.setData([])
const geojson = {
type: "Feature",
geometry: {
type: "Point",
coordinates: [51.0, 4]
},
properties:
{
id: "node/42",
amenity: "charging_station",
}
}
State.state.allElements.addOrGetElement(geojson)
const tags = State.state.allElements.getEventSourceById("node/42")
new FeatureInfoBox(
tags,
AllKnownLayers.sharedLayers.get("charging_station")
).AttachTo("maindiv")
new WikidataSearchBox({searchText: new UIEventSource("Brugge")}).AttachTo("maindiv")