diff --git a/components/src/maplibre/Geocoder/Geocoder.svelte b/components/src/maplibre/Geocoder/Geocoder.svelte index ebacb64a..3c2d0694 100644 --- a/components/src/maplibre/Geocoder/Geocoder.svelte +++ b/components/src/maplibre/Geocoder/Geocoder.svelte @@ -1,6 +1,9 @@ -
+ diff --git a/components/src/maplibre/Geocoder/GeocoderAPIs.ts b/components/src/maplibre/Geocoder/GeocoderAPIs.ts index 5cd82931..de565fc0 100644 --- a/components/src/maplibre/Geocoder/GeocoderAPIs.ts +++ b/components/src/maplibre/Geocoder/GeocoderAPIs.ts @@ -24,6 +24,7 @@ export class MaptilerGeocoderAPI implements MaplibreGeocoderApi { country: config.countries || '', language: config.language || '', types: config.types || '', + bbox: config.bbox?.join(',') || '', key: this.key || '' }).filter(([_, value]) => { return value !== ''; diff --git a/components/src/maplibre/Geocoder/GeocoderProps.ts b/components/src/maplibre/Geocoder/GeocoderProps.ts index 8b1b2a71..1592cc19 100644 --- a/components/src/maplibre/Geocoder/GeocoderProps.ts +++ b/components/src/maplibre/Geocoder/GeocoderProps.ts @@ -1,38 +1,41 @@ -import { Map } from "maplibre-gl"; +import { Map } from 'maplibre-gl'; import { - type GeocodingCountry, - type GeocodingLanguage, - type GeocodingPlaceType, - type GeocodingService - } from '../types'; - + type GeocodingCountry, + type GeocodingLanguage, + type GeocodingPlaceType, + type GeocodingService +} from '../types'; export default interface GeocoderProps { - map?: Map | null - service: GeocodingService; - /** - * API key for selected geocoding `service` - */ - key: string; - /** - * Limit the number of returned suggestions - */ - limit?: number; - /** - * Limit search to one or more countries - */ - countries?: GeocodingCountry | GeocodingCountry[]; - /** - * Limit search to one or more result type. - */ - types?: GeocodingPlaceType | GeocodingPlaceType[]; - /** - * Limit search to one or more languages. The UI is localised to the first language specified if [available](https://github.com/maplibre/maplibre-gl-geocoder/blob/main/lib/localization.ts). - */ - languages?: GeocodingLanguage | GeocodingLanguage[]; - /** - * Overwrite the default input placeholder - */ - placeholder?: string; - size?: "small" | "default" - } + map?: Map | null; + service: GeocodingService; + /** + * API key for selected geocoding `service` + */ + key: string; + /** + * Limit the number of returned suggestions + */ + limit?: number; + /** + * Limit search to one or more countries + */ + countries?: GeocodingCountry | GeocodingCountry[]; + /** + * Limit search to one or more result type + */ + types?: GeocodingPlaceType | GeocodingPlaceType[]; + /** + * Limit search to a [w, s, e, n] bounding box + */ + bbox?: number[]; + /** + * Limit search to one or more languages. The UI is localised to the first language specified if [available](https://github.com/maplibre/maplibre-gl-geocoder/blob/main/lib/localization.ts). + */ + languages?: GeocodingLanguage | GeocodingLanguage[]; + /** + * Overwrite the default input placeholder + */ + placeholder?: string; + size?: 'small' | 'default'; +} diff --git a/components/src/maplibre/GeocoderControl/GeocoderAPIs.ts b/components/src/maplibre/GeocoderControl/GeocoderAPIs.ts index 5cd82931..de565fc0 100644 --- a/components/src/maplibre/GeocoderControl/GeocoderAPIs.ts +++ b/components/src/maplibre/GeocoderControl/GeocoderAPIs.ts @@ -24,6 +24,7 @@ export class MaptilerGeocoderAPI implements MaplibreGeocoderApi { country: config.countries || '', language: config.language || '', types: config.types || '', + bbox: config.bbox?.join(',') || '', key: this.key || '' }).filter(([_, value]) => { return value !== ''; diff --git a/components/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte b/components/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte index 36862a7c..b127cc63 100644 --- a/components/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte +++ b/components/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte @@ -34,11 +34,7 @@