Add standalone bicycle library theme, search now opens the popup of the found object

This commit is contained in:
Pieter Vander Vennet 2021-01-06 02:09:04 +01:00
parent a35b80afbb
commit c359d43b15
15 changed files with 260 additions and 43 deletions

View file

@ -8,6 +8,7 @@ import State from "../../State";
import {TextField} from "../Input/TextField";
import {Geocoding} from "../../Logic/Osm/Geocoding";
import Translations from "../i18n/Translations";
import Hash from "../../Logic/Web/Hash";
export default class SearchAndGo extends UIElement {
@ -61,11 +62,14 @@ export default class SearchAndGo extends UIElement {
return;
}
const bb = result[0].boundingbox;
const poi = result[0];
const bb = poi.boundingbox;
const bounds: [[number, number], [number, number]] = [
[bb[0], bb[2]],
[bb[1], bb[3]]
]
State.state.selectedElement. setData(undefined);
Hash.hash.setData(poi.osm_type+"_"+poi.osm_id);
State.state.leafletMap.data.fitBounds(bounds);
self._placeholder.setData(Translations.t.general.search.search);
},