forked from MapComplete/MapComplete
More search functionality
This commit is contained in:
parent
5d0de8520b
commit
1c46a65c84
25 changed files with 962 additions and 846 deletions
|
@ -18,12 +18,15 @@ export class RecentSearch {
|
|||
|
||||
|
||||
state.selectedElement.addCallbackAndRunD(selected => {
|
||||
|
||||
const [osm_type, osm_id] = selected.properties.id.split("/")
|
||||
if(!osm_id){
|
||||
return
|
||||
}
|
||||
const [lon, lat] = GeoOperations.centerpointCoordinates(selected)
|
||||
const entry = <GeoCodeResult>{
|
||||
feature: selected,
|
||||
osm_id, osm_type,
|
||||
description: "Viewed recently",
|
||||
lon, lat
|
||||
}
|
||||
this.addSelected(entry)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue