forked from MapComplete/MapComplete
Feature(geocoding): pressing enter will now zoom to the first search result; refactor away type synonym
This commit is contained in:
parent
9e8aaab086
commit
686ad70511
8 changed files with 64 additions and 49 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { SearchResult } from "./GeocodingProvider"
|
||||
import { GeocodeResult } from "./GeocodingProvider"
|
||||
import { Store } from "../UIEventSource"
|
||||
import { FeatureSource } from "../FeatureSource/FeatureSource"
|
||||
import { Feature, Geometry } from "geojson"
|
||||
|
|
@ -6,7 +6,7 @@ import { Feature, Geometry } from "geojson"
|
|||
export default class GeocodingFeatureSource implements FeatureSource {
|
||||
public features: Store<Feature<Geometry, Record<string, string>>[]>
|
||||
|
||||
constructor(provider: Store<SearchResult[]>) {
|
||||
constructor(provider: Store<GeocodeResult[]>) {
|
||||
this.features = provider.map((geocoded) => {
|
||||
if (geocoded === undefined) {
|
||||
return []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue