Feature(geocoding): pressing enter will now zoom to the first search result; refactor away type synonym

This commit is contained in:
Pieter Vander Vennet 2025-03-11 03:45:11 +01:00
parent 9e8aaab086
commit 686ad70511
8 changed files with 64 additions and 49 deletions

View file

@ -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 []