diff --git a/components/src/components/Map/services/BCGeocoderProvider.ts b/components/src/components/Map/services/BCGeocoderProvider.ts index d8cae43b9..3fa9db72c 100644 --- a/components/src/components/Map/services/BCGeocoderProvider.ts +++ b/components/src/components/Map/services/BCGeocoderProvider.ts @@ -2,17 +2,16 @@ import { OpenStreetMapProvider } from 'leaflet-geosearch'; import { EndpointArgument } from 'leaflet-geosearch/dist/providers/provider'; export class BCGeocoderProvider extends OpenStreetMapProvider { - endpoint({ query, type }: EndpointArgument): string { - console.log(query); + endpoint = ({ query, type }: EndpointArgument): string => { return this.getUrl(import.meta.env.VITE_CHEFS_GEO_ADDRESS_APIURL, { addressString: query as string, }); - } - parse({ data }) { + }; + parse = ({ data }) => { return data.features .filter(function (feature) { if (!feature.geometry.coordinates) return false; - if (feature.properties.fullAddress == 'BC') return false; + if (feature.properties.fullAddress === 'BC') return false; return true; }) .map(function (feature) { @@ -24,5 +23,5 @@ export class BCGeocoderProvider extends OpenStreetMapProvider { raw: feature, }; }); - } + }; } diff --git a/components/src/components/Map/services/MapService.ts b/components/src/components/Map/services/MapService.ts index 3cccb849b..80197ea40 100644 --- a/components/src/components/Map/services/MapService.ts +++ b/components/src/components/Map/services/MapService.ts @@ -156,9 +156,11 @@ class MapService { provider: new BCGeocoderProvider(), style: 'bar', position: 'bottomleft', + showMarker: false, }); map.addControl(geocoderControl); map.on('geosearch/showlocation', (e) => { + console.log((e as any).location); L.popup() .setLatLng([(e as any).location.y, (e as any).location.x]) .setContent(`${(e as any).location.label}`)