UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

19 lines (18 loc) • 744 B
/** Maximal distance, in meters, between a click on the map and the footage displayed for it. */ export const DEFAULT_STREETVIEW_SEARCH_RADIUS = 100; export function initConfigStreetView(config) { const streetview = config.streetview; if (!streetview) { return undefined; } if (streetview.google && !streetview.google.apiKey) { throw new Error(`Configuration for streetview.google requires an apiKey. See https://doc.geogirafe.org/docs/configuration`); } return { searchRadius: streetview.searchRadius ?? DEFAULT_STREETVIEW_SEARCH_RADIUS, google: streetview.google }; } export function isStreetViewProviderConfigured(config, provider) { return config?.[provider] !== undefined; }