From 987d03e3ab3f1806820311f82cf16d760ae096d3 Mon Sep 17 00:00:00 2001 From: Jonathan Lurie Date: Wed, 5 Apr 2023 17:53:28 +0200 Subject: [PATCH] ADD new styles --- dist/maptiler-client.cjs | 30 +++++- dist/maptiler-client.cjs.map | 2 +- dist/maptiler-client.d.ts | 16 ++++ dist/maptiler-client.min.mjs | 2 +- dist/maptiler-client.mjs | 30 +++++- dist/maptiler-client.mjs.map | 2 +- dist/maptiler-client.umd.js | 30 +++++- dist/maptiler-client.umd.js.map | 2 +- dist/maptiler-client.umd.min.js | 2 +- docs/classes/config.ClientConfig.html | 18 ++-- .../services_ServiceError.ServiceError.html | 14 +-- .../language.getAutoLanguageGeocoding.html | 10 +- docs/functions/services_simplify.default.html | 10 +- docs/index.html | 8 +- docs/modules.html | 8 +- docs/modules/config.html | 10 +- docs/modules/language.html | 10 +- docs/modules/services_ServiceError.html | 10 +- docs/modules/services_coordinates.html | 10 +- docs/modules/services_data.html | 10 +- docs/modules/services_geocoding.html | 10 +- docs/modules/services_geolocation.html | 10 +- docs/modules/services_simplify.html | 10 +- docs/modules/services_staticMaps.html | 10 +- docs/types/config.FetchFunction.html | 10 +- .../language.LanguageGeocodingString.html | 10 +- ...services_coordinates.CoordinateExport.html | 10 +- .../services_coordinates.CoordinateGrid.html | 10 +- .../services_coordinates.CoordinateId.html | 10 +- ...services_coordinates.CoordinateSearch.html | 10 +- ...es_coordinates.CoordinateSearchResult.html | 10 +- ...coordinates.CoordinateTransformResult.html | 10 +- ..._coordinates.CoordinateTransformation.html | 10 +- ..._coordinates.CoordinatesSearchOptions.html | 10 +- ...ordinates.CoordinatesTransformOptions.html | 10 +- docs/types/services_coordinates.XYZ.html | 10 +- docs/types/services_data.GetDataOptions.html | 10 +- ...rvices_geocoding.ByIdGeocodingOptions.html | 10 +- ...mmonForwardAndReverseGeocodingOptions.html | 10 +- .../types/services_geocoding.Coordinates.html | 10 +- .../services_geocoding.FeatureHierarchy.html | 10 +- .../services_geocoding.GeocodingFeature.html | 10 +- .../services_geocoding.GeocodingOptions.html | 10 +- ...vices_geocoding.GeocodingSearchResult.html | 10 +- ...es_geocoding.LanguageGeocodingOptions.html | 10 +- ...ces_geocoding.ReverseGeocodingOptions.html | 10 +- ...es_geolocation.GeolocationInfoOptions.html | 10 +- ...ervices_geolocation.GeolocationResult.html | 10 +- ..._staticMaps.AutomaticStaticMapOptions.html | 10 +- ...es_staticMaps.BoundedStaticMapOptions.html | 10 +- ...s_staticMaps.CenteredStaticMapOptions.html | 10 +- ...vices_staticMaps.StaticMapBaseOptions.html | 10 +- .../services_staticMaps.StaticMapMarker.html | 10 +- docs/variables/config.config.html | 10 +- .../variables/language.LanguageGeocoding.html | 10 +- .../services_coordinates.coordinates.html | 10 +- docs/variables/services_data.data.html | 10 +- .../services_geocoding.geocoding.html | 10 +- .../services_geolocation.geolocation.html | 10 +- .../services_staticMaps.staticMaps.html | 10 +- docsmd/README.md | 92 +++++++++---------- docsmd/classes/ClientConfig.md | 10 +- docsmd/classes/MapStyleVariant.md | 26 +++--- docsmd/classes/ReferenceMapStyle.md | 18 ++-- docsmd/classes/ServiceError.md | 6 +- examples/test-browser-umd.html | 12 +-- package.json | 2 +- src/mapstyle.ts | 47 +++++++++- 68 files changed, 496 insertions(+), 351 deletions(-) diff --git a/dist/maptiler-client.cjs b/dist/maptiler-client.cjs index 2f2f45e..a6b7f39 100644 --- a/dist/maptiler-client.cjs +++ b/dist/maptiler-client.cjs @@ -678,6 +678,13 @@ const mapStylePresetList = [ description: "", imageURL: "" }, + { + id: "streets-v2-night", + name: "Night", + variantType: "NIGHT", + description: "", + imageURL: "" + }, { id: "streets-v2-pastel", name: "Pastel", @@ -698,6 +705,13 @@ const mapStylePresetList = [ variantType: "DEFAULT", description: "", imageURL: "" + }, + { + id: "outdoor-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" } ] }, @@ -708,10 +722,17 @@ const mapStylePresetList = [ variants: [ { id: "winter-v2", - name: "Winter", + name: "Default", variantType: "DEFAULT", description: "", imageURL: "" + }, + { + id: "winter-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" } ] }, @@ -832,6 +853,13 @@ const mapStylePresetList = [ description: "", imageURL: "" }, + { + id: "topo-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" + }, { id: "topo-v2-shiny", name: "Shiny", diff --git a/dist/maptiler-client.cjs.map b/dist/maptiler-client.cjs.map index 27a4c72..b35c11a 100644 --- a/dist/maptiler-client.cjs.map +++ b/dist/maptiler-client.cjs.map @@ -1 +1 @@ -{"version":3,"file":"maptiler-client.cjs","sources":["../src/config.ts","../src/language.ts","../src/callFetch.ts","../src/defaults.ts","../src/services/ServiceError.ts","../src/services/geocoding.ts","../src/services/geolocation.ts","../src/services/coordinates.ts","../src/services/data.ts","../src/mapstyle.ts","../src/services/simplify.ts","../src/services/staticMaps.ts"],"sourcesContent":["export type FetchFunction = (url: string, options: object) => Promise;\n\nfunction tryGettingFetch() {\n // this is browser, fetch exists\n if (typeof self !== \"undefined\") {\n return fetch.bind(self);\n }\n\n if (typeof global !== \"undefined\" && global.fetch) {\n return global.fetch;\n }\n\n return null;\n}\n\n/**\n * The configuration object definition\n */\nclass ClientConfig {\n /**\n * MapTiler Cloud API key\n */\n private _apiKey = \"\";\n\n /**\n * The fetch function. To be set if in Node < 18, otherwise\n * will be automatically resolved.\n */\n private _fetch: FetchFunction | null = tryGettingFetch();\n\n /**\n * Set the MapTiler Cloud API key\n */\n set apiKey(k: string) {\n this._apiKey = k;\n }\n\n /**\n * Get the MapTiler Cloud API key\n */\n get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * Set a the custom fetch function to replace the default one\n */\n set fetch(f: FetchFunction) {\n this._fetch = f;\n }\n\n /**\n * Get the fetch fucntion\n */\n get fetch(): FetchFunction | null {\n return this._fetch;\n }\n}\n\n/**\n * Configuration object\n */\nconst config = new ClientConfig();\n\nexport { ClientConfig, config };\n","/**\n * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.\n */\nconst LanguageGeocoding = {\n AUTO: \"auto\",\n ALBANIAN: \"sq\",\n ARABIC: \"ar\",\n ARMENIAN: \"hy\",\n AZERBAIJANI: \"az\",\n BELORUSSIAN: \"be\",\n BOSNIAN: \"bs\",\n BRETON: \"br\",\n BULGARIAN: \"bg\",\n CATALAN: \"ca\",\n CHINESE: \"zh\",\n CROATIAN: \"hr\",\n CZECH: \"cs\",\n DANISH: \"da\",\n DUTCH: \"nl\",\n ENGLISH: \"en\",\n ESPERANTO: \"eo\",\n ESTONIAN: \"et\",\n FINNISH: \"fi\",\n FRENCH: \"fr\",\n FRISIAN: \"fy\",\n GEORGIAN: \"ka\",\n GERMAN: \"de\",\n GREEK: \"el\",\n HEBREW: \"he\",\n HUNGARIAN: \"hu\",\n ICELANDIC: \"is\",\n IRISH: \"ga\",\n ITALIAN: \"it\",\n JAPANESE: \"ja\",\n KANNADA: \"kn\",\n KAZAKH: \"kk\",\n KOREAN: \"ko\",\n ROMAN_LATIN: \"la\",\n LATVIAN: \"lv\",\n LITHUANIAN: \"lt\",\n LUXEMBOURGISH: \"lb\",\n MACEDONIAN: \"mk\",\n MALTESE: \"mt\",\n NORWEGIAN: \"no\",\n POLISH: \"pl\",\n PORTUGUESE: \"pt\",\n ROMANIAN: \"ro\",\n ROMANSH: \"rm\",\n RUSSIAN: \"ru\",\n SCOTTISH_GAELIC: \"gd\",\n SERBIAN_CYRILLIC: \"sr\",\n SLOVAK: \"sk\",\n SLOVENE: \"sl\",\n SPANISH: \"es\",\n SWEDISH: \"sv\",\n THAI: \"th\",\n TURKISH: \"tr\",\n UKRAINIAN: \"uk\",\n WELSH: \"cy\",\n};\n\nconst languageCodeSet = new Set(Object.values(LanguageGeocoding));\n\ntype Values = T[keyof T];\n\n/**\n * Built-in languages values as strings\n */\ntype LanguageGeocodingString = Values;\n\nfunction getAutoLanguageGeocoding(): LanguageGeocodingString {\n if (typeof navigator === \"undefined\") {\n return Intl.DateTimeFormat()\n .resolvedOptions()\n .locale.split(\"-\")[0] as LanguageGeocodingString;\n }\n\n const canditatelangs = Array.from(\n new Set(navigator.languages.map((l) => l.split(\"-\")[0]))\n ).filter((l) => languageCodeSet.has(l as LanguageGeocodingString));\n\n return canditatelangs.length\n ? (canditatelangs[0] as LanguageGeocodingString)\n : LanguageGeocoding.ENGLISH;\n}\n\nexport { LanguageGeocoding, LanguageGeocodingString, getAutoLanguageGeocoding };\n","import { config } from \"./config\";\n\nexport async function callFetch(resource, options = {}) {\n if (config.fetch === null) {\n throw new Error(\n \"The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch\"\n );\n }\n\n // Control if URL contains the api key\n if (new URL(resource).searchParams.get(\"key\").trim() === \"\") {\n throw new Error(\n \"The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com\"\n );\n }\n\n return config.fetch(resource, options);\n}\n","/**\n * Some default settings for the SDK\n */\nconst defaults = {\n maptilerApiURL: \"https://api.maptiler.com/\",\n mapStyle: \"streets-v2\",\n};\n\nObject.freeze(defaults);\n\nexport { defaults };\n","/**\n * A ServiceError is an Error that includes the HTTP response details\n */\nexport class ServiceError extends Error {\n constructor(public res: Response, customMessage = \"\") {\n super(\n `Call to enpoint ${res.url} failed with the status code ${res.status}. ${customMessage}`\n );\n }\n}\n","import { BBox, Feature, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\n\nimport {\n getAutoLanguageGeocoding,\n LanguageGeocoding,\n LanguageGeocodingString,\n} from \"../language\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 400: \"Query too long / Invalid parameters\",\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type LanguageGeocodingOptions = {\n /**\n * Prefer results in specific language. It’s possible to specify multiple values.\n */\n language?: LanguageGeocodingString | Array;\n};\n\nexport type CommonForwardAndReverseGeocodingOptions =\n LanguageGeocodingOptions & {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.\n */\n limit?: number;\n\n /**\n * Filter of feature types to return. If not specified, all available feature types are returned.\n */\n types?: (\n | \"country\"\n | \"region\"\n | \"subregion\"\n | \"county\"\n | \"joint_municipality\"\n | \"joint_submunicipality\"\n | \"municipality\"\n | \"municipal_district\"\n | \"locality\"\n | \"neighbourhood\"\n | \"place\"\n | \"postal_code\"\n | \"address\"\n )[];\n };\n\nexport type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {\n /**\n * Only search for results in the specified area.\n */\n bbox?: BBox;\n\n /**\n * Prefer results close to a specific location.\n */\n proximity?: Position;\n\n /**\n * Limit search to specific country/countries specified as list of Alpha-2 ISO 3166-1 codes.\n */\n country?: string[];\n\n /**\n * Set to `false` to disable fuzzy (typo-tolerant) search. Default is `true`.\n */\n fuzzyMatch?: boolean;\n\n /**\n * Set to `true` to use autocomplete, `false` to disable it.\n * Default (`undefined`) is to combine autocomplete with non-autocomplete results.\n */\n autocomplete?: boolean;\n};\n\nexport type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;\n\nexport type ByIdGeocodingOptions = LanguageGeocodingOptions;\n\nexport type Coordinates = Position;\n\nexport type FeatureHierarchy = {\n /**\n * Unique feature ID\n */\n id: string;\n\n /**\n * Localized feature name\n */\n text: string;\n};\n\nexport type GeocodingFeature = Feature & {\n /**\n * Bounding box of the original feature as [w, s, e, n] array\n */\n bbox: BBox;\n\n /**\n * A [lon, lat] array of the original feature centeroid\n */\n center: Coordinates;\n\n /**\n * Formatted (including the hierarchy) and localized feature full name\n */\n place_name: string;\n\n /**\n * Localized feature name\n */\n text: string;\n\n /**\n * Feature hierarchy\n */\n context?: Array;\n\n /**\n * Address number, if applicable\n */\n address?: string;\n};\n\nexport type GeocodingSearchResult = {\n type: \"FeatureCollection\";\n\n /**\n * Array of features found\n */\n features: Array;\n\n /**\n * Tokenized search query\n */\n query: Array;\n\n /**\n * Attribution of the result\n */\n attribution: string;\n};\n\nfunction addLanguageGeocodingOptions(\n searchParams: URLSearchParams,\n options: LanguageGeocodingOptions\n) {\n if (options.language == undefined) {\n return;\n }\n\n const languages = Array.from(\n new Set(\n (Array.isArray(options.language)\n ? options.language\n : [options.language]\n ).map((lang) =>\n lang === LanguageGeocoding.AUTO ? getAutoLanguageGeocoding() : lang\n )\n )\n ).join(\",\");\n\n searchParams.set(\"language\", languages);\n}\n\nfunction addCommonForwardAndReverseGeocodingOptions(\n searchParams: URLSearchParams,\n options: CommonForwardAndReverseGeocodingOptions\n) {\n searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (options.limit != undefined) {\n searchParams.set(\"limit\", String(options.limit));\n }\n\n if (options.types != undefined) {\n searchParams.set(\"types\", options.types.join(\",\"));\n }\n\n addLanguageGeocodingOptions(searchParams, options);\n}\n\n/**\n * Performs a forward geocoding query to MapTiler API.\n * Providing a human readable place name (of a city, country, street, etc.), the function returns\n * a list of candidate locations including longitude and latitude.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward\n * @param query\n * @param options\n * @returns\n */\nasync function forward(\n query: string,\n options: GeocodingOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `geocoding/${encodeURIComponent(query)}.json`,\n defaults.maptilerApiURL\n );\n\n const { searchParams } = endpoint;\n\n addCommonForwardAndReverseGeocodingOptions(searchParams, options);\n\n if (options.bbox != undefined) {\n searchParams.set(\"bbox\", options.bbox.join(\",\"));\n }\n\n if (options.proximity != undefined) {\n searchParams.set(\"proximity\", options.proximity.join(\",\"));\n }\n\n if (options.country != undefined) {\n searchParams.set(\"country\", options.country.join(\",\"));\n }\n\n if (options.fuzzyMatch != undefined) {\n searchParams.set(\"fuzzyMatch\", options.fuzzyMatch ? \"true\" : \"false\");\n }\n\n if (options.autocomplete != undefined) {\n searchParams.set(\"autocomplete\", options.autocomplete ? \"true\" : \"false\");\n }\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a reverse geocoding query to MapTiler API.\n * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse\n * @param position\n * @param options\n * @returns\n */\nasync function reverse(\n position: Position,\n options: ReverseGeocodingOptions = {}\n): Promise {\n if (!Array.isArray(position) || position.length < 2) {\n throw new Error(\"The position must be an array of form [lng, lat].\");\n }\n\n const endpoint = new URL(\n `geocoding/${position[0]},${position[1]}.json`,\n defaults.maptilerApiURL\n );\n\n addCommonForwardAndReverseGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a geocoding query to MapTiler API to obtain fature by its ID.\n * Providing a feature ID, this function returns a feature which includes its full geometry.\n * Note that the feature ID is not stable and it changes when the database is re-indexed.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id\n * @param id\n * @param options\n * @returns\n */\nasync function byId(\n id: string,\n options: ByIdGeocodingOptions = {}\n): Promise {\n const endpoint = new URL(`geocoding/${id}.json`, defaults.maptilerApiURL);\n\n addLanguageGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * The **geocoding** namespace contains asynchronous functions to call the [MapTiler Geocoding API](https://docs.maptiler.com/cloud/api/geocoding/).\n * The **Geocoding API** provides ways to get geographic coordinates from a human-readable search query of a place (forward geocoding)\n * and to get the location details (country, city, street, etc.) from a geographic coordinate (reverse geocoding);\n */\nconst geocoding = {\n forward,\n reverse,\n byId,\n language: LanguageGeocoding,\n};\n\nexport { geocoding };\n","import { BBox } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GeolocationInfoOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\nexport type GeolocationResult = {\n /**\n * Name of the country\n * Example: Switzerland\n */\n country?: string;\n\n /**\n * Two-letter code of the country ISO 3166-1 alpha-2 codes\n * Example: CH\n */\n country_code?: string;\n\n /**\n * Bounds of the country in WGS84 degrees [west, south, east, north].\n * Example: [5.95538,45.818852,10.490936,47.809357]\n */\n country_bounds?: BBox;\n\n /**\n * Official country languages in ISO 639-1 format. ISO 639-1 codes\n * Example: [\"de\",\"fr\",\"it\"]\n */\n country_languages?: Array;\n\n /**\n * Name of the continent\n * Example: Europe\n */\n continent?: string;\n\n /**\n * Two-letter code of the continent\n * Example: EU\n */\n continent_code?: string;\n\n /**\n * Indicated whether the country is part of the European Union.\n */\n eu?: boolean;\n\n /**\n * Name of the city\n * Example: Zurich\n */\n city?: string;\n\n /**\n * Latitude of the location\n * Example: 47.36667\n */\n latitude?: number;\n\n /**\n * Longitude of the location\n * Example: 8.55\n */\n longitude?: number;\n\n /**\n * Postal code\n * Example: 8000\n */\n postal?: string;\n\n /**\n * If known, the ISO 3166-2 name for the first level region. ISO 3166-2 codes\n * Example: Zurich\n */\n region?: string;\n\n /**\n * If known, the ISO 3166-2 code for the first level region. ISO 3166-2 codes\n * Example: ZH\n */\n region_code?: string;\n\n /**\n * Name of the timezone\n * Example: Europe/Zurich\n */\n timezone?: string;\n};\n\n/**\n * Looks up geolocation details from IP address using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geolocation/#ip-geolocation\n * @returns\n */\nasync function info(\n options: GeolocationInfoOptions = {}\n): Promise {\n const endpoint = new URL(`geolocation/ip.json`, defaults.maptilerApiURL);\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as GeolocationResult;\n}\n\n/**\n * The **geolocation** namespace contains an asynchronous function to call the [MapTiler Geolocation API](https://docs.maptiler.com/cloud/api/geolocation/).\n * The **Geolocation API** provides a way to retrieve the IP address as well as geographic informations of a machine performing the query (most likely: a user)\n */\nconst geolocation = {\n info,\n};\n\nexport { geolocation };\n","import { BBox, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type CoordinatesSearchOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results returned (default: 10)\n */\n limit?: number;\n\n /**\n * Show detailed transformations for each CRS (default: false)\n */\n transformations?: boolean;\n\n /**\n * Show exports in WKT and Proj4 notations (default: false)\n */\n exports?: boolean;\n};\n\nexport type CoordinateId = {\n authority: string;\n code: BigInteger;\n};\n\nexport type CoordinateExport = {\n proj4: string;\n wkt: string;\n};\n\nexport type CoordinateGrid = {\n path: string;\n};\n\nexport type CoordinateTransformation = {\n id: CoordinateId;\n name: string;\n reversible: boolean;\n usable: boolean;\n deprecated: boolean;\n grids: Array;\n accuracy?: number;\n area?: string;\n bbox?: BBox;\n target_crs?: CoordinateId;\n unit?: string;\n};\n\nexport type CoordinateSearch = {\n id: CoordinateId;\n\n name: string;\n\n kind: string;\n\n deprecated: boolean;\n\n transformations?: Array;\n\n accuracy?: number;\n\n unit?: string;\n\n area?: string;\n\n /**\n * Bounding box of the resource in [min_lon, min_lat, max_lon, max_lat] order.\n */\n bbox?: BBox;\n\n /**\n * Most suitable transformation for this CRS.\n */\n default_transformation?: any;\n\n exports: CoordinateExport;\n};\n\nexport type CoordinateSearchResult = {\n /**\n * The coordinate search results\n */\n results: Array;\n\n /**\n * The number of results\n */\n total: number;\n};\n\n/**\n * Search information about coordinate systems using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems\n * @param query Can be any kind of CRS by name or code\n * @param options\n * @returns\n */\nasync function search(\n query: string,\n options: CoordinatesSearchOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `coordinates/search/${query}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"limit\" in options) {\n endpoint.searchParams.set(\"limit\", options.limit.toString());\n }\n\n if (\"transformations\" in options) {\n endpoint.searchParams.set(\n \"transformations\",\n options.transformations.toString()\n );\n }\n\n if (\"exports\" in options) {\n endpoint.searchParams.set(\"exports\", options.exports.toString());\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateSearchResult;\n}\n\nexport type XYZ = {\n x?: number;\n y?: number;\n z?: number;\n};\n\nexport type CoordinateTransformResult = {\n results: Array;\n\n /**\n * Transformations are selected using given ops parameter.\n * If no parameter is given, auto strategy is used.\n * If given, it may try to use a listed transformation,\n * then fallback to towgs84 patching, and finally boundcrs.\n */\n transformer_selection_strategy: string;\n};\n\n/**\n * Options that can be provided when transforming a coordinate from one CRS to another.\n */\nexport type CoordinatesTransformOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Source coordinate reference system (default: 4326)\n */\n sourceCrs?: number;\n\n /**\n * Target coordinate reference system (default: 4326)\n */\n targetCrs?: number;\n\n /**\n * List of codes of operations\n */\n operations?: number | Array;\n};\n\n/**\n * Transforms coordinates from a source reference system to a target reference system using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates\n * @param positions\n * @param options\n * @returns\n */\nasync function transform(\n positions: Position | Array,\n options: CoordinatesTransformOptions = {}\n): Promise {\n const coordinatesStr = (Array.isArray(positions[0]) ? positions : [positions])\n .map((coord) => `${coord[0]},${coord[1]}`)\n .join(\";\");\n\n const endpoint = new URL(\n `coordinates/transform/${coordinatesStr}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"sourceCrs\" in options) {\n endpoint.searchParams.set(\"s_srs\", options.sourceCrs.toString());\n }\n\n if (\"targetCrs\" in options) {\n endpoint.searchParams.set(\"t_srs\", options.targetCrs.toString());\n }\n\n if (\"operations\" in options) {\n endpoint.searchParams.set(\n \"ops\",\n (Array.isArray(options.operations)\n ? options.operations\n : [options.operations]\n ).join(\"|\")\n );\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateTransformResult;\n}\n\n/**\n * The **coordinate** namespace contains asynchronous functions to call the [MapTiler Coordinate API](https://docs.maptiler.com/cloud/api/coordinates/).\n * The goal of the **Coordinate API* is query information about spatial coordinate reference system (CRS) as well as to transform coordinates from one CRS to another.\n */\nconst coordinates = {\n search,\n transform,\n};\n\nexport { coordinates };\n","import { FeatureCollection } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GetDataOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\n/**\n * Get user data and returns it as GeoJSON using the MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/data/#geojson\n * @param dataId\n * @returns\n */\nasync function get(\n dataId: string,\n options: GetDataOptions = {}\n): Promise {\n if (typeof dataId !== \"string\" || dataId.trim().length === 0) {\n throw new Error(\"The data ID must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `data/${encodeURIComponent(dataId)}/features.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj;\n}\n\n/**\n * The **data** namespace contains an asynchronous function to call the [MapTiler Data API](https://docs.maptiler.com/cloud/api/data/).\n * The **Data API** provides a way to retrieve user data in GeoJSON format.\n */\nconst data = {\n get,\n};\n\nexport { data };\n","/**\n * Expand the map style provided as argument of the Map constructor\n * @param style\n * @returns\n */\nexport function expandMapStyle(style): string {\n // testing if the style provided is of form \"maptiler://some-style\"\n const maptilerDomainRegex = /^maptiler:\\/\\/(.*)/;\n let match;\n const trimmed = style.trim();\n let expandedStyle;\n\n // The style was possibly already given as expanded URL\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n expandedStyle = trimmed;\n } else if ((match = maptilerDomainRegex.exec(trimmed)) !== null) {\n expandedStyle = `https://api.maptiler.com/maps/${match[1]}/style.json`;\n } else {\n // The style could also possibly just be the name of the style without any URI style\n expandedStyle = `https://api.maptiler.com/maps/${trimmed}/style.json`;\n }\n\n return expandedStyle;\n}\n\n/**\n * Type for object containing style details\n */\nexport type MapStylePreset = {\n referenceStyleID: string;\n name: string;\n description: string;\n variants: Array<{\n id: string;\n name: string;\n variantType: string;\n description: string;\n imageURL: string;\n }>;\n};\n\n/**\n * An instance of MapStyleVariant contains information about a style to use that belong to a reference style\n */\nexport class MapStyleVariant {\n constructor(\n /**\n * Human-friendly name\n */\n private name: string,\n\n /**\n * Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE`\n */\n private variantType: string,\n\n /**\n * MapTiler Cloud id\n */\n private id: string,\n\n /**\n * Reference map style, used to retrieve sibling variants\n */\n private referenceStyle: ReferenceMapStyle,\n\n /**\n * Human-friendly description\n */\n private description: string,\n\n /**\n * URL to an image describing the style variant\n */\n private imageURL: string\n ) {}\n\n /**\n * Get the human-friendly name\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n getFullName(): string {\n return `${this.referenceStyle.getName()} ${this.name}`;\n }\n\n /**\n * Get the variant type (eg. \"DEFAULT\", \"DARK\", \"PASTEL\", etc.)\n * @returns\n */\n getType(): string {\n return this.variantType;\n }\n\n /**\n * Get the MapTiler Cloud id\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Get the human-friendly description\n */\n getDescription(): string {\n return this.description;\n }\n\n /**\n * Get the reference style this variant belongs to\n * @returns\n */\n getReferenceStyle(): ReferenceMapStyle {\n return this.referenceStyle;\n }\n\n /**\n * Check if a variant of a given type exists for _this_ variants\n * (eg. if this is a \"DARK\", then we can check if there is a \"LIGHT\" variant of it)\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return this.referenceStyle.hasVariant(variantType);\n }\n\n /**\n * Retrieve the variant of a given type. If not found, will return the \"DEFAULT\" variant.\n * (eg. _this_ \"DARK\" variant does not have any \"PASTEL\" variant, then the \"DEFAULT\" is returned)\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return this.referenceStyle.getVariant(variantType);\n }\n\n /**\n * Get all the variants for _this_ variants, except _this_ current one\n * @returns\n */\n getVariants(): Array {\n return this.referenceStyle.getVariants().filter((v) => v !== this);\n }\n\n /**\n * Get the image URL that represent _this_ variant\n * @returns\n */\n getImageURL(): string {\n return this.imageURL;\n }\n\n /**\n * Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)\n * @returns\n */\n getExpandedStyleURL(): string {\n return expandMapStyle(this.getId());\n }\n}\n\n/**\n * An instance of reference style contains a list of StyleVariants ordered by relevance\n */\nexport class ReferenceMapStyle {\n /**\n * Variants that belong to this reference style, key being the reference type\n */\n private variants: { [key: string]: MapStyleVariant } = {};\n\n /**\n * Variants that belong to this reference style, ordered by relevance\n */\n private orderedVariants: Array = [];\n\n constructor(\n /**\n * Human-friendly name of this reference style\n */\n private name: string,\n\n /**\n * ID of this reference style\n */\n private id: string\n ) {}\n\n /**\n * Get the human-friendly name of this reference style\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the id of _this_ reference style\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Add a variant to _this_ reference style\n * @param v\n */\n addVariant(v: MapStyleVariant) {\n this.variants[v.getType()] = v;\n this.orderedVariants.push(v);\n }\n\n /**\n * Check if a given variant type exists for this reference style\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return variantType in this.variants;\n }\n\n /**\n * Get a given variant. If the given type of variant does not exist for this reference style,\n * then the most relevant default variant is returned instead\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return variantType in this.variants\n ? this.variants[variantType]\n : this.orderedVariants[0];\n }\n\n /**\n * Get the list of variants for this reference style\n * @returns\n */\n getVariants(): Array {\n return Object.values(this.variants);\n }\n\n /**\n * Get the defualt variant for this reference style\n * @returns\n */\n getDefaultVariant(): MapStyleVariant {\n return this.orderedVariants[0];\n }\n}\n\n/**\n * All the styles and variants maintained by MapTiler.\n */\nexport type MapStyleType = {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings\n */\n STREETS: ReferenceMapStyle & {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in dark mode.\n */\n DARK: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode.\n */\n LIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette.\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n OUTDOOR: ReferenceMapStyle & {\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n WINTER: ReferenceMapStyle & {\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery only, without any label.\n */\n SATELLITE: ReferenceMapStyle & {\n /**\n * High resolution imagery only, without any label.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n HYBRID: ReferenceMapStyle & {\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A minimalist street-oriented style without POI\n */\n BASIC: ReferenceMapStyle & {\n /**\n * A minimalist street-oriented style without POI\n */\n DEFAULT: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n BRIGHT: ReferenceMapStyle & {\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, with a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Classic OpenStreetMap style\n */\n OPENSTREETMAP: ReferenceMapStyle & {\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPO: ReferenceMapStyle & {\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n SHINY: MapStyleVariant;\n /**\n * A nice low-contrast, alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, using a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n\n /**\n * A nice very high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPOGRAPHIQUE: MapStyleVariant;\n };\n\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n VOYAGER: ReferenceMapStyle & {\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in very dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A nice alternative to `streets` with a soft sepia color palette and vintage look\n */\n VINTAGE: MapStyleVariant;\n };\n\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n TONER: ReferenceMapStyle & {\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, without any label\n */\n BACKGROUND: MapStyleVariant;\n /**\n * A bold very high contrast, yet faded, style for the city\n */\n LITE: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, with no building, only roads!\n */\n LINES: MapStyleVariant;\n };\n\n /**\n * Minimalist style, perfect for data visualization\n */\n DATAVIZ: ReferenceMapStyle & {\n /**\n * Minimalist style, perfect for data visualization\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in dark mode\n */\n DARK: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n OCEAN: ReferenceMapStyle & {\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n DEFAULT: MapStyleVariant;\n };\n};\n\nexport const mapStylePresetList: Array = [\n {\n referenceStyleID: \"STREETS\",\n name: \"Streets\",\n description: \"\",\n variants: [\n {\n id: \"streets-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OUTDOOR\",\n name: \"Outdoor\",\n description: \"\",\n variants: [\n {\n id: \"outdoor-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"WINTER\",\n name: \"Winter\",\n description: \"\",\n variants: [\n {\n id: \"winter-v2\",\n name: \"Winter\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"SATELLITE\",\n name: \"Satellite\",\n description: \"\",\n variants: [\n {\n id: \"satellite\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"HYBRID\",\n name: \"Hybrid\",\n description: \"\",\n variants: [\n {\n id: \"hybrid\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BASIC\",\n name: \"Basic\",\n description: \"\",\n variants: [\n {\n id: \"basic-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BRIGHT\",\n name: \"Bright\",\n description: \"\",\n variants: [\n {\n id: \"bright-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OPENSTREETMAP\",\n name: \"OpenStreetMap\",\n description: \"\",\n variants: [\n {\n id: \"openstreetmap\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TOPO\",\n name: \"Topo\",\n description: \"\",\n variants: [\n {\n id: \"topo-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-shiny\",\n name: \"Shiny\",\n variantType: \"SHINY\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-topographique\",\n name: \"Topographique\",\n variantType: \"TOPOGRAPHIQUE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"VOYAGER\",\n name: \"Voyager\",\n description: \"\",\n variants: [\n {\n id: \"voyager-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-darkmatter\",\n name: \"Darkmatter\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-positron\",\n name: \"Positron\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-vintage\",\n name: \"Vintage\",\n variantType: \"VINTAGE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TONER\",\n name: \"Toner\",\n description: \"\",\n variants: [\n {\n id: \"toner-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-background\",\n name: \"Background\",\n variantType: \"BACKGROUND\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lite\",\n name: \"Lite\",\n variantType: \"LITE\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lines\",\n name: \"Lines\",\n variantType: \"LINES\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"DATAVIZ\",\n name: \"Dataviz\",\n description: \"\",\n variants: [\n {\n id: \"dataviz\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OCEAN\",\n name: \"Ocean\",\n description: \"\",\n variants: [\n {\n id: \"ocean\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n];\n\nfunction makeReferenceStyleProxy(referenceStyle: ReferenceMapStyle) {\n return new Proxy(referenceStyle, {\n get(target, prop, receiver) {\n if (target.hasVariant(prop as string)) {\n return target.getVariant(prop as string);\n }\n\n // This variant does not exist for this style, but since it's full uppercase\n // we guess that the dev tries to access a style variant. So instead of\n // returning the default (STREETS.DEFAULT), we return the non-variant of the current style\n if (prop.toString().toUpperCase() === (prop as string)) {\n return referenceStyle.getDefaultVariant();\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\nfunction buildMapStyles(): MapStyleType {\n const mapStyle = {};\n\n for (let i = 0; i < mapStylePresetList.length; i += 1) {\n const refStyleInfo = mapStylePresetList[i];\n\n const refStyle = makeReferenceStyleProxy(\n new ReferenceMapStyle(refStyleInfo.name, refStyleInfo.referenceStyleID)\n );\n\n for (let j = 0; j < refStyleInfo.variants.length; j += 1) {\n const variantInfo = refStyleInfo.variants[j];\n const variant = new MapStyleVariant(\n variantInfo.name, // name\n variantInfo.variantType, // variantType\n variantInfo.id, // id\n refStyle, // referenceStyle\n variantInfo.description,\n variantInfo.imageURL // imageURL\n );\n\n refStyle.addVariant(variant);\n }\n mapStyle[refStyleInfo.referenceStyleID] = refStyle;\n }\n return mapStyle as MapStyleType;\n}\n\nexport function styleToStyle(\n style: string | ReferenceMapStyle | MapStyleVariant | null | undefined\n): string {\n if (!style) {\n return MapStyle[mapStylePresetList[0].referenceStyleID]\n .getDefaultVariant()\n .getId();\n }\n\n // If the provided style is a shorthand (eg. \"streets-v2\") then we make sure it's trimmed and lowercase\n if (typeof style === \"string\" || style instanceof String) {\n return style.trim().toLowerCase();\n }\n\n if (style instanceof MapStyleVariant) {\n return style.getId();\n }\n\n if (style instanceof ReferenceMapStyle) {\n return style.getDefaultVariant().getId();\n }\n}\n\n/**\n * Contains all the reference map style created by MapTiler team as well as all the variants.\n * For example, `MapStyle.STREETS` and the variants:\n * - `MapStyle.STREETS.DARK`\n * - `MapStyle.STREETS.LIGHT`\n * - `MapStyle.STREETS.PASTEL`\n *\n */\nexport const MapStyle: MapStyleType = buildMapStyles();\n","/**\\\n * This code is borrowed from https://github.com/mourner/simplify-js and reworked a little.\n */\n\nimport { Position } from \"geojson\";\n\n// square distance from a point to a segment\nfunction getSqSegDist(p: Position, p1: Position, p2: Position): number {\n let x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n\nfunction simplifyDPStep(\n points: Array,\n first: number,\n last: number,\n sqTolerance: number,\n simplified: Array\n) {\n let maxSqDist = sqTolerance,\n index;\n\n for (let i = first + 1; i < last; i++) {\n const sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) {\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n }\n simplified.push(points[index]);\n\n if (last - index > 1) {\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(\n points: Array,\n sqTolerance: number\n): Array {\n const last = points.length - 1;\n const simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nexport default function simplify(\n points: Array,\n tolerance: number\n): Array {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n const simplePoints = simplifyDouglasPeucker(points, sqTolerance);\n return simplePoints;\n}\n","import { BBox, Position } from \"geojson\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { MapStyleVariant, ReferenceMapStyle, styleToStyle } from \"../mapstyle\";\nimport simplify from \"./simplify\";\n\n/**\n * Base set of options that can be provided to all the types of static maps\n */\nexport type StaticMapBaseOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Style of the map (not full style URL). Example: \"winter\", \"streets-v2\".\n * Default: `\"streets-v2\"`\n */\n style?: string | ReferenceMapStyle | MapStyleVariant;\n\n /**\n * Double the size of the static map image to support hiDPI/Retina monitors.\n * Default: `false`\n */\n hiDPI?: boolean;\n\n /**\n * Image format.\n * Default: `\"png\"`\n */\n format?: \"png\" | \"jpg\" | \"webp\";\n\n /**\n * Width of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n width?: number;\n\n /**\n * Height of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n height?: number;\n\n /**\n * Placement of the attribution. Can also be set to `false` to not show attribution.\n * Default: `\"bottomright\"`\n */\n attribution?: \"bottomright\" | \"bottomleft\" | \"topleft\" | \"topright\" | false;\n\n /**\n * A marker or list of markers to show on the map\n * Default: none provided\n */\n markers?: StaticMapMarker | Array;\n\n /**\n * URL of the marker image. Applies only if one or multiple markers positions are provided.\n * Default: none provided\n */\n markerIcon?: string;\n\n /**\n * Position of the marker regarding its coordinates. Applies only:\n * - with a custom icon provided with `markerIcon`\n * - if one or multiple markers positions are provided.\n * Default: `\"bottom\"`\n */\n markerAnchor?:\n | \"top\"\n | \"left\"\n | \"bottom\"\n | \"right\"\n | \"center\"\n | \"topleft\"\n | \"bottomleft\"\n | \"topright\"\n | \"bottomright\";\n\n /**\n * Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.\n * Default: none provided\n */\n path?: Array;\n\n /**\n * Color of the path line. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: `\"blue\"`\n */\n pathStrokeColor?: string;\n\n /**\n * Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: none (transparent filling)\n */\n pathFillColor?: string;\n\n /**\n * Width of the path line in pixel. It can be floating point precision (ex: `0.5`)\n * Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.\n */\n pathWidth?: number;\n};\n\n/**\n * Options that can be provided to centered static maps\n */\nexport type CenteredStaticMapOptions = StaticMapBaseOptions;\n\n/**\n * Options that can be provided to bounded static maps\n */\nexport type BoundedStaticMapOptions = StaticMapBaseOptions & {\n /**\n * Extra space added around the regio of interest, in percentage.\n * Default: `0.1` (for 10%)\n */\n padding?: number;\n};\n\n/**\n * Options that can be provided to automatic static maps\n */\nexport type AutomaticStaticMapOptions = BoundedStaticMapOptions;\n\n/**\n * Definition of a maker to show on a static map\n */\nexport type StaticMapMarker = [\n /**\n * Longitude of the marker\n */\n number,\n /**\n * latitude of the marker\n */\n number,\n /**\n * Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.\n */\n string\n];\n\nfunction staticMapMarkerToString(\n marker: StaticMapMarker,\n includeColor = true\n): string {\n let str = `${marker[0]},${marker[1]}`;\n\n if (marker.length === 3 && includeColor) {\n str += `,${marker[2]}`;\n }\n\n return str;\n}\n\nfunction simplifyAndStringify(path: Array, maxNbChar = 3000): string {\n let str = path.map((point) => point.join(\",\")).join(\"|\");\n let tolerance = 0.000005;\n const toleranceStep = 0.00001;\n\n while (str.length > maxNbChar) {\n const simplerPath = simplify(path, tolerance);\n // str = simplerPath.map(point => point.join(',')).join('|');\n str = simplerPath.map((point) => `${point[0]},${point[1]}`).join(\"|\");\n tolerance += toleranceStep;\n }\n\n return str;\n}\n\n/**\n * Construct the URL for a static map centered on one point.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param center\n * @param zoom\n * @param options\n * @returns\n */\nfunction centered(\n center: Position,\n zoom: number,\n options: CenteredStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${center[0]},${\n center[1]\n },${zoom}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map using a bounding box\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param boundingBox\n * @param options\n * @returns\n */\nfunction bounded(\n boundingBox: BBox,\n options: BoundedStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${\n boundingBox[1]\n },${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map automatically fitted around the provided path or markers.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param options\n * @returns\n */\nfunction automatic(options: AutomaticStaticMapOptions = {}): string {\n if (!(\"markers\" in options) && !(\"path\" in options)) {\n throw new Error(\n \"Automatic static maps require markers and/or path to be created.\"\n );\n }\n\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(\n style\n )}/static/auto/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).\n * The URL of static maps can then be used within a `` markup element, as the `src` property value.\n */\nconst staticMaps = {\n centered,\n bounded,\n automatic,\n};\n\nexport { staticMaps };\n"],"names":["__async","customMessages"],"mappings":";;;;AAEA,SAAS,eAAkB,GAAA;AAEzB,EAAI,IAAA,OAA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maptiler-client.cjs","sources":["../src/config.ts","../src/language.ts","../src/callFetch.ts","../src/defaults.ts","../src/services/ServiceError.ts","../src/services/geocoding.ts","../src/services/geolocation.ts","../src/services/coordinates.ts","../src/services/data.ts","../src/mapstyle.ts","../src/services/simplify.ts","../src/services/staticMaps.ts"],"sourcesContent":["export type FetchFunction = (url: string, options: object) => Promise;\n\nfunction tryGettingFetch() {\n // this is browser, fetch exists\n if (typeof self !== \"undefined\") {\n return fetch.bind(self);\n }\n\n if (typeof global !== \"undefined\" && global.fetch) {\n return global.fetch;\n }\n\n return null;\n}\n\n/**\n * The configuration object definition\n */\nclass ClientConfig {\n /**\n * MapTiler Cloud API key\n */\n private _apiKey = \"\";\n\n /**\n * The fetch function. To be set if in Node < 18, otherwise\n * will be automatically resolved.\n */\n private _fetch: FetchFunction | null = tryGettingFetch();\n\n /**\n * Set the MapTiler Cloud API key\n */\n set apiKey(k: string) {\n this._apiKey = k;\n }\n\n /**\n * Get the MapTiler Cloud API key\n */\n get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * Set a the custom fetch function to replace the default one\n */\n set fetch(f: FetchFunction) {\n this._fetch = f;\n }\n\n /**\n * Get the fetch fucntion\n */\n get fetch(): FetchFunction | null {\n return this._fetch;\n }\n}\n\n/**\n * Configuration object\n */\nconst config = new ClientConfig();\n\nexport { ClientConfig, config };\n","/**\n * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.\n */\nconst LanguageGeocoding = {\n AUTO: \"auto\",\n ALBANIAN: \"sq\",\n ARABIC: \"ar\",\n ARMENIAN: \"hy\",\n AZERBAIJANI: \"az\",\n BELORUSSIAN: \"be\",\n BOSNIAN: \"bs\",\n BRETON: \"br\",\n BULGARIAN: \"bg\",\n CATALAN: \"ca\",\n CHINESE: \"zh\",\n CROATIAN: \"hr\",\n CZECH: \"cs\",\n DANISH: \"da\",\n DUTCH: \"nl\",\n ENGLISH: \"en\",\n ESPERANTO: \"eo\",\n ESTONIAN: \"et\",\n FINNISH: \"fi\",\n FRENCH: \"fr\",\n FRISIAN: \"fy\",\n GEORGIAN: \"ka\",\n GERMAN: \"de\",\n GREEK: \"el\",\n HEBREW: \"he\",\n HUNGARIAN: \"hu\",\n ICELANDIC: \"is\",\n IRISH: \"ga\",\n ITALIAN: \"it\",\n JAPANESE: \"ja\",\n KANNADA: \"kn\",\n KAZAKH: \"kk\",\n KOREAN: \"ko\",\n ROMAN_LATIN: \"la\",\n LATVIAN: \"lv\",\n LITHUANIAN: \"lt\",\n LUXEMBOURGISH: \"lb\",\n MACEDONIAN: \"mk\",\n MALTESE: \"mt\",\n NORWEGIAN: \"no\",\n POLISH: \"pl\",\n PORTUGUESE: \"pt\",\n ROMANIAN: \"ro\",\n ROMANSH: \"rm\",\n RUSSIAN: \"ru\",\n SCOTTISH_GAELIC: \"gd\",\n SERBIAN_CYRILLIC: \"sr\",\n SLOVAK: \"sk\",\n SLOVENE: \"sl\",\n SPANISH: \"es\",\n SWEDISH: \"sv\",\n THAI: \"th\",\n TURKISH: \"tr\",\n UKRAINIAN: \"uk\",\n WELSH: \"cy\",\n};\n\nconst languageCodeSet = new Set(Object.values(LanguageGeocoding));\n\ntype Values = T[keyof T];\n\n/**\n * Built-in languages values as strings\n */\ntype LanguageGeocodingString = Values;\n\nfunction getAutoLanguageGeocoding(): LanguageGeocodingString {\n if (typeof navigator === \"undefined\") {\n return Intl.DateTimeFormat()\n .resolvedOptions()\n .locale.split(\"-\")[0] as LanguageGeocodingString;\n }\n\n const canditatelangs = Array.from(\n new Set(navigator.languages.map((l) => l.split(\"-\")[0]))\n ).filter((l) => languageCodeSet.has(l as LanguageGeocodingString));\n\n return canditatelangs.length\n ? (canditatelangs[0] as LanguageGeocodingString)\n : LanguageGeocoding.ENGLISH;\n}\n\nexport { LanguageGeocoding, LanguageGeocodingString, getAutoLanguageGeocoding };\n","import { config } from \"./config\";\n\nexport async function callFetch(resource, options = {}) {\n if (config.fetch === null) {\n throw new Error(\n \"The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch\"\n );\n }\n\n // Control if URL contains the api key\n if (new URL(resource).searchParams.get(\"key\").trim() === \"\") {\n throw new Error(\n \"The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com\"\n );\n }\n\n return config.fetch(resource, options);\n}\n","/**\n * Some default settings for the SDK\n */\nconst defaults = {\n maptilerApiURL: \"https://api.maptiler.com/\",\n mapStyle: \"streets-v2\",\n};\n\nObject.freeze(defaults);\n\nexport { defaults };\n","/**\n * A ServiceError is an Error that includes the HTTP response details\n */\nexport class ServiceError extends Error {\n constructor(public res: Response, customMessage = \"\") {\n super(\n `Call to enpoint ${res.url} failed with the status code ${res.status}. ${customMessage}`\n );\n }\n}\n","import { BBox, Feature, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\n\nimport {\n getAutoLanguageGeocoding,\n LanguageGeocoding,\n LanguageGeocodingString,\n} from \"../language\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 400: \"Query too long / Invalid parameters\",\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type LanguageGeocodingOptions = {\n /**\n * Prefer results in specific language. It’s possible to specify multiple values.\n */\n language?: LanguageGeocodingString | Array;\n};\n\nexport type CommonForwardAndReverseGeocodingOptions =\n LanguageGeocodingOptions & {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.\n */\n limit?: number;\n\n /**\n * Filter of feature types to return. If not specified, all available feature types are returned.\n */\n types?: (\n | \"country\"\n | \"region\"\n | \"subregion\"\n | \"county\"\n | \"joint_municipality\"\n | \"joint_submunicipality\"\n | \"municipality\"\n | \"municipal_district\"\n | \"locality\"\n | \"neighbourhood\"\n | \"place\"\n | \"postal_code\"\n | \"address\"\n )[];\n };\n\nexport type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {\n /**\n * Only search for results in the specified area.\n */\n bbox?: BBox;\n\n /**\n * Prefer results close to a specific location.\n */\n proximity?: Position;\n\n /**\n * Limit search to specific country/countries specified as list of Alpha-2 ISO 3166-1 codes.\n */\n country?: string[];\n\n /**\n * Set to `false` to disable fuzzy (typo-tolerant) search. Default is `true`.\n */\n fuzzyMatch?: boolean;\n\n /**\n * Set to `true` to use autocomplete, `false` to disable it.\n * Default (`undefined`) is to combine autocomplete with non-autocomplete results.\n */\n autocomplete?: boolean;\n};\n\nexport type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;\n\nexport type ByIdGeocodingOptions = LanguageGeocodingOptions;\n\nexport type Coordinates = Position;\n\nexport type FeatureHierarchy = {\n /**\n * Unique feature ID\n */\n id: string;\n\n /**\n * Localized feature name\n */\n text: string;\n};\n\nexport type GeocodingFeature = Feature & {\n /**\n * Bounding box of the original feature as [w, s, e, n] array\n */\n bbox: BBox;\n\n /**\n * A [lon, lat] array of the original feature centeroid\n */\n center: Coordinates;\n\n /**\n * Formatted (including the hierarchy) and localized feature full name\n */\n place_name: string;\n\n /**\n * Localized feature name\n */\n text: string;\n\n /**\n * Feature hierarchy\n */\n context?: Array;\n\n /**\n * Address number, if applicable\n */\n address?: string;\n};\n\nexport type GeocodingSearchResult = {\n type: \"FeatureCollection\";\n\n /**\n * Array of features found\n */\n features: Array;\n\n /**\n * Tokenized search query\n */\n query: Array;\n\n /**\n * Attribution of the result\n */\n attribution: string;\n};\n\nfunction addLanguageGeocodingOptions(\n searchParams: URLSearchParams,\n options: LanguageGeocodingOptions\n) {\n if (options.language == undefined) {\n return;\n }\n\n const languages = Array.from(\n new Set(\n (Array.isArray(options.language)\n ? options.language\n : [options.language]\n ).map((lang) =>\n lang === LanguageGeocoding.AUTO ? getAutoLanguageGeocoding() : lang\n )\n )\n ).join(\",\");\n\n searchParams.set(\"language\", languages);\n}\n\nfunction addCommonForwardAndReverseGeocodingOptions(\n searchParams: URLSearchParams,\n options: CommonForwardAndReverseGeocodingOptions\n) {\n searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (options.limit != undefined) {\n searchParams.set(\"limit\", String(options.limit));\n }\n\n if (options.types != undefined) {\n searchParams.set(\"types\", options.types.join(\",\"));\n }\n\n addLanguageGeocodingOptions(searchParams, options);\n}\n\n/**\n * Performs a forward geocoding query to MapTiler API.\n * Providing a human readable place name (of a city, country, street, etc.), the function returns\n * a list of candidate locations including longitude and latitude.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward\n * @param query\n * @param options\n * @returns\n */\nasync function forward(\n query: string,\n options: GeocodingOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `geocoding/${encodeURIComponent(query)}.json`,\n defaults.maptilerApiURL\n );\n\n const { searchParams } = endpoint;\n\n addCommonForwardAndReverseGeocodingOptions(searchParams, options);\n\n if (options.bbox != undefined) {\n searchParams.set(\"bbox\", options.bbox.join(\",\"));\n }\n\n if (options.proximity != undefined) {\n searchParams.set(\"proximity\", options.proximity.join(\",\"));\n }\n\n if (options.country != undefined) {\n searchParams.set(\"country\", options.country.join(\",\"));\n }\n\n if (options.fuzzyMatch != undefined) {\n searchParams.set(\"fuzzyMatch\", options.fuzzyMatch ? \"true\" : \"false\");\n }\n\n if (options.autocomplete != undefined) {\n searchParams.set(\"autocomplete\", options.autocomplete ? \"true\" : \"false\");\n }\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a reverse geocoding query to MapTiler API.\n * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse\n * @param position\n * @param options\n * @returns\n */\nasync function reverse(\n position: Position,\n options: ReverseGeocodingOptions = {}\n): Promise {\n if (!Array.isArray(position) || position.length < 2) {\n throw new Error(\"The position must be an array of form [lng, lat].\");\n }\n\n const endpoint = new URL(\n `geocoding/${position[0]},${position[1]}.json`,\n defaults.maptilerApiURL\n );\n\n addCommonForwardAndReverseGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a geocoding query to MapTiler API to obtain fature by its ID.\n * Providing a feature ID, this function returns a feature which includes its full geometry.\n * Note that the feature ID is not stable and it changes when the database is re-indexed.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id\n * @param id\n * @param options\n * @returns\n */\nasync function byId(\n id: string,\n options: ByIdGeocodingOptions = {}\n): Promise {\n const endpoint = new URL(`geocoding/${id}.json`, defaults.maptilerApiURL);\n\n addLanguageGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * The **geocoding** namespace contains asynchronous functions to call the [MapTiler Geocoding API](https://docs.maptiler.com/cloud/api/geocoding/).\n * The **Geocoding API** provides ways to get geographic coordinates from a human-readable search query of a place (forward geocoding)\n * and to get the location details (country, city, street, etc.) from a geographic coordinate (reverse geocoding);\n */\nconst geocoding = {\n forward,\n reverse,\n byId,\n language: LanguageGeocoding,\n};\n\nexport { geocoding };\n","import { BBox } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GeolocationInfoOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\nexport type GeolocationResult = {\n /**\n * Name of the country\n * Example: Switzerland\n */\n country?: string;\n\n /**\n * Two-letter code of the country ISO 3166-1 alpha-2 codes\n * Example: CH\n */\n country_code?: string;\n\n /**\n * Bounds of the country in WGS84 degrees [west, south, east, north].\n * Example: [5.95538,45.818852,10.490936,47.809357]\n */\n country_bounds?: BBox;\n\n /**\n * Official country languages in ISO 639-1 format. ISO 639-1 codes\n * Example: [\"de\",\"fr\",\"it\"]\n */\n country_languages?: Array;\n\n /**\n * Name of the continent\n * Example: Europe\n */\n continent?: string;\n\n /**\n * Two-letter code of the continent\n * Example: EU\n */\n continent_code?: string;\n\n /**\n * Indicated whether the country is part of the European Union.\n */\n eu?: boolean;\n\n /**\n * Name of the city\n * Example: Zurich\n */\n city?: string;\n\n /**\n * Latitude of the location\n * Example: 47.36667\n */\n latitude?: number;\n\n /**\n * Longitude of the location\n * Example: 8.55\n */\n longitude?: number;\n\n /**\n * Postal code\n * Example: 8000\n */\n postal?: string;\n\n /**\n * If known, the ISO 3166-2 name for the first level region. ISO 3166-2 codes\n * Example: Zurich\n */\n region?: string;\n\n /**\n * If known, the ISO 3166-2 code for the first level region. ISO 3166-2 codes\n * Example: ZH\n */\n region_code?: string;\n\n /**\n * Name of the timezone\n * Example: Europe/Zurich\n */\n timezone?: string;\n};\n\n/**\n * Looks up geolocation details from IP address using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geolocation/#ip-geolocation\n * @returns\n */\nasync function info(\n options: GeolocationInfoOptions = {}\n): Promise {\n const endpoint = new URL(`geolocation/ip.json`, defaults.maptilerApiURL);\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as GeolocationResult;\n}\n\n/**\n * The **geolocation** namespace contains an asynchronous function to call the [MapTiler Geolocation API](https://docs.maptiler.com/cloud/api/geolocation/).\n * The **Geolocation API** provides a way to retrieve the IP address as well as geographic informations of a machine performing the query (most likely: a user)\n */\nconst geolocation = {\n info,\n};\n\nexport { geolocation };\n","import { BBox, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type CoordinatesSearchOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results returned (default: 10)\n */\n limit?: number;\n\n /**\n * Show detailed transformations for each CRS (default: false)\n */\n transformations?: boolean;\n\n /**\n * Show exports in WKT and Proj4 notations (default: false)\n */\n exports?: boolean;\n};\n\nexport type CoordinateId = {\n authority: string;\n code: BigInteger;\n};\n\nexport type CoordinateExport = {\n proj4: string;\n wkt: string;\n};\n\nexport type CoordinateGrid = {\n path: string;\n};\n\nexport type CoordinateTransformation = {\n id: CoordinateId;\n name: string;\n reversible: boolean;\n usable: boolean;\n deprecated: boolean;\n grids: Array;\n accuracy?: number;\n area?: string;\n bbox?: BBox;\n target_crs?: CoordinateId;\n unit?: string;\n};\n\nexport type CoordinateSearch = {\n id: CoordinateId;\n\n name: string;\n\n kind: string;\n\n deprecated: boolean;\n\n transformations?: Array;\n\n accuracy?: number;\n\n unit?: string;\n\n area?: string;\n\n /**\n * Bounding box of the resource in [min_lon, min_lat, max_lon, max_lat] order.\n */\n bbox?: BBox;\n\n /**\n * Most suitable transformation for this CRS.\n */\n default_transformation?: any;\n\n exports: CoordinateExport;\n};\n\nexport type CoordinateSearchResult = {\n /**\n * The coordinate search results\n */\n results: Array;\n\n /**\n * The number of results\n */\n total: number;\n};\n\n/**\n * Search information about coordinate systems using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems\n * @param query Can be any kind of CRS by name or code\n * @param options\n * @returns\n */\nasync function search(\n query: string,\n options: CoordinatesSearchOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `coordinates/search/${query}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"limit\" in options) {\n endpoint.searchParams.set(\"limit\", options.limit.toString());\n }\n\n if (\"transformations\" in options) {\n endpoint.searchParams.set(\n \"transformations\",\n options.transformations.toString()\n );\n }\n\n if (\"exports\" in options) {\n endpoint.searchParams.set(\"exports\", options.exports.toString());\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateSearchResult;\n}\n\nexport type XYZ = {\n x?: number;\n y?: number;\n z?: number;\n};\n\nexport type CoordinateTransformResult = {\n results: Array;\n\n /**\n * Transformations are selected using given ops parameter.\n * If no parameter is given, auto strategy is used.\n * If given, it may try to use a listed transformation,\n * then fallback to towgs84 patching, and finally boundcrs.\n */\n transformer_selection_strategy: string;\n};\n\n/**\n * Options that can be provided when transforming a coordinate from one CRS to another.\n */\nexport type CoordinatesTransformOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Source coordinate reference system (default: 4326)\n */\n sourceCrs?: number;\n\n /**\n * Target coordinate reference system (default: 4326)\n */\n targetCrs?: number;\n\n /**\n * List of codes of operations\n */\n operations?: number | Array;\n};\n\n/**\n * Transforms coordinates from a source reference system to a target reference system using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates\n * @param positions\n * @param options\n * @returns\n */\nasync function transform(\n positions: Position | Array,\n options: CoordinatesTransformOptions = {}\n): Promise {\n const coordinatesStr = (Array.isArray(positions[0]) ? positions : [positions])\n .map((coord) => `${coord[0]},${coord[1]}`)\n .join(\";\");\n\n const endpoint = new URL(\n `coordinates/transform/${coordinatesStr}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"sourceCrs\" in options) {\n endpoint.searchParams.set(\"s_srs\", options.sourceCrs.toString());\n }\n\n if (\"targetCrs\" in options) {\n endpoint.searchParams.set(\"t_srs\", options.targetCrs.toString());\n }\n\n if (\"operations\" in options) {\n endpoint.searchParams.set(\n \"ops\",\n (Array.isArray(options.operations)\n ? options.operations\n : [options.operations]\n ).join(\"|\")\n );\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateTransformResult;\n}\n\n/**\n * The **coordinate** namespace contains asynchronous functions to call the [MapTiler Coordinate API](https://docs.maptiler.com/cloud/api/coordinates/).\n * The goal of the **Coordinate API* is query information about spatial coordinate reference system (CRS) as well as to transform coordinates from one CRS to another.\n */\nconst coordinates = {\n search,\n transform,\n};\n\nexport { coordinates };\n","import { FeatureCollection } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GetDataOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\n/**\n * Get user data and returns it as GeoJSON using the MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/data/#geojson\n * @param dataId\n * @returns\n */\nasync function get(\n dataId: string,\n options: GetDataOptions = {}\n): Promise {\n if (typeof dataId !== \"string\" || dataId.trim().length === 0) {\n throw new Error(\"The data ID must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `data/${encodeURIComponent(dataId)}/features.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj;\n}\n\n/**\n * The **data** namespace contains an asynchronous function to call the [MapTiler Data API](https://docs.maptiler.com/cloud/api/data/).\n * The **Data API** provides a way to retrieve user data in GeoJSON format.\n */\nconst data = {\n get,\n};\n\nexport { data };\n","/**\n * Expand the map style provided as argument of the Map constructor\n * @param style\n * @returns\n */\nexport function expandMapStyle(style): string {\n // testing if the style provided is of form \"maptiler://some-style\"\n const maptilerDomainRegex = /^maptiler:\\/\\/(.*)/;\n let match;\n const trimmed = style.trim();\n let expandedStyle;\n\n // The style was possibly already given as expanded URL\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n expandedStyle = trimmed;\n } else if ((match = maptilerDomainRegex.exec(trimmed)) !== null) {\n expandedStyle = `https://api.maptiler.com/maps/${match[1]}/style.json`;\n } else {\n // The style could also possibly just be the name of the style without any URI style\n expandedStyle = `https://api.maptiler.com/maps/${trimmed}/style.json`;\n }\n\n return expandedStyle;\n}\n\n/**\n * Type for object containing style details\n */\nexport type MapStylePreset = {\n referenceStyleID: string;\n name: string;\n description: string;\n variants: Array<{\n id: string;\n name: string;\n variantType: string;\n description: string;\n imageURL: string;\n }>;\n};\n\n/**\n * An instance of MapStyleVariant contains information about a style to use that belong to a reference style\n */\nexport class MapStyleVariant {\n constructor(\n /**\n * Human-friendly name\n */\n private name: string,\n\n /**\n * Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE`\n */\n private variantType: string,\n\n /**\n * MapTiler Cloud id\n */\n private id: string,\n\n /**\n * Reference map style, used to retrieve sibling variants\n */\n private referenceStyle: ReferenceMapStyle,\n\n /**\n * Human-friendly description\n */\n private description: string,\n\n /**\n * URL to an image describing the style variant\n */\n private imageURL: string\n ) {}\n\n /**\n * Get the human-friendly name\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n getFullName(): string {\n return `${this.referenceStyle.getName()} ${this.name}`;\n }\n\n /**\n * Get the variant type (eg. \"DEFAULT\", \"DARK\", \"PASTEL\", etc.)\n * @returns\n */\n getType(): string {\n return this.variantType;\n }\n\n /**\n * Get the MapTiler Cloud id\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Get the human-friendly description\n */\n getDescription(): string {\n return this.description;\n }\n\n /**\n * Get the reference style this variant belongs to\n * @returns\n */\n getReferenceStyle(): ReferenceMapStyle {\n return this.referenceStyle;\n }\n\n /**\n * Check if a variant of a given type exists for _this_ variants\n * (eg. if this is a \"DARK\", then we can check if there is a \"LIGHT\" variant of it)\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return this.referenceStyle.hasVariant(variantType);\n }\n\n /**\n * Retrieve the variant of a given type. If not found, will return the \"DEFAULT\" variant.\n * (eg. _this_ \"DARK\" variant does not have any \"PASTEL\" variant, then the \"DEFAULT\" is returned)\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return this.referenceStyle.getVariant(variantType);\n }\n\n /**\n * Get all the variants for _this_ variants, except _this_ current one\n * @returns\n */\n getVariants(): Array {\n return this.referenceStyle.getVariants().filter((v) => v !== this);\n }\n\n /**\n * Get the image URL that represent _this_ variant\n * @returns\n */\n getImageURL(): string {\n return this.imageURL;\n }\n\n /**\n * Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)\n * @returns\n */\n getExpandedStyleURL(): string {\n return expandMapStyle(this.getId());\n }\n}\n\n/**\n * An instance of reference style contains a list of StyleVariants ordered by relevance\n */\nexport class ReferenceMapStyle {\n /**\n * Variants that belong to this reference style, key being the reference type\n */\n private variants: { [key: string]: MapStyleVariant } = {};\n\n /**\n * Variants that belong to this reference style, ordered by relevance\n */\n private orderedVariants: Array = [];\n\n constructor(\n /**\n * Human-friendly name of this reference style\n */\n private name: string,\n\n /**\n * ID of this reference style\n */\n private id: string\n ) {}\n\n /**\n * Get the human-friendly name of this reference style\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the id of _this_ reference style\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Add a variant to _this_ reference style\n * @param v\n */\n addVariant(v: MapStyleVariant) {\n this.variants[v.getType()] = v;\n this.orderedVariants.push(v);\n }\n\n /**\n * Check if a given variant type exists for this reference style\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return variantType in this.variants;\n }\n\n /**\n * Get a given variant. If the given type of variant does not exist for this reference style,\n * then the most relevant default variant is returned instead\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return variantType in this.variants\n ? this.variants[variantType]\n : this.orderedVariants[0];\n }\n\n /**\n * Get the list of variants for this reference style\n * @returns\n */\n getVariants(): Array {\n return Object.values(this.variants);\n }\n\n /**\n * Get the defualt variant for this reference style\n * @returns\n */\n getDefaultVariant(): MapStyleVariant {\n return this.orderedVariants[0];\n }\n}\n\n/**\n * All the styles and variants maintained by MapTiler.\n */\nexport type MapStyleType = {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings\n */\n STREETS: ReferenceMapStyle & {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in dark mode.\n */\n DARK: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode.\n */\n LIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in blue night mode.\n */\n NIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette.\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n OUTDOOR: ReferenceMapStyle & {\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading, in dark mode.\n */\n DARK: MapStyleVariant;\n };\n\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n WINTER: ReferenceMapStyle & {\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading, in dark mode.\n */\n DARK: MapStyleVariant;\n };\n\n /**\n * High resolution imagery only, without any label.\n */\n SATELLITE: ReferenceMapStyle & {\n /**\n * High resolution imagery only, without any label.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n HYBRID: ReferenceMapStyle & {\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A minimalist street-oriented style without POI\n */\n BASIC: ReferenceMapStyle & {\n /**\n * A minimalist street-oriented style without POI\n */\n DEFAULT: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n BRIGHT: ReferenceMapStyle & {\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, with a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Classic OpenStreetMap style\n */\n OPENSTREETMAP: ReferenceMapStyle & {\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPO: ReferenceMapStyle & {\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n SHINY: MapStyleVariant;\n /**\n * A nice low-contrast, alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, using a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n\n /**\n * A nice very high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPOGRAPHIQUE: MapStyleVariant;\n };\n\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n VOYAGER: ReferenceMapStyle & {\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in very dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A nice alternative to `streets` with a soft sepia color palette and vintage look\n */\n VINTAGE: MapStyleVariant;\n };\n\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n TONER: ReferenceMapStyle & {\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, without any label\n */\n BACKGROUND: MapStyleVariant;\n /**\n * A bold very high contrast, yet faded, style for the city\n */\n LITE: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, with no building, only roads!\n */\n LINES: MapStyleVariant;\n };\n\n /**\n * Minimalist style, perfect for data visualization\n */\n DATAVIZ: ReferenceMapStyle & {\n /**\n * Minimalist style, perfect for data visualization\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in dark mode\n */\n DARK: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n OCEAN: ReferenceMapStyle & {\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n DEFAULT: MapStyleVariant;\n };\n};\n\nexport const mapStylePresetList: Array = [\n {\n referenceStyleID: \"STREETS\",\n name: \"Streets\",\n description: \"\",\n variants: [\n {\n id: \"streets-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-night\",\n name: \"Night\",\n variantType: \"NIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OUTDOOR\",\n name: \"Outdoor\",\n description: \"\",\n variants: [\n {\n id: \"outdoor-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"outdoor-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"WINTER\",\n name: \"Winter\",\n description: \"\",\n variants: [\n {\n id: \"winter-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"winter-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"SATELLITE\",\n name: \"Satellite\",\n description: \"\",\n variants: [\n {\n id: \"satellite\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"HYBRID\",\n name: \"Hybrid\",\n description: \"\",\n variants: [\n {\n id: \"hybrid\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BASIC\",\n name: \"Basic\",\n description: \"\",\n variants: [\n {\n id: \"basic-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BRIGHT\",\n name: \"Bright\",\n description: \"\",\n variants: [\n {\n id: \"bright-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OPENSTREETMAP\",\n name: \"OpenStreetMap\",\n description: \"\",\n variants: [\n {\n id: \"openstreetmap\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TOPO\",\n name: \"Topo\",\n description: \"\",\n variants: [\n {\n id: \"topo-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-shiny\",\n name: \"Shiny\",\n variantType: \"SHINY\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-topographique\",\n name: \"Topographique\",\n variantType: \"TOPOGRAPHIQUE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"VOYAGER\",\n name: \"Voyager\",\n description: \"\",\n variants: [\n {\n id: \"voyager-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-darkmatter\",\n name: \"Darkmatter\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-positron\",\n name: \"Positron\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-vintage\",\n name: \"Vintage\",\n variantType: \"VINTAGE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TONER\",\n name: \"Toner\",\n description: \"\",\n variants: [\n {\n id: \"toner-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-background\",\n name: \"Background\",\n variantType: \"BACKGROUND\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lite\",\n name: \"Lite\",\n variantType: \"LITE\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lines\",\n name: \"Lines\",\n variantType: \"LINES\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"DATAVIZ\",\n name: \"Dataviz\",\n description: \"\",\n variants: [\n {\n id: \"dataviz\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OCEAN\",\n name: \"Ocean\",\n description: \"\",\n variants: [\n {\n id: \"ocean\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n];\n\nfunction makeReferenceStyleProxy(referenceStyle: ReferenceMapStyle) {\n return new Proxy(referenceStyle, {\n get(target, prop, receiver) {\n if (target.hasVariant(prop as string)) {\n return target.getVariant(prop as string);\n }\n\n // This variant does not exist for this style, but since it's full uppercase\n // we guess that the dev tries to access a style variant. So instead of\n // returning the default (STREETS.DEFAULT), we return the non-variant of the current style\n if (prop.toString().toUpperCase() === (prop as string)) {\n return referenceStyle.getDefaultVariant();\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\nfunction buildMapStyles(): MapStyleType {\n const mapStyle = {};\n\n for (let i = 0; i < mapStylePresetList.length; i += 1) {\n const refStyleInfo = mapStylePresetList[i];\n\n const refStyle = makeReferenceStyleProxy(\n new ReferenceMapStyle(refStyleInfo.name, refStyleInfo.referenceStyleID)\n );\n\n for (let j = 0; j < refStyleInfo.variants.length; j += 1) {\n const variantInfo = refStyleInfo.variants[j];\n const variant = new MapStyleVariant(\n variantInfo.name, // name\n variantInfo.variantType, // variantType\n variantInfo.id, // id\n refStyle, // referenceStyle\n variantInfo.description,\n variantInfo.imageURL // imageURL\n );\n\n refStyle.addVariant(variant);\n }\n mapStyle[refStyleInfo.referenceStyleID] = refStyle;\n }\n return mapStyle as MapStyleType;\n}\n\nexport function styleToStyle(\n style: string | ReferenceMapStyle | MapStyleVariant | null | undefined\n): string {\n if (!style) {\n return MapStyle[mapStylePresetList[0].referenceStyleID]\n .getDefaultVariant()\n .getId();\n }\n\n // If the provided style is a shorthand (eg. \"streets-v2\") then we make sure it's trimmed and lowercase\n if (typeof style === \"string\" || style instanceof String) {\n return style.trim().toLowerCase();\n }\n\n if (style instanceof MapStyleVariant) {\n return style.getId();\n }\n\n if (style instanceof ReferenceMapStyle) {\n return style.getDefaultVariant().getId();\n }\n}\n\n/**\n * Contains all the reference map style created by MapTiler team as well as all the variants.\n * For example, `MapStyle.STREETS` and the variants:\n * - `MapStyle.STREETS.DARK`\n * - `MapStyle.STREETS.LIGHT`\n * - `MapStyle.STREETS.PASTEL`\n *\n */\nexport const MapStyle: MapStyleType = buildMapStyles();\n","/**\\\n * This code is borrowed from https://github.com/mourner/simplify-js and reworked a little.\n */\n\nimport { Position } from \"geojson\";\n\n// square distance from a point to a segment\nfunction getSqSegDist(p: Position, p1: Position, p2: Position): number {\n let x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n\nfunction simplifyDPStep(\n points: Array,\n first: number,\n last: number,\n sqTolerance: number,\n simplified: Array\n) {\n let maxSqDist = sqTolerance,\n index;\n\n for (let i = first + 1; i < last; i++) {\n const sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) {\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n }\n simplified.push(points[index]);\n\n if (last - index > 1) {\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(\n points: Array,\n sqTolerance: number\n): Array {\n const last = points.length - 1;\n const simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nexport default function simplify(\n points: Array,\n tolerance: number\n): Array {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n const simplePoints = simplifyDouglasPeucker(points, sqTolerance);\n return simplePoints;\n}\n","import { BBox, Position } from \"geojson\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { MapStyleVariant, ReferenceMapStyle, styleToStyle } from \"../mapstyle\";\nimport simplify from \"./simplify\";\n\n/**\n * Base set of options that can be provided to all the types of static maps\n */\nexport type StaticMapBaseOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Style of the map (not full style URL). Example: \"winter\", \"streets-v2\".\n * Default: `\"streets-v2\"`\n */\n style?: string | ReferenceMapStyle | MapStyleVariant;\n\n /**\n * Double the size of the static map image to support hiDPI/Retina monitors.\n * Default: `false`\n */\n hiDPI?: boolean;\n\n /**\n * Image format.\n * Default: `\"png\"`\n */\n format?: \"png\" | \"jpg\" | \"webp\";\n\n /**\n * Width of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n width?: number;\n\n /**\n * Height of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n height?: number;\n\n /**\n * Placement of the attribution. Can also be set to `false` to not show attribution.\n * Default: `\"bottomright\"`\n */\n attribution?: \"bottomright\" | \"bottomleft\" | \"topleft\" | \"topright\" | false;\n\n /**\n * A marker or list of markers to show on the map\n * Default: none provided\n */\n markers?: StaticMapMarker | Array;\n\n /**\n * URL of the marker image. Applies only if one or multiple markers positions are provided.\n * Default: none provided\n */\n markerIcon?: string;\n\n /**\n * Position of the marker regarding its coordinates. Applies only:\n * - with a custom icon provided with `markerIcon`\n * - if one or multiple markers positions are provided.\n * Default: `\"bottom\"`\n */\n markerAnchor?:\n | \"top\"\n | \"left\"\n | \"bottom\"\n | \"right\"\n | \"center\"\n | \"topleft\"\n | \"bottomleft\"\n | \"topright\"\n | \"bottomright\";\n\n /**\n * Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.\n * Default: none provided\n */\n path?: Array;\n\n /**\n * Color of the path line. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: `\"blue\"`\n */\n pathStrokeColor?: string;\n\n /**\n * Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: none (transparent filling)\n */\n pathFillColor?: string;\n\n /**\n * Width of the path line in pixel. It can be floating point precision (ex: `0.5`)\n * Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.\n */\n pathWidth?: number;\n};\n\n/**\n * Options that can be provided to centered static maps\n */\nexport type CenteredStaticMapOptions = StaticMapBaseOptions;\n\n/**\n * Options that can be provided to bounded static maps\n */\nexport type BoundedStaticMapOptions = StaticMapBaseOptions & {\n /**\n * Extra space added around the regio of interest, in percentage.\n * Default: `0.1` (for 10%)\n */\n padding?: number;\n};\n\n/**\n * Options that can be provided to automatic static maps\n */\nexport type AutomaticStaticMapOptions = BoundedStaticMapOptions;\n\n/**\n * Definition of a maker to show on a static map\n */\nexport type StaticMapMarker = [\n /**\n * Longitude of the marker\n */\n number,\n /**\n * latitude of the marker\n */\n number,\n /**\n * Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.\n */\n string\n];\n\nfunction staticMapMarkerToString(\n marker: StaticMapMarker,\n includeColor = true\n): string {\n let str = `${marker[0]},${marker[1]}`;\n\n if (marker.length === 3 && includeColor) {\n str += `,${marker[2]}`;\n }\n\n return str;\n}\n\nfunction simplifyAndStringify(path: Array, maxNbChar = 3000): string {\n let str = path.map((point) => point.join(\",\")).join(\"|\");\n let tolerance = 0.000005;\n const toleranceStep = 0.00001;\n\n while (str.length > maxNbChar) {\n const simplerPath = simplify(path, tolerance);\n // str = simplerPath.map(point => point.join(',')).join('|');\n str = simplerPath.map((point) => `${point[0]},${point[1]}`).join(\"|\");\n tolerance += toleranceStep;\n }\n\n return str;\n}\n\n/**\n * Construct the URL for a static map centered on one point.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param center\n * @param zoom\n * @param options\n * @returns\n */\nfunction centered(\n center: Position,\n zoom: number,\n options: CenteredStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${center[0]},${\n center[1]\n },${zoom}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map using a bounding box\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param boundingBox\n * @param options\n * @returns\n */\nfunction bounded(\n boundingBox: BBox,\n options: BoundedStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${\n boundingBox[1]\n },${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map automatically fitted around the provided path or markers.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param options\n * @returns\n */\nfunction automatic(options: AutomaticStaticMapOptions = {}): string {\n if (!(\"markers\" in options) && !(\"path\" in options)) {\n throw new Error(\n \"Automatic static maps require markers and/or path to be created.\"\n );\n }\n\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(\n style\n )}/static/auto/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).\n * The URL of static maps can then be used within a `` markup element, as the `src` property value.\n */\nconst staticMaps = {\n centered,\n bounded,\n automatic,\n};\n\nexport { staticMaps };\n"],"names":["__async","customMessages"],"mappings":";;;;AAEA,SAAS,eAAkB,GAAA;AAEzB,EAAI,IAAA,OAAO,SAAS,WAAa,EAAA;AAC/B,IAAO,OAAA,KAAA,CAAM,KAAK,IAAI,CAAA,CAAA;AAAA,GACxB;AAEA,EAAA,IAAI,OAAO,MAAA,KAAW,WAAe,IAAA,MAAA,CAAO,KAAO,EAAA;AACjD,IAAA,OAAO,MAAO,CAAA,KAAA,CAAA;AAAA,GAChB;AAEA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAKA,MAAM,YAAa,CAAA;AAAA,EAAnB,WAAA,GAAA;AAIE;AAAA;AAAA;AAAA,IAAA,IAAA,CAAQ,OAAU,GAAA,EAAA,CAAA;AAMlB;AAAA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAQ,SAA+B,eAAgB,EAAA,CAAA;AAAA,GAAA;AAAA;AAAA;AAAA;AAAA,EAKvD,IAAI,OAAO,CAAW,EAAA;AACpB,IAAA,IAAA,CAAK,OAAU,GAAA,CAAA,CAAA;AAAA,GACjB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAiB,GAAA;AACnB,IAAA,OAAO,IAAK,CAAA,OAAA,CAAA;AAAA,GACd;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAM,CAAkB,EAAA;AAC1B,IAAA,IAAA,CAAK,MAAS,GAAA,CAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,KAA8B,GAAA;AAChC,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GACd;AACF,CAAA;AAKM,MAAA,MAAA,GAAS,IAAI,YAAa;;AC3DhC,MAAM,iB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AAA,EAAA,CAAQ,EAAQ,GAAA,OAAA,CAAA,aAAA,KAAR,IAAyB,GAAA,EAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AAE5C,IAAA,IAAI,qBAAqB,OAAS,EAAA;AAChC,MAAA,OAAA,IAAW,UAAU,OAAQ,CAAA,eAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KAC/B;AAEA,IAAA,IAAI,eAAe,OAAS,EAAA;AAC1B,MAAA,MAAM,SAAY,GAAA,OAAA,CAAQ,SAAa,IAAA,OAAA,CAAQ,QAAQ,CAAI,GAAA,CAAA,CAAA,CAAA;AAC3D,MAAW,OAAA,IAAA,CAAA,MAAA,EAAS,UAAU,QAAS,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KACzC;AAEA,IAAW,OAAA,IAAA,oBAAA,CAAqB,QAAQ,IAAI,CAAA,CAAA;AAC5C,IAAS,QAAA,CAAA,YAAA,CAAa,GAAI,CAAA,MAAA,EAAQ,OAAO,CAAA,CAAA;AAAA,GAC3C;AAEA,EAAA,QAAA,CAAS,aAAa,GAAI,CAAA,KAAA,EAAA,CAAO,aAAQ,MAAR,KAAA,IAAA,GAAA,EAAA,GAAkB,OAAO,MAAM,CAAA,CAAA;AAEhE,EAAA,OAAO,SAAS,QAAS,EAAA,CAAA;AAC3B,CAAA;AAMA,MAAM,UAAa,GAAA;AAAA,EACjB,QAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AACF;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/maptiler-client.d.ts b/dist/maptiler-client.d.ts index 92e1b6e..dda7381 100644 --- a/dist/maptiler-client.d.ts +++ b/dist/maptiler-client.d.ts @@ -766,6 +766,10 @@ type MapStyleType = { * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode. */ LIGHT: MapStyleVariant; + /** + * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in blue night mode. + */ + NIGHT: MapStyleVariant; /** * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette. */ @@ -779,6 +783,10 @@ type MapStyleType = { * Suitable for outdoor activities. With elevation isolines and hillshading. */ DEFAULT: MapStyleVariant; + /** + * Suitable for outdoor activities. With elevation isolines and hillshading, in dark mode. + */ + DARK: MapStyleVariant; }; /** * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading. @@ -788,6 +796,10 @@ type MapStyleType = { * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading. */ DEFAULT: MapStyleVariant; + /** + * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading, in dark mode. + */ + DARK: MapStyleVariant; }; /** * High resolution imagery only, without any label. @@ -859,6 +871,10 @@ type MapStyleType = { * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details */ DEFAULT: MapStyleVariant; + /** + * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, in dark mode + */ + DARK: MapStyleVariant; /** * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details */ diff --git a/dist/maptiler-client.min.mjs b/dist/maptiler-client.min.mjs index dc49c5c..5b5ec63 100644 --- a/dist/maptiler-client.min.mjs +++ b/dist/maptiler-client.min.mjs @@ -1 +1 @@ -function G(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class N{constructor(){this._apiKey="",this._fetch=G()}set apiKey(t){this._apiKey=t}get apiKey(){return this._apiKey}set fetch(t){this._fetch=t}get fetch(){return this._fetch}}const d=new N,I={AUTO:"auto",ALBANIAN:"sq",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HUNGARIAN:"hu",ICELANDIC:"is",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALTESE:"mt",NORWEGIAN:"no",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},F=new Set(Object.values(I));function M(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const n=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>F.has(t));return n.length?n[0]:I.ENGLISH}var B=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});function A(n){return B(this,arguments,function*(t,e={}){if(d.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(t).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return d.fetch(t,e)})}const g={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(g);class v extends Error{constructor(t,e=""){super(`Call to enpoint ${t.url} failed with the status code ${t.status}. ${e}`),this.res=t}}var T=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const U={400:"Query too long / Invalid parameters",403:"Key is missing, invalid or restricted"};function b(n,t){if(t.language==null)return;const e=Array.from(new Set((Array.isArray(t.language)?t.language:[t.language]).map(r=>r===I.AUTO?M():r))).join(",");n.set("language",e)}function C(n,t){var e;n.set("key",(e=t.apiKey)!=null?e:d.apiKey),t.limit!=null&&n.set("limit",String(t.limit)),t.types!=null&&n.set("types",t.types.join(",")),b(n,t)}function W(n){return T(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const i=new URL(`geocoding/${encodeURIComponent(t)}.json`,g.maptilerApiURL),{searchParams:a}=i;C(a,e),e.bbox!=null&&a.set("bbox",e.bbox.join(",")),e.proximity!=null&&a.set("proximity",e.proximity.join(",")),e.country!=null&&a.set("country",e.country.join(",")),e.fuzzyMatch!=null&&a.set("fuzzyMatch",e.fuzzyMatch?"true":"false"),e.autocomplete!=null&&a.set("autocomplete",e.autocomplete?"true":"false");const s=i.toString(),c=yield A(s);if(!c.ok)throw new v(c,(r=U[c.status])!=null?r:"");return yield c.json()})}function z(n){return T(this,arguments,function*(t,e={}){var r;if(!Array.isArray(t)||t.length<2)throw new Error("The position must be an array of form [lng, lat].");const i=new URL(`geocoding/${t[0]},${t[1]}.json`,g.maptilerApiURL);C(i.searchParams,e);const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,(r=U[s.status])!=null?r:"");return yield s.json()})}function _(n){return T(this,arguments,function*(t,e={}){var r;const i=new URL(`geocoding/${t}.json`,g.maptilerApiURL);b(i.searchParams,e);const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,(r=U[s.status])!=null?r:"");return yield s.json()})}const q={forward:W,reverse:z,byId:_,language:I};var Y=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const K={403:"Key is missing, invalid or restricted"};function Z(){return Y(this,arguments,function*(n={}){var t;const e=new URL("geolocation/ip.json",g.maptilerApiURL);e.searchParams.set("key",(t=n.apiKey)!=null?t:d.apiKey);const r=e.toString(),i=yield A(r);if(!i.ok)throw new v(i,i.status in K?K[i.status]:"");return yield i.json()})}const J={info:Z};var O=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const S={403:"Key is missing, invalid or restricted"};function Q(n){return O(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const i=new URL(`coordinates/search/${t}.json`,g.maptilerApiURL);i.searchParams.set("key",(r=e.apiKey)!=null?r:d.apiKey),"limit"in e&&i.searchParams.set("limit",e.limit.toString()),"transformations"in e&&i.searchParams.set("transformations",e.transformations.toString()),"exports"in e&&i.searchParams.set("exports",e.exports.toString());const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,s.status in S?S[s.status]:"");return yield s.json()})}function X(n){return O(this,arguments,function*(t,e={}){var r;const i=(Array.isArray(t[0])?t:[t]).map(o=>`${o[0]},${o[1]}`).join(";"),a=new URL(`coordinates/transform/${i}.json`,g.maptilerApiURL);a.searchParams.set("key",(r=e.apiKey)!=null?r:d.apiKey),"sourceCrs"in e&&a.searchParams.set("s_srs",e.sourceCrs.toString()),"targetCrs"in e&&a.searchParams.set("t_srs",e.targetCrs.toString()),"operations"in e&&a.searchParams.set("ops",(Array.isArray(e.operations)?e.operations:[e.operations]).join("|"));const s=a.toString(),c=yield A(s);if(!c.ok)throw new v(c,c.status in S?S[c.status]:"");return yield c.json()})}const ee={search:Q,transform:X};var te=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const j={403:"Key is missing, invalid or restricted"};function ne(n){return te(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The data ID must be a non-empty string");const i=new URL(`data/${encodeURIComponent(t)}/features.json`,g.maptilerApiURL);i.searchParams.set("key",(r=e.apiKey)!=null?r:d.apiKey);const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,s.status in j?j[s.status]:"");return yield s.json()})}const re={get:ne};function x(n){const t=/^maptiler:\/\/(.*)/;let e;const r=n.trim();let i;return r.startsWith("http://")||r.startsWith("https://")?i=r:(e=t.exec(r))!==null?i=`https://api.maptiler.com/maps/${e[1]}/style.json`:i=`https://api.maptiler.com/maps/${r}/style.json`,i}class D{constructor(t,e,r,i,a,s){this.name=t,this.variantType=e,this.id=r,this.referenceStyle=i,this.description=a,this.imageURL=s}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(t){return this.referenceStyle.hasVariant(t)}getVariant(t){return this.referenceStyle.getVariant(t)}getVariants(){return this.referenceStyle.getVariants().filter(t=>t!==this)}getImageURL(){return this.imageURL}getExpandedStyleURL(){return x(this.getId())}}class k{constructor(t,e){this.name=t,this.id=e,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(t){this.variants[t.getType()]=t,this.orderedVariants.push(t)}hasVariant(t){return t in this.variants}getVariant(t){return t in this.variants?this.variants[t]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0]}}const L=[{referenceStyleID:"STREETS",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"WINTER",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Winter",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"BASIC",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"TOPO",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:""},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]},{referenceStyleID:"VOYAGER",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER",name:"Toner",description:"",variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",description:"",imageURL:""},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:""},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OCEAN",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]}];function ie(n){return new Proxy(n,{get(t,e,r){return t.hasVariant(e)?t.getVariant(e):e.toString().toUpperCase()===e?n.getDefaultVariant():Reflect.get(t,e,r)}})}function ae(){const n={};for(let t=0;t1?(r=e[0],i=e[1]):c>0&&(r+=a*c,i+=s*c)}return a=n[0]-r,s=n[1]-i,a*a+s*s}function $(n,t,e,r,i){let a=r,s;for(let c=t+1;ca&&(s=c,a=o)}a>r&&(s-t>1&&$(n,t,s,r,i),i.push(n[s]),e-s>1&&$(n,s,e,r,i))}function oe(n,t){const e=n.length-1,r=[n[0]];return $(n,0,e,t,r),r.push(n[e]),r}function ce(n,t){if(n.length<=2)return n;const e=t!==void 0?t*t:1;return oe(n,e)}function P(n,t=!0){let e=`${n[0]},${n[1]}`;return n.length===3&&t&&(e+=`,${n[2]}`),e}function w(n,t=3e3){let e=n.map(a=>a.join(",")).join("|"),r=5e-6;const i=1e-5;for(;e.length>t;)e=ce(n,r).map(a=>`${a[0]},${a[1]}`).join("|"),r+=i;return e}function le(n,t,e={}){var r,i,a,s,c;const o=E(e.style),l=e.hiDPI?"@2x":"",f=(r=e.format)!=null?r:"png";let u=~~((i=e.width)!=null?i:1024),m=~~((a=e.height)!=null?a:1024);e.hiDPI&&(u=~~(u/2),m=~~(m/2));const p=new URL(`maps/${encodeURIComponent(o)}/static/${n[0]},${n[1]},${t}/${u}x${m}${l}.${f}`,g.maptilerApiURL);if("attribution"in e&&p.searchParams.set("attribution",e.attribution.toString()),"markers"in e){let h="";const y="markerIcon"in e;y&&(h+=`icon:${e.markerIcon}|`),y&&"markerAnchor"in e&&(h+=`anchor:${e.markerAnchor}|`),y&&e.hiDPI&&(h+="scale:2|");const R=Array.isArray(e.markers[0])?e.markers:[e.markers];h+=R.map(V=>P(V,!y)).join("|"),p.searchParams.set("markers",h)}if("path"in e){let h="";if(h+=`fill:${(s=e.pathFillColor)!=null?s:"none"}|`,"pathStrokeColor"in e&&(h+=`stroke:${e.pathStrokeColor}|`),"pathWidth"in e){const y=e.pathWidth/(e.hiDPI?2:1);h+=`width:${y.toString()}|`}h+=w(e.path),p.searchParams.set("path",h)}return p.searchParams.set("key",(c=e.apiKey)!=null?c:d.apiKey),p.toString()}function pe(n,t={}){var e,r,i,a,s;const c=E(t.style),o=t.hiDPI?"@2x":"",l=(e=t.format)!=null?e:"png";let f=~~((r=t.width)!=null?r:1024),u=~~((i=t.height)!=null?i:1024);t.hiDPI&&(f=~~(f/2),u=~~(u/2));const m=new URL(`maps/${encodeURIComponent(c)}/static/${n[0]},${n[1]},${n[2]},${n[3]}/${f}x${u}${o}.${l}`,g.maptilerApiURL);if("attribution"in t&&m.searchParams.set("attribution",t.attribution.toString()),"padding"in t&&m.searchParams.set("padding",t.padding.toString()),"markers"in t){let p="";const h="markerIcon"in t;h&&(p+=`icon:${t.markerIcon}|`),h&&"markerAnchor"in t&&(p+=`anchor:${t.markerAnchor}|`),h&&t.hiDPI&&(p+="scale:2|");const y=Array.isArray(t.markers[0])?t.markers:[t.markers];p+=y.map(R=>P(R,!h)).join("|"),m.searchParams.set("markers",p)}if("path"in t){let p="";if(p+=`fill:${(a=t.pathFillColor)!=null?a:"none"}|`,"pathStrokeColor"in t&&(p+=`stroke:${t.pathStrokeColor}|`),"pathWidth"in t){const h=t.pathWidth/(t.hiDPI?2:1);p+=`width:${h.toString()}|`}p+=w(t.path),m.searchParams.set("path",p)}return m.searchParams.set("key",(s=t.apiKey)!=null?s:d.apiKey),m.toString()}function me(n={}){var t,e,r,i,a;if(!("markers"in n)&&!("path"in n))throw new Error("Automatic static maps require markers and/or path to be created.");const s=E(n.style),c=n.hiDPI?"@2x":"",o=(t=n.format)!=null?t:"png";let l=~~((e=n.width)!=null?e:1024),f=~~((r=n.height)!=null?r:1024);n.hiDPI&&(l=~~(l/2),f=~~(f/2));const u=new URL(`maps/${encodeURIComponent(s)}/static/auto/${l}x${f}${c}.${o}`,g.maptilerApiURL);if("attribution"in n&&u.searchParams.set("attribution",n.attribution.toString()),"padding"in n&&u.searchParams.set("padding",n.padding.toString()),"markers"in n){let m="";const p="markerIcon"in n;p&&(m+=`icon:${n.markerIcon}|`),p&&"markerAnchor"in n&&(m+=`anchor:${n.markerAnchor}|`),p&&n.hiDPI&&(m+="scale:2|");const h=Array.isArray(n.markers[0])?n.markers:[n.markers];m+=h.map(y=>P(y,!p)).join("|"),u.searchParams.set("markers",m)}if("path"in n){let m="";if(m+=`fill:${(i=n.pathFillColor)!=null?i:"none"}|`,"pathStrokeColor"in n&&(m+=`stroke:${n.pathStrokeColor}|`),"pathWidth"in n){const p=n.pathWidth/(n.hiDPI?2:1);m+=`width:${p.toString()}|`}m+=w(n.path),u.searchParams.set("path",m)}return u.searchParams.set("key",(a=n.apiKey)!=null?a:d.apiKey),u.toString()}const he={centered:le,bounded:pe,automatic:me};export{N as ClientConfig,I as LanguageGeocoding,H as MapStyle,D as MapStyleVariant,k as ReferenceMapStyle,v as ServiceError,d as config,ee as coordinates,re as data,x as expandMapStyle,q as geocoding,J as geolocation,L as mapStylePresetList,he as staticMaps}; +function G(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class N{constructor(){this._apiKey="",this._fetch=G()}set apiKey(t){this._apiKey=t}get apiKey(){return this._apiKey}set fetch(t){this._fetch=t}get fetch(){return this._fetch}}const d=new N,R={AUTO:"auto",ALBANIAN:"sq",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HUNGARIAN:"hu",ICELANDIC:"is",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALTESE:"mt",NORWEGIAN:"no",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},F=new Set(Object.values(R));function M(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const n=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>F.has(t));return n.length?n[0]:R.ENGLISH}var B=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});function A(n){return B(this,arguments,function*(t,e={}){if(d.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(t).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return d.fetch(t,e)})}const g={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(g);class v extends Error{constructor(t,e=""){super(`Call to enpoint ${t.url} failed with the status code ${t.status}. ${e}`),this.res=t}}var T=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const U={400:"Query too long / Invalid parameters",403:"Key is missing, invalid or restricted"};function b(n,t){if(t.language==null)return;const e=Array.from(new Set((Array.isArray(t.language)?t.language:[t.language]).map(r=>r===R.AUTO?M():r))).join(",");n.set("language",e)}function C(n,t){var e;n.set("key",(e=t.apiKey)!=null?e:d.apiKey),t.limit!=null&&n.set("limit",String(t.limit)),t.types!=null&&n.set("types",t.types.join(",")),b(n,t)}function W(n){return T(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const i=new URL(`geocoding/${encodeURIComponent(t)}.json`,g.maptilerApiURL),{searchParams:a}=i;C(a,e),e.bbox!=null&&a.set("bbox",e.bbox.join(",")),e.proximity!=null&&a.set("proximity",e.proximity.join(",")),e.country!=null&&a.set("country",e.country.join(",")),e.fuzzyMatch!=null&&a.set("fuzzyMatch",e.fuzzyMatch?"true":"false"),e.autocomplete!=null&&a.set("autocomplete",e.autocomplete?"true":"false");const s=i.toString(),c=yield A(s);if(!c.ok)throw new v(c,(r=U[c.status])!=null?r:"");return yield c.json()})}function z(n){return T(this,arguments,function*(t,e={}){var r;if(!Array.isArray(t)||t.length<2)throw new Error("The position must be an array of form [lng, lat].");const i=new URL(`geocoding/${t[0]},${t[1]}.json`,g.maptilerApiURL);C(i.searchParams,e);const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,(r=U[s.status])!=null?r:"");return yield s.json()})}function _(n){return T(this,arguments,function*(t,e={}){var r;const i=new URL(`geocoding/${t}.json`,g.maptilerApiURL);b(i.searchParams,e);const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,(r=U[s.status])!=null?r:"");return yield s.json()})}const q={forward:W,reverse:z,byId:_,language:R};var Y=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const K={403:"Key is missing, invalid or restricted"};function Z(){return Y(this,arguments,function*(n={}){var t;const e=new URL("geolocation/ip.json",g.maptilerApiURL);e.searchParams.set("key",(t=n.apiKey)!=null?t:d.apiKey);const r=e.toString(),i=yield A(r);if(!i.ok)throw new v(i,i.status in K?K[i.status]:"");return yield i.json()})}const J={info:Z};var O=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const L={403:"Key is missing, invalid or restricted"};function Q(n){return O(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const i=new URL(`coordinates/search/${t}.json`,g.maptilerApiURL);i.searchParams.set("key",(r=e.apiKey)!=null?r:d.apiKey),"limit"in e&&i.searchParams.set("limit",e.limit.toString()),"transformations"in e&&i.searchParams.set("transformations",e.transformations.toString()),"exports"in e&&i.searchParams.set("exports",e.exports.toString());const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,s.status in L?L[s.status]:"");return yield s.json()})}function X(n){return O(this,arguments,function*(t,e={}){var r;const i=(Array.isArray(t[0])?t:[t]).map(o=>`${o[0]},${o[1]}`).join(";"),a=new URL(`coordinates/transform/${i}.json`,g.maptilerApiURL);a.searchParams.set("key",(r=e.apiKey)!=null?r:d.apiKey),"sourceCrs"in e&&a.searchParams.set("s_srs",e.sourceCrs.toString()),"targetCrs"in e&&a.searchParams.set("t_srs",e.targetCrs.toString()),"operations"in e&&a.searchParams.set("ops",(Array.isArray(e.operations)?e.operations:[e.operations]).join("|"));const s=a.toString(),c=yield A(s);if(!c.ok)throw new v(c,c.status in L?L[c.status]:"");return yield c.json()})}const ee={search:Q,transform:X};var te=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const j={403:"Key is missing, invalid or restricted"};function ne(n){return te(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The data ID must be a non-empty string");const i=new URL(`data/${encodeURIComponent(t)}/features.json`,g.maptilerApiURL);i.searchParams.set("key",(r=e.apiKey)!=null?r:d.apiKey);const a=i.toString(),s=yield A(a);if(!s.ok)throw new v(s,s.status in j?j[s.status]:"");return yield s.json()})}const re={get:ne};function H(n){const t=/^maptiler:\/\/(.*)/;let e;const r=n.trim();let i;return r.startsWith("http://")||r.startsWith("https://")?i=r:(e=t.exec(r))!==null?i=`https://api.maptiler.com/maps/${e[1]}/style.json`:i=`https://api.maptiler.com/maps/${r}/style.json`,i}class D{constructor(t,e,r,i,a,s){this.name=t,this.variantType=e,this.id=r,this.referenceStyle=i,this.description=a,this.imageURL=s}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(t){return this.referenceStyle.hasVariant(t)}getVariant(t){return this.referenceStyle.getVariant(t)}getVariants(){return this.referenceStyle.getVariants().filter(t=>t!==this)}getImageURL(){return this.imageURL}getExpandedStyleURL(){return H(this.getId())}}class k{constructor(t,e){this.name=t,this.id=e,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(t){this.variants[t.getType()]=t,this.orderedVariants.push(t)}hasVariant(t){return t in this.variants}getVariant(t){return t in this.variants?this.variants[t]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0]}}const I=[{referenceStyleID:"STREETS",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"streets-v2-night",name:"Night",variantType:"NIGHT",description:"",imageURL:""},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"outdoor-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"WINTER",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"BASIC",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"TOPO",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:""},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]},{referenceStyleID:"VOYAGER",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER",name:"Toner",description:"",variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",description:"",imageURL:""},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:""},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OCEAN",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]}];function ie(n){return new Proxy(n,{get(t,e,r){return t.hasVariant(e)?t.getVariant(e):e.toString().toUpperCase()===e?n.getDefaultVariant():Reflect.get(t,e,r)}})}function ae(){const n={};for(let t=0;t1?(r=e[0],i=e[1]):c>0&&(r+=a*c,i+=s*c)}return a=n[0]-r,s=n[1]-i,a*a+s*s}function $(n,t,e,r,i){let a=r,s;for(let c=t+1;ca&&(s=c,a=o)}a>r&&(s-t>1&&$(n,t,s,r,i),i.push(n[s]),e-s>1&&$(n,s,e,r,i))}function oe(n,t){const e=n.length-1,r=[n[0]];return $(n,0,e,t,r),r.push(n[e]),r}function ce(n,t){if(n.length<=2)return n;const e=t!==void 0?t*t:1;return oe(n,e)}function w(n,t=!0){let e=`${n[0]},${n[1]}`;return n.length===3&&t&&(e+=`,${n[2]}`),e}function P(n,t=3e3){let e=n.map(a=>a.join(",")).join("|"),r=5e-6;const i=1e-5;for(;e.length>t;)e=ce(n,r).map(a=>`${a[0]},${a[1]}`).join("|"),r+=i;return e}function le(n,t,e={}){var r,i,a,s,c;const o=E(e.style),l=e.hiDPI?"@2x":"",f=(r=e.format)!=null?r:"png";let u=~~((i=e.width)!=null?i:1024),m=~~((a=e.height)!=null?a:1024);e.hiDPI&&(u=~~(u/2),m=~~(m/2));const p=new URL(`maps/${encodeURIComponent(o)}/static/${n[0]},${n[1]},${t}/${u}x${m}${l}.${f}`,g.maptilerApiURL);if("attribution"in e&&p.searchParams.set("attribution",e.attribution.toString()),"markers"in e){let h="";const y="markerIcon"in e;y&&(h+=`icon:${e.markerIcon}|`),y&&"markerAnchor"in e&&(h+=`anchor:${e.markerAnchor}|`),y&&e.hiDPI&&(h+="scale:2|");const S=Array.isArray(e.markers[0])?e.markers:[e.markers];h+=S.map(V=>w(V,!y)).join("|"),p.searchParams.set("markers",h)}if("path"in e){let h="";if(h+=`fill:${(s=e.pathFillColor)!=null?s:"none"}|`,"pathStrokeColor"in e&&(h+=`stroke:${e.pathStrokeColor}|`),"pathWidth"in e){const y=e.pathWidth/(e.hiDPI?2:1);h+=`width:${y.toString()}|`}h+=P(e.path),p.searchParams.set("path",h)}return p.searchParams.set("key",(c=e.apiKey)!=null?c:d.apiKey),p.toString()}function pe(n,t={}){var e,r,i,a,s;const c=E(t.style),o=t.hiDPI?"@2x":"",l=(e=t.format)!=null?e:"png";let f=~~((r=t.width)!=null?r:1024),u=~~((i=t.height)!=null?i:1024);t.hiDPI&&(f=~~(f/2),u=~~(u/2));const m=new URL(`maps/${encodeURIComponent(c)}/static/${n[0]},${n[1]},${n[2]},${n[3]}/${f}x${u}${o}.${l}`,g.maptilerApiURL);if("attribution"in t&&m.searchParams.set("attribution",t.attribution.toString()),"padding"in t&&m.searchParams.set("padding",t.padding.toString()),"markers"in t){let p="";const h="markerIcon"in t;h&&(p+=`icon:${t.markerIcon}|`),h&&"markerAnchor"in t&&(p+=`anchor:${t.markerAnchor}|`),h&&t.hiDPI&&(p+="scale:2|");const y=Array.isArray(t.markers[0])?t.markers:[t.markers];p+=y.map(S=>w(S,!h)).join("|"),m.searchParams.set("markers",p)}if("path"in t){let p="";if(p+=`fill:${(a=t.pathFillColor)!=null?a:"none"}|`,"pathStrokeColor"in t&&(p+=`stroke:${t.pathStrokeColor}|`),"pathWidth"in t){const h=t.pathWidth/(t.hiDPI?2:1);p+=`width:${h.toString()}|`}p+=P(t.path),m.searchParams.set("path",p)}return m.searchParams.set("key",(s=t.apiKey)!=null?s:d.apiKey),m.toString()}function me(n={}){var t,e,r,i,a;if(!("markers"in n)&&!("path"in n))throw new Error("Automatic static maps require markers and/or path to be created.");const s=E(n.style),c=n.hiDPI?"@2x":"",o=(t=n.format)!=null?t:"png";let l=~~((e=n.width)!=null?e:1024),f=~~((r=n.height)!=null?r:1024);n.hiDPI&&(l=~~(l/2),f=~~(f/2));const u=new URL(`maps/${encodeURIComponent(s)}/static/auto/${l}x${f}${c}.${o}`,g.maptilerApiURL);if("attribution"in n&&u.searchParams.set("attribution",n.attribution.toString()),"padding"in n&&u.searchParams.set("padding",n.padding.toString()),"markers"in n){let m="";const p="markerIcon"in n;p&&(m+=`icon:${n.markerIcon}|`),p&&"markerAnchor"in n&&(m+=`anchor:${n.markerAnchor}|`),p&&n.hiDPI&&(m+="scale:2|");const h=Array.isArray(n.markers[0])?n.markers:[n.markers];m+=h.map(y=>w(y,!p)).join("|"),u.searchParams.set("markers",m)}if("path"in n){let m="";if(m+=`fill:${(i=n.pathFillColor)!=null?i:"none"}|`,"pathStrokeColor"in n&&(m+=`stroke:${n.pathStrokeColor}|`),"pathWidth"in n){const p=n.pathWidth/(n.hiDPI?2:1);m+=`width:${p.toString()}|`}m+=P(n.path),u.searchParams.set("path",m)}return u.searchParams.set("key",(a=n.apiKey)!=null?a:d.apiKey),u.toString()}const he={centered:le,bounded:pe,automatic:me};export{N as ClientConfig,R as LanguageGeocoding,x as MapStyle,D as MapStyleVariant,k as ReferenceMapStyle,v as ServiceError,d as config,ee as coordinates,re as data,H as expandMapStyle,q as geocoding,J as geolocation,I as mapStylePresetList,he as staticMaps}; diff --git a/dist/maptiler-client.mjs b/dist/maptiler-client.mjs index 24dc765..10568a1 100644 --- a/dist/maptiler-client.mjs +++ b/dist/maptiler-client.mjs @@ -674,6 +674,13 @@ const mapStylePresetList = [ description: "", imageURL: "" }, + { + id: "streets-v2-night", + name: "Night", + variantType: "NIGHT", + description: "", + imageURL: "" + }, { id: "streets-v2-pastel", name: "Pastel", @@ -694,6 +701,13 @@ const mapStylePresetList = [ variantType: "DEFAULT", description: "", imageURL: "" + }, + { + id: "outdoor-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" } ] }, @@ -704,10 +718,17 @@ const mapStylePresetList = [ variants: [ { id: "winter-v2", - name: "Winter", + name: "Default", variantType: "DEFAULT", description: "", imageURL: "" + }, + { + id: "winter-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" } ] }, @@ -828,6 +849,13 @@ const mapStylePresetList = [ description: "", imageURL: "" }, + { + id: "topo-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" + }, { id: "topo-v2-shiny", name: "Shiny", diff --git a/dist/maptiler-client.mjs.map b/dist/maptiler-client.mjs.map index 3f25c06..a1adbac 100644 --- a/dist/maptiler-client.mjs.map +++ b/dist/maptiler-client.mjs.map @@ -1 +1 @@ -{"version":3,"file":"maptiler-client.mjs","sources":["../src/config.ts","../src/language.ts","../src/callFetch.ts","../src/defaults.ts","../src/services/ServiceError.ts","../src/services/geocoding.ts","../src/services/geolocation.ts","../src/services/coordinates.ts","../src/services/data.ts","../src/mapstyle.ts","../src/services/simplify.ts","../src/services/staticMaps.ts"],"sourcesContent":["export type FetchFunction = (url: string, options: object) => Promise;\n\nfunction tryGettingFetch() {\n // this is browser, fetch exists\n if (typeof self !== \"undefined\") {\n return fetch.bind(self);\n }\n\n if (typeof global !== \"undefined\" && global.fetch) {\n return global.fetch;\n }\n\n return null;\n}\n\n/**\n * The configuration object definition\n */\nclass ClientConfig {\n /**\n * MapTiler Cloud API key\n */\n private _apiKey = \"\";\n\n /**\n * The fetch function. To be set if in Node < 18, otherwise\n * will be automatically resolved.\n */\n private _fetch: FetchFunction | null = tryGettingFetch();\n\n /**\n * Set the MapTiler Cloud API key\n */\n set apiKey(k: string) {\n this._apiKey = k;\n }\n\n /**\n * Get the MapTiler Cloud API key\n */\n get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * Set a the custom fetch function to replace the default one\n */\n set fetch(f: FetchFunction) {\n this._fetch = f;\n }\n\n /**\n * Get the fetch fucntion\n */\n get fetch(): FetchFunction | null {\n return this._fetch;\n }\n}\n\n/**\n * Configuration object\n */\nconst config = new ClientConfig();\n\nexport { ClientConfig, config };\n","/**\n * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.\n */\nconst LanguageGeocoding = {\n AUTO: \"auto\",\n ALBANIAN: \"sq\",\n ARABIC: \"ar\",\n ARMENIAN: \"hy\",\n AZERBAIJANI: \"az\",\n BELORUSSIAN: \"be\",\n BOSNIAN: \"bs\",\n BRETON: \"br\",\n BULGARIAN: \"bg\",\n CATALAN: \"ca\",\n CHINESE: \"zh\",\n CROATIAN: \"hr\",\n CZECH: \"cs\",\n DANISH: \"da\",\n DUTCH: \"nl\",\n ENGLISH: \"en\",\n ESPERANTO: \"eo\",\n ESTONIAN: \"et\",\n FINNISH: \"fi\",\n FRENCH: \"fr\",\n FRISIAN: \"fy\",\n GEORGIAN: \"ka\",\n GERMAN: \"de\",\n GREEK: \"el\",\n HEBREW: \"he\",\n HUNGARIAN: \"hu\",\n ICELANDIC: \"is\",\n IRISH: \"ga\",\n ITALIAN: \"it\",\n JAPANESE: \"ja\",\n KANNADA: \"kn\",\n KAZAKH: \"kk\",\n KOREAN: \"ko\",\n ROMAN_LATIN: \"la\",\n LATVIAN: \"lv\",\n LITHUANIAN: \"lt\",\n LUXEMBOURGISH: \"lb\",\n MACEDONIAN: \"mk\",\n MALTESE: \"mt\",\n NORWEGIAN: \"no\",\n POLISH: \"pl\",\n PORTUGUESE: \"pt\",\n ROMANIAN: \"ro\",\n ROMANSH: \"rm\",\n RUSSIAN: \"ru\",\n SCOTTISH_GAELIC: \"gd\",\n SERBIAN_CYRILLIC: \"sr\",\n SLOVAK: \"sk\",\n SLOVENE: \"sl\",\n SPANISH: \"es\",\n SWEDISH: \"sv\",\n THAI: \"th\",\n TURKISH: \"tr\",\n UKRAINIAN: \"uk\",\n WELSH: \"cy\",\n};\n\nconst languageCodeSet = new Set(Object.values(LanguageGeocoding));\n\ntype Values = T[keyof T];\n\n/**\n * Built-in languages values as strings\n */\ntype LanguageGeocodingString = Values;\n\nfunction getAutoLanguageGeocoding(): LanguageGeocodingString {\n if (typeof navigator === \"undefined\") {\n return Intl.DateTimeFormat()\n .resolvedOptions()\n .locale.split(\"-\")[0] as LanguageGeocodingString;\n }\n\n const canditatelangs = Array.from(\n new Set(navigator.languages.map((l) => l.split(\"-\")[0]))\n ).filter((l) => languageCodeSet.has(l as LanguageGeocodingString));\n\n return canditatelangs.length\n ? (canditatelangs[0] as LanguageGeocodingString)\n : LanguageGeocoding.ENGLISH;\n}\n\nexport { LanguageGeocoding, LanguageGeocodingString, getAutoLanguageGeocoding };\n","import { config } from \"./config\";\n\nexport async function callFetch(resource, options = {}) {\n if (config.fetch === null) {\n throw new Error(\n \"The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch\"\n );\n }\n\n // Control if URL contains the api key\n if (new URL(resource).searchParams.get(\"key\").trim() === \"\") {\n throw new Error(\n \"The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com\"\n );\n }\n\n return config.fetch(resource, options);\n}\n","/**\n * Some default settings for the SDK\n */\nconst defaults = {\n maptilerApiURL: \"https://api.maptiler.com/\",\n mapStyle: \"streets-v2\",\n};\n\nObject.freeze(defaults);\n\nexport { defaults };\n","/**\n * A ServiceError is an Error that includes the HTTP response details\n */\nexport class ServiceError extends Error {\n constructor(public res: Response, customMessage = \"\") {\n super(\n `Call to enpoint ${res.url} failed with the status code ${res.status}. ${customMessage}`\n );\n }\n}\n","import { BBox, Feature, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\n\nimport {\n getAutoLanguageGeocoding,\n LanguageGeocoding,\n LanguageGeocodingString,\n} from \"../language\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 400: \"Query too long / Invalid parameters\",\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type LanguageGeocodingOptions = {\n /**\n * Prefer results in specific language. It’s possible to specify multiple values.\n */\n language?: LanguageGeocodingString | Array;\n};\n\nexport type CommonForwardAndReverseGeocodingOptions =\n LanguageGeocodingOptions & {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.\n */\n limit?: number;\n\n /**\n * Filter of feature types to return. If not specified, all available feature types are returned.\n */\n types?: (\n | \"country\"\n | \"region\"\n | \"subregion\"\n | \"county\"\n | \"joint_municipality\"\n | \"joint_submunicipality\"\n | \"municipality\"\n | \"municipal_district\"\n | \"locality\"\n | \"neighbourhood\"\n | \"place\"\n | \"postal_code\"\n | \"address\"\n )[];\n };\n\nexport type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {\n /**\n * Only search for results in the specified area.\n */\n bbox?: BBox;\n\n /**\n * Prefer results close to a specific location.\n */\n proximity?: Position;\n\n /**\n * Limit search to specific country/countries specified as list of Alpha-2 ISO 3166-1 codes.\n */\n country?: string[];\n\n /**\n * Set to `false` to disable fuzzy (typo-tolerant) search. Default is `true`.\n */\n fuzzyMatch?: boolean;\n\n /**\n * Set to `true` to use autocomplete, `false` to disable it.\n * Default (`undefined`) is to combine autocomplete with non-autocomplete results.\n */\n autocomplete?: boolean;\n};\n\nexport type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;\n\nexport type ByIdGeocodingOptions = LanguageGeocodingOptions;\n\nexport type Coordinates = Position;\n\nexport type FeatureHierarchy = {\n /**\n * Unique feature ID\n */\n id: string;\n\n /**\n * Localized feature name\n */\n text: string;\n};\n\nexport type GeocodingFeature = Feature & {\n /**\n * Bounding box of the original feature as [w, s, e, n] array\n */\n bbox: BBox;\n\n /**\n * A [lon, lat] array of the original feature centeroid\n */\n center: Coordinates;\n\n /**\n * Formatted (including the hierarchy) and localized feature full name\n */\n place_name: string;\n\n /**\n * Localized feature name\n */\n text: string;\n\n /**\n * Feature hierarchy\n */\n context?: Array;\n\n /**\n * Address number, if applicable\n */\n address?: string;\n};\n\nexport type GeocodingSearchResult = {\n type: \"FeatureCollection\";\n\n /**\n * Array of features found\n */\n features: Array;\n\n /**\n * Tokenized search query\n */\n query: Array;\n\n /**\n * Attribution of the result\n */\n attribution: string;\n};\n\nfunction addLanguageGeocodingOptions(\n searchParams: URLSearchParams,\n options: LanguageGeocodingOptions\n) {\n if (options.language == undefined) {\n return;\n }\n\n const languages = Array.from(\n new Set(\n (Array.isArray(options.language)\n ? options.language\n : [options.language]\n ).map((lang) =>\n lang === LanguageGeocoding.AUTO ? getAutoLanguageGeocoding() : lang\n )\n )\n ).join(\",\");\n\n searchParams.set(\"language\", languages);\n}\n\nfunction addCommonForwardAndReverseGeocodingOptions(\n searchParams: URLSearchParams,\n options: CommonForwardAndReverseGeocodingOptions\n) {\n searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (options.limit != undefined) {\n searchParams.set(\"limit\", String(options.limit));\n }\n\n if (options.types != undefined) {\n searchParams.set(\"types\", options.types.join(\",\"));\n }\n\n addLanguageGeocodingOptions(searchParams, options);\n}\n\n/**\n * Performs a forward geocoding query to MapTiler API.\n * Providing a human readable place name (of a city, country, street, etc.), the function returns\n * a list of candidate locations including longitude and latitude.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward\n * @param query\n * @param options\n * @returns\n */\nasync function forward(\n query: string,\n options: GeocodingOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `geocoding/${encodeURIComponent(query)}.json`,\n defaults.maptilerApiURL\n );\n\n const { searchParams } = endpoint;\n\n addCommonForwardAndReverseGeocodingOptions(searchParams, options);\n\n if (options.bbox != undefined) {\n searchParams.set(\"bbox\", options.bbox.join(\",\"));\n }\n\n if (options.proximity != undefined) {\n searchParams.set(\"proximity\", options.proximity.join(\",\"));\n }\n\n if (options.country != undefined) {\n searchParams.set(\"country\", options.country.join(\",\"));\n }\n\n if (options.fuzzyMatch != undefined) {\n searchParams.set(\"fuzzyMatch\", options.fuzzyMatch ? \"true\" : \"false\");\n }\n\n if (options.autocomplete != undefined) {\n searchParams.set(\"autocomplete\", options.autocomplete ? \"true\" : \"false\");\n }\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a reverse geocoding query to MapTiler API.\n * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse\n * @param position\n * @param options\n * @returns\n */\nasync function reverse(\n position: Position,\n options: ReverseGeocodingOptions = {}\n): Promise {\n if (!Array.isArray(position) || position.length < 2) {\n throw new Error(\"The position must be an array of form [lng, lat].\");\n }\n\n const endpoint = new URL(\n `geocoding/${position[0]},${position[1]}.json`,\n defaults.maptilerApiURL\n );\n\n addCommonForwardAndReverseGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a geocoding query to MapTiler API to obtain fature by its ID.\n * Providing a feature ID, this function returns a feature which includes its full geometry.\n * Note that the feature ID is not stable and it changes when the database is re-indexed.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id\n * @param id\n * @param options\n * @returns\n */\nasync function byId(\n id: string,\n options: ByIdGeocodingOptions = {}\n): Promise {\n const endpoint = new URL(`geocoding/${id}.json`, defaults.maptilerApiURL);\n\n addLanguageGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * The **geocoding** namespace contains asynchronous functions to call the [MapTiler Geocoding API](https://docs.maptiler.com/cloud/api/geocoding/).\n * The **Geocoding API** provides ways to get geographic coordinates from a human-readable search query of a place (forward geocoding)\n * and to get the location details (country, city, street, etc.) from a geographic coordinate (reverse geocoding);\n */\nconst geocoding = {\n forward,\n reverse,\n byId,\n language: LanguageGeocoding,\n};\n\nexport { geocoding };\n","import { BBox } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GeolocationInfoOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\nexport type GeolocationResult = {\n /**\n * Name of the country\n * Example: Switzerland\n */\n country?: string;\n\n /**\n * Two-letter code of the country ISO 3166-1 alpha-2 codes\n * Example: CH\n */\n country_code?: string;\n\n /**\n * Bounds of the country in WGS84 degrees [west, south, east, north].\n * Example: [5.95538,45.818852,10.490936,47.809357]\n */\n country_bounds?: BBox;\n\n /**\n * Official country languages in ISO 639-1 format. ISO 639-1 codes\n * Example: [\"de\",\"fr\",\"it\"]\n */\n country_languages?: Array;\n\n /**\n * Name of the continent\n * Example: Europe\n */\n continent?: string;\n\n /**\n * Two-letter code of the continent\n * Example: EU\n */\n continent_code?: string;\n\n /**\n * Indicated whether the country is part of the European Union.\n */\n eu?: boolean;\n\n /**\n * Name of the city\n * Example: Zurich\n */\n city?: string;\n\n /**\n * Latitude of the location\n * Example: 47.36667\n */\n latitude?: number;\n\n /**\n * Longitude of the location\n * Example: 8.55\n */\n longitude?: number;\n\n /**\n * Postal code\n * Example: 8000\n */\n postal?: string;\n\n /**\n * If known, the ISO 3166-2 name for the first level region. ISO 3166-2 codes\n * Example: Zurich\n */\n region?: string;\n\n /**\n * If known, the ISO 3166-2 code for the first level region. ISO 3166-2 codes\n * Example: ZH\n */\n region_code?: string;\n\n /**\n * Name of the timezone\n * Example: Europe/Zurich\n */\n timezone?: string;\n};\n\n/**\n * Looks up geolocation details from IP address using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geolocation/#ip-geolocation\n * @returns\n */\nasync function info(\n options: GeolocationInfoOptions = {}\n): Promise {\n const endpoint = new URL(`geolocation/ip.json`, defaults.maptilerApiURL);\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as GeolocationResult;\n}\n\n/**\n * The **geolocation** namespace contains an asynchronous function to call the [MapTiler Geolocation API](https://docs.maptiler.com/cloud/api/geolocation/).\n * The **Geolocation API** provides a way to retrieve the IP address as well as geographic informations of a machine performing the query (most likely: a user)\n */\nconst geolocation = {\n info,\n};\n\nexport { geolocation };\n","import { BBox, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type CoordinatesSearchOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results returned (default: 10)\n */\n limit?: number;\n\n /**\n * Show detailed transformations for each CRS (default: false)\n */\n transformations?: boolean;\n\n /**\n * Show exports in WKT and Proj4 notations (default: false)\n */\n exports?: boolean;\n};\n\nexport type CoordinateId = {\n authority: string;\n code: BigInteger;\n};\n\nexport type CoordinateExport = {\n proj4: string;\n wkt: string;\n};\n\nexport type CoordinateGrid = {\n path: string;\n};\n\nexport type CoordinateTransformation = {\n id: CoordinateId;\n name: string;\n reversible: boolean;\n usable: boolean;\n deprecated: boolean;\n grids: Array;\n accuracy?: number;\n area?: string;\n bbox?: BBox;\n target_crs?: CoordinateId;\n unit?: string;\n};\n\nexport type CoordinateSearch = {\n id: CoordinateId;\n\n name: string;\n\n kind: string;\n\n deprecated: boolean;\n\n transformations?: Array;\n\n accuracy?: number;\n\n unit?: string;\n\n area?: string;\n\n /**\n * Bounding box of the resource in [min_lon, min_lat, max_lon, max_lat] order.\n */\n bbox?: BBox;\n\n /**\n * Most suitable transformation for this CRS.\n */\n default_transformation?: any;\n\n exports: CoordinateExport;\n};\n\nexport type CoordinateSearchResult = {\n /**\n * The coordinate search results\n */\n results: Array;\n\n /**\n * The number of results\n */\n total: number;\n};\n\n/**\n * Search information about coordinate systems using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems\n * @param query Can be any kind of CRS by name or code\n * @param options\n * @returns\n */\nasync function search(\n query: string,\n options: CoordinatesSearchOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `coordinates/search/${query}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"limit\" in options) {\n endpoint.searchParams.set(\"limit\", options.limit.toString());\n }\n\n if (\"transformations\" in options) {\n endpoint.searchParams.set(\n \"transformations\",\n options.transformations.toString()\n );\n }\n\n if (\"exports\" in options) {\n endpoint.searchParams.set(\"exports\", options.exports.toString());\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateSearchResult;\n}\n\nexport type XYZ = {\n x?: number;\n y?: number;\n z?: number;\n};\n\nexport type CoordinateTransformResult = {\n results: Array;\n\n /**\n * Transformations are selected using given ops parameter.\n * If no parameter is given, auto strategy is used.\n * If given, it may try to use a listed transformation,\n * then fallback to towgs84 patching, and finally boundcrs.\n */\n transformer_selection_strategy: string;\n};\n\n/**\n * Options that can be provided when transforming a coordinate from one CRS to another.\n */\nexport type CoordinatesTransformOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Source coordinate reference system (default: 4326)\n */\n sourceCrs?: number;\n\n /**\n * Target coordinate reference system (default: 4326)\n */\n targetCrs?: number;\n\n /**\n * List of codes of operations\n */\n operations?: number | Array;\n};\n\n/**\n * Transforms coordinates from a source reference system to a target reference system using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates\n * @param positions\n * @param options\n * @returns\n */\nasync function transform(\n positions: Position | Array,\n options: CoordinatesTransformOptions = {}\n): Promise {\n const coordinatesStr = (Array.isArray(positions[0]) ? positions : [positions])\n .map((coord) => `${coord[0]},${coord[1]}`)\n .join(\";\");\n\n const endpoint = new URL(\n `coordinates/transform/${coordinatesStr}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"sourceCrs\" in options) {\n endpoint.searchParams.set(\"s_srs\", options.sourceCrs.toString());\n }\n\n if (\"targetCrs\" in options) {\n endpoint.searchParams.set(\"t_srs\", options.targetCrs.toString());\n }\n\n if (\"operations\" in options) {\n endpoint.searchParams.set(\n \"ops\",\n (Array.isArray(options.operations)\n ? options.operations\n : [options.operations]\n ).join(\"|\")\n );\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateTransformResult;\n}\n\n/**\n * The **coordinate** namespace contains asynchronous functions to call the [MapTiler Coordinate API](https://docs.maptiler.com/cloud/api/coordinates/).\n * The goal of the **Coordinate API* is query information about spatial coordinate reference system (CRS) as well as to transform coordinates from one CRS to another.\n */\nconst coordinates = {\n search,\n transform,\n};\n\nexport { coordinates };\n","import { FeatureCollection } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GetDataOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\n/**\n * Get user data and returns it as GeoJSON using the MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/data/#geojson\n * @param dataId\n * @returns\n */\nasync function get(\n dataId: string,\n options: GetDataOptions = {}\n): Promise {\n if (typeof dataId !== \"string\" || dataId.trim().length === 0) {\n throw new Error(\"The data ID must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `data/${encodeURIComponent(dataId)}/features.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj;\n}\n\n/**\n * The **data** namespace contains an asynchronous function to call the [MapTiler Data API](https://docs.maptiler.com/cloud/api/data/).\n * The **Data API** provides a way to retrieve user data in GeoJSON format.\n */\nconst data = {\n get,\n};\n\nexport { data };\n","/**\n * Expand the map style provided as argument of the Map constructor\n * @param style\n * @returns\n */\nexport function expandMapStyle(style): string {\n // testing if the style provided is of form \"maptiler://some-style\"\n const maptilerDomainRegex = /^maptiler:\\/\\/(.*)/;\n let match;\n const trimmed = style.trim();\n let expandedStyle;\n\n // The style was possibly already given as expanded URL\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n expandedStyle = trimmed;\n } else if ((match = maptilerDomainRegex.exec(trimmed)) !== null) {\n expandedStyle = `https://api.maptiler.com/maps/${match[1]}/style.json`;\n } else {\n // The style could also possibly just be the name of the style without any URI style\n expandedStyle = `https://api.maptiler.com/maps/${trimmed}/style.json`;\n }\n\n return expandedStyle;\n}\n\n/**\n * Type for object containing style details\n */\nexport type MapStylePreset = {\n referenceStyleID: string;\n name: string;\n description: string;\n variants: Array<{\n id: string;\n name: string;\n variantType: string;\n description: string;\n imageURL: string;\n }>;\n};\n\n/**\n * An instance of MapStyleVariant contains information about a style to use that belong to a reference style\n */\nexport class MapStyleVariant {\n constructor(\n /**\n * Human-friendly name\n */\n private name: string,\n\n /**\n * Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE`\n */\n private variantType: string,\n\n /**\n * MapTiler Cloud id\n */\n private id: string,\n\n /**\n * Reference map style, used to retrieve sibling variants\n */\n private referenceStyle: ReferenceMapStyle,\n\n /**\n * Human-friendly description\n */\n private description: string,\n\n /**\n * URL to an image describing the style variant\n */\n private imageURL: string\n ) {}\n\n /**\n * Get the human-friendly name\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n getFullName(): string {\n return `${this.referenceStyle.getName()} ${this.name}`;\n }\n\n /**\n * Get the variant type (eg. \"DEFAULT\", \"DARK\", \"PASTEL\", etc.)\n * @returns\n */\n getType(): string {\n return this.variantType;\n }\n\n /**\n * Get the MapTiler Cloud id\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Get the human-friendly description\n */\n getDescription(): string {\n return this.description;\n }\n\n /**\n * Get the reference style this variant belongs to\n * @returns\n */\n getReferenceStyle(): ReferenceMapStyle {\n return this.referenceStyle;\n }\n\n /**\n * Check if a variant of a given type exists for _this_ variants\n * (eg. if this is a \"DARK\", then we can check if there is a \"LIGHT\" variant of it)\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return this.referenceStyle.hasVariant(variantType);\n }\n\n /**\n * Retrieve the variant of a given type. If not found, will return the \"DEFAULT\" variant.\n * (eg. _this_ \"DARK\" variant does not have any \"PASTEL\" variant, then the \"DEFAULT\" is returned)\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return this.referenceStyle.getVariant(variantType);\n }\n\n /**\n * Get all the variants for _this_ variants, except _this_ current one\n * @returns\n */\n getVariants(): Array {\n return this.referenceStyle.getVariants().filter((v) => v !== this);\n }\n\n /**\n * Get the image URL that represent _this_ variant\n * @returns\n */\n getImageURL(): string {\n return this.imageURL;\n }\n\n /**\n * Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)\n * @returns\n */\n getExpandedStyleURL(): string {\n return expandMapStyle(this.getId());\n }\n}\n\n/**\n * An instance of reference style contains a list of StyleVariants ordered by relevance\n */\nexport class ReferenceMapStyle {\n /**\n * Variants that belong to this reference style, key being the reference type\n */\n private variants: { [key: string]: MapStyleVariant } = {};\n\n /**\n * Variants that belong to this reference style, ordered by relevance\n */\n private orderedVariants: Array = [];\n\n constructor(\n /**\n * Human-friendly name of this reference style\n */\n private name: string,\n\n /**\n * ID of this reference style\n */\n private id: string\n ) {}\n\n /**\n * Get the human-friendly name of this reference style\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the id of _this_ reference style\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Add a variant to _this_ reference style\n * @param v\n */\n addVariant(v: MapStyleVariant) {\n this.variants[v.getType()] = v;\n this.orderedVariants.push(v);\n }\n\n /**\n * Check if a given variant type exists for this reference style\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return variantType in this.variants;\n }\n\n /**\n * Get a given variant. If the given type of variant does not exist for this reference style,\n * then the most relevant default variant is returned instead\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return variantType in this.variants\n ? this.variants[variantType]\n : this.orderedVariants[0];\n }\n\n /**\n * Get the list of variants for this reference style\n * @returns\n */\n getVariants(): Array {\n return Object.values(this.variants);\n }\n\n /**\n * Get the defualt variant for this reference style\n * @returns\n */\n getDefaultVariant(): MapStyleVariant {\n return this.orderedVariants[0];\n }\n}\n\n/**\n * All the styles and variants maintained by MapTiler.\n */\nexport type MapStyleType = {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings\n */\n STREETS: ReferenceMapStyle & {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in dark mode.\n */\n DARK: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode.\n */\n LIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette.\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n OUTDOOR: ReferenceMapStyle & {\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n WINTER: ReferenceMapStyle & {\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery only, without any label.\n */\n SATELLITE: ReferenceMapStyle & {\n /**\n * High resolution imagery only, without any label.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n HYBRID: ReferenceMapStyle & {\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A minimalist street-oriented style without POI\n */\n BASIC: ReferenceMapStyle & {\n /**\n * A minimalist street-oriented style without POI\n */\n DEFAULT: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n BRIGHT: ReferenceMapStyle & {\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, with a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Classic OpenStreetMap style\n */\n OPENSTREETMAP: ReferenceMapStyle & {\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPO: ReferenceMapStyle & {\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n SHINY: MapStyleVariant;\n /**\n * A nice low-contrast, alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, using a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n\n /**\n * A nice very high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPOGRAPHIQUE: MapStyleVariant;\n };\n\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n VOYAGER: ReferenceMapStyle & {\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in very dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A nice alternative to `streets` with a soft sepia color palette and vintage look\n */\n VINTAGE: MapStyleVariant;\n };\n\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n TONER: ReferenceMapStyle & {\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, without any label\n */\n BACKGROUND: MapStyleVariant;\n /**\n * A bold very high contrast, yet faded, style for the city\n */\n LITE: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, with no building, only roads!\n */\n LINES: MapStyleVariant;\n };\n\n /**\n * Minimalist style, perfect for data visualization\n */\n DATAVIZ: ReferenceMapStyle & {\n /**\n * Minimalist style, perfect for data visualization\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in dark mode\n */\n DARK: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n OCEAN: ReferenceMapStyle & {\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n DEFAULT: MapStyleVariant;\n };\n};\n\nexport const mapStylePresetList: Array = [\n {\n referenceStyleID: \"STREETS\",\n name: \"Streets\",\n description: \"\",\n variants: [\n {\n id: \"streets-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OUTDOOR\",\n name: \"Outdoor\",\n description: \"\",\n variants: [\n {\n id: \"outdoor-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"WINTER\",\n name: \"Winter\",\n description: \"\",\n variants: [\n {\n id: \"winter-v2\",\n name: \"Winter\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"SATELLITE\",\n name: \"Satellite\",\n description: \"\",\n variants: [\n {\n id: \"satellite\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"HYBRID\",\n name: \"Hybrid\",\n description: \"\",\n variants: [\n {\n id: \"hybrid\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BASIC\",\n name: \"Basic\",\n description: \"\",\n variants: [\n {\n id: \"basic-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BRIGHT\",\n name: \"Bright\",\n description: \"\",\n variants: [\n {\n id: \"bright-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OPENSTREETMAP\",\n name: \"OpenStreetMap\",\n description: \"\",\n variants: [\n {\n id: \"openstreetmap\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TOPO\",\n name: \"Topo\",\n description: \"\",\n variants: [\n {\n id: \"topo-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-shiny\",\n name: \"Shiny\",\n variantType: \"SHINY\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-topographique\",\n name: \"Topographique\",\n variantType: \"TOPOGRAPHIQUE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"VOYAGER\",\n name: \"Voyager\",\n description: \"\",\n variants: [\n {\n id: \"voyager-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-darkmatter\",\n name: \"Darkmatter\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-positron\",\n name: \"Positron\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-vintage\",\n name: \"Vintage\",\n variantType: \"VINTAGE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TONER\",\n name: \"Toner\",\n description: \"\",\n variants: [\n {\n id: \"toner-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-background\",\n name: \"Background\",\n variantType: \"BACKGROUND\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lite\",\n name: \"Lite\",\n variantType: \"LITE\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lines\",\n name: \"Lines\",\n variantType: \"LINES\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"DATAVIZ\",\n name: \"Dataviz\",\n description: \"\",\n variants: [\n {\n id: \"dataviz\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OCEAN\",\n name: \"Ocean\",\n description: \"\",\n variants: [\n {\n id: \"ocean\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n];\n\nfunction makeReferenceStyleProxy(referenceStyle: ReferenceMapStyle) {\n return new Proxy(referenceStyle, {\n get(target, prop, receiver) {\n if (target.hasVariant(prop as string)) {\n return target.getVariant(prop as string);\n }\n\n // This variant does not exist for this style, but since it's full uppercase\n // we guess that the dev tries to access a style variant. So instead of\n // returning the default (STREETS.DEFAULT), we return the non-variant of the current style\n if (prop.toString().toUpperCase() === (prop as string)) {\n return referenceStyle.getDefaultVariant();\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\nfunction buildMapStyles(): MapStyleType {\n const mapStyle = {};\n\n for (let i = 0; i < mapStylePresetList.length; i += 1) {\n const refStyleInfo = mapStylePresetList[i];\n\n const refStyle = makeReferenceStyleProxy(\n new ReferenceMapStyle(refStyleInfo.name, refStyleInfo.referenceStyleID)\n );\n\n for (let j = 0; j < refStyleInfo.variants.length; j += 1) {\n const variantInfo = refStyleInfo.variants[j];\n const variant = new MapStyleVariant(\n variantInfo.name, // name\n variantInfo.variantType, // variantType\n variantInfo.id, // id\n refStyle, // referenceStyle\n variantInfo.description,\n variantInfo.imageURL // imageURL\n );\n\n refStyle.addVariant(variant);\n }\n mapStyle[refStyleInfo.referenceStyleID] = refStyle;\n }\n return mapStyle as MapStyleType;\n}\n\nexport function styleToStyle(\n style: string | ReferenceMapStyle | MapStyleVariant | null | undefined\n): string {\n if (!style) {\n return MapStyle[mapStylePresetList[0].referenceStyleID]\n .getDefaultVariant()\n .getId();\n }\n\n // If the provided style is a shorthand (eg. \"streets-v2\") then we make sure it's trimmed and lowercase\n if (typeof style === \"string\" || style instanceof String) {\n return style.trim().toLowerCase();\n }\n\n if (style instanceof MapStyleVariant) {\n return style.getId();\n }\n\n if (style instanceof ReferenceMapStyle) {\n return style.getDefaultVariant().getId();\n }\n}\n\n/**\n * Contains all the reference map style created by MapTiler team as well as all the variants.\n * For example, `MapStyle.STREETS` and the variants:\n * - `MapStyle.STREETS.DARK`\n * - `MapStyle.STREETS.LIGHT`\n * - `MapStyle.STREETS.PASTEL`\n *\n */\nexport const MapStyle: MapStyleType = buildMapStyles();\n","/**\\\n * This code is borrowed from https://github.com/mourner/simplify-js and reworked a little.\n */\n\nimport { Position } from \"geojson\";\n\n// square distance from a point to a segment\nfunction getSqSegDist(p: Position, p1: Position, p2: Position): number {\n let x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n\nfunction simplifyDPStep(\n points: Array,\n first: number,\n last: number,\n sqTolerance: number,\n simplified: Array\n) {\n let maxSqDist = sqTolerance,\n index;\n\n for (let i = first + 1; i < last; i++) {\n const sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) {\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n }\n simplified.push(points[index]);\n\n if (last - index > 1) {\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(\n points: Array,\n sqTolerance: number\n): Array {\n const last = points.length - 1;\n const simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nexport default function simplify(\n points: Array,\n tolerance: number\n): Array {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n const simplePoints = simplifyDouglasPeucker(points, sqTolerance);\n return simplePoints;\n}\n","import { BBox, Position } from \"geojson\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { MapStyleVariant, ReferenceMapStyle, styleToStyle } from \"../mapstyle\";\nimport simplify from \"./simplify\";\n\n/**\n * Base set of options that can be provided to all the types of static maps\n */\nexport type StaticMapBaseOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Style of the map (not full style URL). Example: \"winter\", \"streets-v2\".\n * Default: `\"streets-v2\"`\n */\n style?: string | ReferenceMapStyle | MapStyleVariant;\n\n /**\n * Double the size of the static map image to support hiDPI/Retina monitors.\n * Default: `false`\n */\n hiDPI?: boolean;\n\n /**\n * Image format.\n * Default: `\"png\"`\n */\n format?: \"png\" | \"jpg\" | \"webp\";\n\n /**\n * Width of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n width?: number;\n\n /**\n * Height of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n height?: number;\n\n /**\n * Placement of the attribution. Can also be set to `false` to not show attribution.\n * Default: `\"bottomright\"`\n */\n attribution?: \"bottomright\" | \"bottomleft\" | \"topleft\" | \"topright\" | false;\n\n /**\n * A marker or list of markers to show on the map\n * Default: none provided\n */\n markers?: StaticMapMarker | Array;\n\n /**\n * URL of the marker image. Applies only if one or multiple markers positions are provided.\n * Default: none provided\n */\n markerIcon?: string;\n\n /**\n * Position of the marker regarding its coordinates. Applies only:\n * - with a custom icon provided with `markerIcon`\n * - if one or multiple markers positions are provided.\n * Default: `\"bottom\"`\n */\n markerAnchor?:\n | \"top\"\n | \"left\"\n | \"bottom\"\n | \"right\"\n | \"center\"\n | \"topleft\"\n | \"bottomleft\"\n | \"topright\"\n | \"bottomright\";\n\n /**\n * Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.\n * Default: none provided\n */\n path?: Array;\n\n /**\n * Color of the path line. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: `\"blue\"`\n */\n pathStrokeColor?: string;\n\n /**\n * Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: none (transparent filling)\n */\n pathFillColor?: string;\n\n /**\n * Width of the path line in pixel. It can be floating point precision (ex: `0.5`)\n * Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.\n */\n pathWidth?: number;\n};\n\n/**\n * Options that can be provided to centered static maps\n */\nexport type CenteredStaticMapOptions = StaticMapBaseOptions;\n\n/**\n * Options that can be provided to bounded static maps\n */\nexport type BoundedStaticMapOptions = StaticMapBaseOptions & {\n /**\n * Extra space added around the regio of interest, in percentage.\n * Default: `0.1` (for 10%)\n */\n padding?: number;\n};\n\n/**\n * Options that can be provided to automatic static maps\n */\nexport type AutomaticStaticMapOptions = BoundedStaticMapOptions;\n\n/**\n * Definition of a maker to show on a static map\n */\nexport type StaticMapMarker = [\n /**\n * Longitude of the marker\n */\n number,\n /**\n * latitude of the marker\n */\n number,\n /**\n * Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.\n */\n string\n];\n\nfunction staticMapMarkerToString(\n marker: StaticMapMarker,\n includeColor = true\n): string {\n let str = `${marker[0]},${marker[1]}`;\n\n if (marker.length === 3 && includeColor) {\n str += `,${marker[2]}`;\n }\n\n return str;\n}\n\nfunction simplifyAndStringify(path: Array, maxNbChar = 3000): string {\n let str = path.map((point) => point.join(\",\")).join(\"|\");\n let tolerance = 0.000005;\n const toleranceStep = 0.00001;\n\n while (str.length > maxNbChar) {\n const simplerPath = simplify(path, tolerance);\n // str = simplerPath.map(point => point.join(',')).join('|');\n str = simplerPath.map((point) => `${point[0]},${point[1]}`).join(\"|\");\n tolerance += toleranceStep;\n }\n\n return str;\n}\n\n/**\n * Construct the URL for a static map centered on one point.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param center\n * @param zoom\n * @param options\n * @returns\n */\nfunction centered(\n center: Position,\n zoom: number,\n options: CenteredStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${center[0]},${\n center[1]\n },${zoom}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map using a bounding box\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param boundingBox\n * @param options\n * @returns\n */\nfunction bounded(\n boundingBox: BBox,\n options: BoundedStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${\n boundingBox[1]\n },${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map automatically fitted around the provided path or markers.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param options\n * @returns\n */\nfunction automatic(options: AutomaticStaticMapOptions = {}): string {\n if (!(\"markers\" in options) && !(\"path\" in options)) {\n throw new Error(\n \"Automatic static maps require markers and/or path to be created.\"\n );\n }\n\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(\n style\n )}/static/auto/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).\n * The URL of static maps can then be used within a `` markup element, as the `src` property value.\n */\nconst staticMaps = {\n centered,\n bounded,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AAAA,EACjB,QAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AACF;;;;"} \ No newline at end of file +{"version":3,"file":"maptiler-client.mjs","sources":["../src/config.ts","../src/language.ts","../src/callFetch.ts","../src/defaults.ts","../src/services/ServiceError.ts","../src/services/geocoding.ts","../src/services/geolocation.ts","../src/services/coordinates.ts","../src/services/data.ts","../src/mapstyle.ts","../src/services/simplify.ts","../src/services/staticMaps.ts"],"sourcesContent":["export type FetchFunction = (url: string, options: object) => Promise;\n\nfunction tryGettingFetch() {\n // this is browser, fetch exists\n if (typeof self !== \"undefined\") {\n return fetch.bind(self);\n }\n\n if (typeof global !== \"undefined\" && global.fetch) {\n return global.fetch;\n }\n\n return null;\n}\n\n/**\n * The configuration object definition\n */\nclass ClientConfig {\n /**\n * MapTiler Cloud API key\n */\n private _apiKey = \"\";\n\n /**\n * The fetch function. To be set if in Node < 18, otherwise\n * will be automatically resolved.\n */\n private _fetch: FetchFunction | null = tryGettingFetch();\n\n /**\n * Set the MapTiler Cloud API key\n */\n set apiKey(k: string) {\n this._apiKey = k;\n }\n\n /**\n * Get the MapTiler Cloud API key\n */\n get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * Set a the custom fetch function to replace the default one\n */\n set fetch(f: FetchFunction) {\n this._fetch = f;\n }\n\n /**\n * Get the fetch fucntion\n */\n get fetch(): FetchFunction | null {\n return this._fetch;\n }\n}\n\n/**\n * Configuration object\n */\nconst config = new ClientConfig();\n\nexport { ClientConfig, config };\n","/**\n * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.\n */\nconst LanguageGeocoding = {\n AUTO: \"auto\",\n ALBANIAN: \"sq\",\n ARABIC: \"ar\",\n ARMENIAN: \"hy\",\n AZERBAIJANI: \"az\",\n BELORUSSIAN: \"be\",\n BOSNIAN: \"bs\",\n BRETON: \"br\",\n BULGARIAN: \"bg\",\n CATALAN: \"ca\",\n CHINESE: \"zh\",\n CROATIAN: \"hr\",\n CZECH: \"cs\",\n DANISH: \"da\",\n DUTCH: \"nl\",\n ENGLISH: \"en\",\n ESPERANTO: \"eo\",\n ESTONIAN: \"et\",\n FINNISH: \"fi\",\n FRENCH: \"fr\",\n FRISIAN: \"fy\",\n GEORGIAN: \"ka\",\n GERMAN: \"de\",\n GREEK: \"el\",\n HEBREW: \"he\",\n HUNGARIAN: \"hu\",\n ICELANDIC: \"is\",\n IRISH: \"ga\",\n ITALIAN: \"it\",\n JAPANESE: \"ja\",\n KANNADA: \"kn\",\n KAZAKH: \"kk\",\n KOREAN: \"ko\",\n ROMAN_LATIN: \"la\",\n LATVIAN: \"lv\",\n LITHUANIAN: \"lt\",\n LUXEMBOURGISH: \"lb\",\n MACEDONIAN: \"mk\",\n MALTESE: \"mt\",\n NORWEGIAN: \"no\",\n POLISH: \"pl\",\n PORTUGUESE: \"pt\",\n ROMANIAN: \"ro\",\n ROMANSH: \"rm\",\n RUSSIAN: \"ru\",\n SCOTTISH_GAELIC: \"gd\",\n SERBIAN_CYRILLIC: \"sr\",\n SLOVAK: \"sk\",\n SLOVENE: \"sl\",\n SPANISH: \"es\",\n SWEDISH: \"sv\",\n THAI: \"th\",\n TURKISH: \"tr\",\n UKRAINIAN: \"uk\",\n WELSH: \"cy\",\n};\n\nconst languageCodeSet = new Set(Object.values(LanguageGeocoding));\n\ntype Values = T[keyof T];\n\n/**\n * Built-in languages values as strings\n */\ntype LanguageGeocodingString = Values;\n\nfunction getAutoLanguageGeocoding(): LanguageGeocodingString {\n if (typeof navigator === \"undefined\") {\n return Intl.DateTimeFormat()\n .resolvedOptions()\n .locale.split(\"-\")[0] as LanguageGeocodingString;\n }\n\n const canditatelangs = Array.from(\n new Set(navigator.languages.map((l) => l.split(\"-\")[0]))\n ).filter((l) => languageCodeSet.has(l as LanguageGeocodingString));\n\n return canditatelangs.length\n ? (canditatelangs[0] as LanguageGeocodingString)\n : LanguageGeocoding.ENGLISH;\n}\n\nexport { LanguageGeocoding, LanguageGeocodingString, getAutoLanguageGeocoding };\n","import { config } from \"./config\";\n\nexport async function callFetch(resource, options = {}) {\n if (config.fetch === null) {\n throw new Error(\n \"The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch\"\n );\n }\n\n // Control if URL contains the api key\n if (new URL(resource).searchParams.get(\"key\").trim() === \"\") {\n throw new Error(\n \"The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com\"\n );\n }\n\n return config.fetch(resource, options);\n}\n","/**\n * Some default settings for the SDK\n */\nconst defaults = {\n maptilerApiURL: \"https://api.maptiler.com/\",\n mapStyle: \"streets-v2\",\n};\n\nObject.freeze(defaults);\n\nexport { defaults };\n","/**\n * A ServiceError is an Error that includes the HTTP response details\n */\nexport class ServiceError extends Error {\n constructor(public res: Response, customMessage = \"\") {\n super(\n `Call to enpoint ${res.url} failed with the status code ${res.status}. ${customMessage}`\n );\n }\n}\n","import { BBox, Feature, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\n\nimport {\n getAutoLanguageGeocoding,\n LanguageGeocoding,\n LanguageGeocodingString,\n} from \"../language\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 400: \"Query too long / Invalid parameters\",\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type LanguageGeocodingOptions = {\n /**\n * Prefer results in specific language. It’s possible to specify multiple values.\n */\n language?: LanguageGeocodingString | Array;\n};\n\nexport type CommonForwardAndReverseGeocodingOptions =\n LanguageGeocodingOptions & {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.\n */\n limit?: number;\n\n /**\n * Filter of feature types to return. If not specified, all available feature types are returned.\n */\n types?: (\n | \"country\"\n | \"region\"\n | \"subregion\"\n | \"county\"\n | \"joint_municipality\"\n | \"joint_submunicipality\"\n | \"municipality\"\n | \"municipal_district\"\n | \"locality\"\n | \"neighbourhood\"\n | \"place\"\n | \"postal_code\"\n | \"address\"\n )[];\n };\n\nexport type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {\n /**\n * Only search for results in the specified area.\n */\n bbox?: BBox;\n\n /**\n * Prefer results close to a specific location.\n */\n proximity?: Position;\n\n /**\n * Limit search to specific country/countries specified as list of Alpha-2 ISO 3166-1 codes.\n */\n country?: string[];\n\n /**\n * Set to `false` to disable fuzzy (typo-tolerant) search. Default is `true`.\n */\n fuzzyMatch?: boolean;\n\n /**\n * Set to `true` to use autocomplete, `false` to disable it.\n * Default (`undefined`) is to combine autocomplete with non-autocomplete results.\n */\n autocomplete?: boolean;\n};\n\nexport type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;\n\nexport type ByIdGeocodingOptions = LanguageGeocodingOptions;\n\nexport type Coordinates = Position;\n\nexport type FeatureHierarchy = {\n /**\n * Unique feature ID\n */\n id: string;\n\n /**\n * Localized feature name\n */\n text: string;\n};\n\nexport type GeocodingFeature = Feature & {\n /**\n * Bounding box of the original feature as [w, s, e, n] array\n */\n bbox: BBox;\n\n /**\n * A [lon, lat] array of the original feature centeroid\n */\n center: Coordinates;\n\n /**\n * Formatted (including the hierarchy) and localized feature full name\n */\n place_name: string;\n\n /**\n * Localized feature name\n */\n text: string;\n\n /**\n * Feature hierarchy\n */\n context?: Array;\n\n /**\n * Address number, if applicable\n */\n address?: string;\n};\n\nexport type GeocodingSearchResult = {\n type: \"FeatureCollection\";\n\n /**\n * Array of features found\n */\n features: Array;\n\n /**\n * Tokenized search query\n */\n query: Array;\n\n /**\n * Attribution of the result\n */\n attribution: string;\n};\n\nfunction addLanguageGeocodingOptions(\n searchParams: URLSearchParams,\n options: LanguageGeocodingOptions\n) {\n if (options.language == undefined) {\n return;\n }\n\n const languages = Array.from(\n new Set(\n (Array.isArray(options.language)\n ? options.language\n : [options.language]\n ).map((lang) =>\n lang === LanguageGeocoding.AUTO ? getAutoLanguageGeocoding() : lang\n )\n )\n ).join(\",\");\n\n searchParams.set(\"language\", languages);\n}\n\nfunction addCommonForwardAndReverseGeocodingOptions(\n searchParams: URLSearchParams,\n options: CommonForwardAndReverseGeocodingOptions\n) {\n searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (options.limit != undefined) {\n searchParams.set(\"limit\", String(options.limit));\n }\n\n if (options.types != undefined) {\n searchParams.set(\"types\", options.types.join(\",\"));\n }\n\n addLanguageGeocodingOptions(searchParams, options);\n}\n\n/**\n * Performs a forward geocoding query to MapTiler API.\n * Providing a human readable place name (of a city, country, street, etc.), the function returns\n * a list of candidate locations including longitude and latitude.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward\n * @param query\n * @param options\n * @returns\n */\nasync function forward(\n query: string,\n options: GeocodingOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `geocoding/${encodeURIComponent(query)}.json`,\n defaults.maptilerApiURL\n );\n\n const { searchParams } = endpoint;\n\n addCommonForwardAndReverseGeocodingOptions(searchParams, options);\n\n if (options.bbox != undefined) {\n searchParams.set(\"bbox\", options.bbox.join(\",\"));\n }\n\n if (options.proximity != undefined) {\n searchParams.set(\"proximity\", options.proximity.join(\",\"));\n }\n\n if (options.country != undefined) {\n searchParams.set(\"country\", options.country.join(\",\"));\n }\n\n if (options.fuzzyMatch != undefined) {\n searchParams.set(\"fuzzyMatch\", options.fuzzyMatch ? \"true\" : \"false\");\n }\n\n if (options.autocomplete != undefined) {\n searchParams.set(\"autocomplete\", options.autocomplete ? \"true\" : \"false\");\n }\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a reverse geocoding query to MapTiler API.\n * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse\n * @param position\n * @param options\n * @returns\n */\nasync function reverse(\n position: Position,\n options: ReverseGeocodingOptions = {}\n): Promise {\n if (!Array.isArray(position) || position.length < 2) {\n throw new Error(\"The position must be an array of form [lng, lat].\");\n }\n\n const endpoint = new URL(\n `geocoding/${position[0]},${position[1]}.json`,\n defaults.maptilerApiURL\n );\n\n addCommonForwardAndReverseGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a geocoding query to MapTiler API to obtain fature by its ID.\n * Providing a feature ID, this function returns a feature which includes its full geometry.\n * Note that the feature ID is not stable and it changes when the database is re-indexed.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id\n * @param id\n * @param options\n * @returns\n */\nasync function byId(\n id: string,\n options: ByIdGeocodingOptions = {}\n): Promise {\n const endpoint = new URL(`geocoding/${id}.json`, defaults.maptilerApiURL);\n\n addLanguageGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * The **geocoding** namespace contains asynchronous functions to call the [MapTiler Geocoding API](https://docs.maptiler.com/cloud/api/geocoding/).\n * The **Geocoding API** provides ways to get geographic coordinates from a human-readable search query of a place (forward geocoding)\n * and to get the location details (country, city, street, etc.) from a geographic coordinate (reverse geocoding);\n */\nconst geocoding = {\n forward,\n reverse,\n byId,\n language: LanguageGeocoding,\n};\n\nexport { geocoding };\n","import { BBox } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GeolocationInfoOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\nexport type GeolocationResult = {\n /**\n * Name of the country\n * Example: Switzerland\n */\n country?: string;\n\n /**\n * Two-letter code of the country ISO 3166-1 alpha-2 codes\n * Example: CH\n */\n country_code?: string;\n\n /**\n * Bounds of the country in WGS84 degrees [west, south, east, north].\n * Example: [5.95538,45.818852,10.490936,47.809357]\n */\n country_bounds?: BBox;\n\n /**\n * Official country languages in ISO 639-1 format. ISO 639-1 codes\n * Example: [\"de\",\"fr\",\"it\"]\n */\n country_languages?: Array;\n\n /**\n * Name of the continent\n * Example: Europe\n */\n continent?: string;\n\n /**\n * Two-letter code of the continent\n * Example: EU\n */\n continent_code?: string;\n\n /**\n * Indicated whether the country is part of the European Union.\n */\n eu?: boolean;\n\n /**\n * Name of the city\n * Example: Zurich\n */\n city?: string;\n\n /**\n * Latitude of the location\n * Example: 47.36667\n */\n latitude?: number;\n\n /**\n * Longitude of the location\n * Example: 8.55\n */\n longitude?: number;\n\n /**\n * Postal code\n * Example: 8000\n */\n postal?: string;\n\n /**\n * If known, the ISO 3166-2 name for the first level region. ISO 3166-2 codes\n * Example: Zurich\n */\n region?: string;\n\n /**\n * If known, the ISO 3166-2 code for the first level region. ISO 3166-2 codes\n * Example: ZH\n */\n region_code?: string;\n\n /**\n * Name of the timezone\n * Example: Europe/Zurich\n */\n timezone?: string;\n};\n\n/**\n * Looks up geolocation details from IP address using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geolocation/#ip-geolocation\n * @returns\n */\nasync function info(\n options: GeolocationInfoOptions = {}\n): Promise {\n const endpoint = new URL(`geolocation/ip.json`, defaults.maptilerApiURL);\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as GeolocationResult;\n}\n\n/**\n * The **geolocation** namespace contains an asynchronous function to call the [MapTiler Geolocation API](https://docs.maptiler.com/cloud/api/geolocation/).\n * The **Geolocation API** provides a way to retrieve the IP address as well as geographic informations of a machine performing the query (most likely: a user)\n */\nconst geolocation = {\n info,\n};\n\nexport { geolocation };\n","import { BBox, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type CoordinatesSearchOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results returned (default: 10)\n */\n limit?: number;\n\n /**\n * Show detailed transformations for each CRS (default: false)\n */\n transformations?: boolean;\n\n /**\n * Show exports in WKT and Proj4 notations (default: false)\n */\n exports?: boolean;\n};\n\nexport type CoordinateId = {\n authority: string;\n code: BigInteger;\n};\n\nexport type CoordinateExport = {\n proj4: string;\n wkt: string;\n};\n\nexport type CoordinateGrid = {\n path: string;\n};\n\nexport type CoordinateTransformation = {\n id: CoordinateId;\n name: string;\n reversible: boolean;\n usable: boolean;\n deprecated: boolean;\n grids: Array;\n accuracy?: number;\n area?: string;\n bbox?: BBox;\n target_crs?: CoordinateId;\n unit?: string;\n};\n\nexport type CoordinateSearch = {\n id: CoordinateId;\n\n name: string;\n\n kind: string;\n\n deprecated: boolean;\n\n transformations?: Array;\n\n accuracy?: number;\n\n unit?: string;\n\n area?: string;\n\n /**\n * Bounding box of the resource in [min_lon, min_lat, max_lon, max_lat] order.\n */\n bbox?: BBox;\n\n /**\n * Most suitable transformation for this CRS.\n */\n default_transformation?: any;\n\n exports: CoordinateExport;\n};\n\nexport type CoordinateSearchResult = {\n /**\n * The coordinate search results\n */\n results: Array;\n\n /**\n * The number of results\n */\n total: number;\n};\n\n/**\n * Search information about coordinate systems using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems\n * @param query Can be any kind of CRS by name or code\n * @param options\n * @returns\n */\nasync function search(\n query: string,\n options: CoordinatesSearchOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `coordinates/search/${query}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"limit\" in options) {\n endpoint.searchParams.set(\"limit\", options.limit.toString());\n }\n\n if (\"transformations\" in options) {\n endpoint.searchParams.set(\n \"transformations\",\n options.transformations.toString()\n );\n }\n\n if (\"exports\" in options) {\n endpoint.searchParams.set(\"exports\", options.exports.toString());\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateSearchResult;\n}\n\nexport type XYZ = {\n x?: number;\n y?: number;\n z?: number;\n};\n\nexport type CoordinateTransformResult = {\n results: Array;\n\n /**\n * Transformations are selected using given ops parameter.\n * If no parameter is given, auto strategy is used.\n * If given, it may try to use a listed transformation,\n * then fallback to towgs84 patching, and finally boundcrs.\n */\n transformer_selection_strategy: string;\n};\n\n/**\n * Options that can be provided when transforming a coordinate from one CRS to another.\n */\nexport type CoordinatesTransformOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Source coordinate reference system (default: 4326)\n */\n sourceCrs?: number;\n\n /**\n * Target coordinate reference system (default: 4326)\n */\n targetCrs?: number;\n\n /**\n * List of codes of operations\n */\n operations?: number | Array;\n};\n\n/**\n * Transforms coordinates from a source reference system to a target reference system using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates\n * @param positions\n * @param options\n * @returns\n */\nasync function transform(\n positions: Position | Array,\n options: CoordinatesTransformOptions = {}\n): Promise {\n const coordinatesStr = (Array.isArray(positions[0]) ? positions : [positions])\n .map((coord) => `${coord[0]},${coord[1]}`)\n .join(\";\");\n\n const endpoint = new URL(\n `coordinates/transform/${coordinatesStr}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"sourceCrs\" in options) {\n endpoint.searchParams.set(\"s_srs\", options.sourceCrs.toString());\n }\n\n if (\"targetCrs\" in options) {\n endpoint.searchParams.set(\"t_srs\", options.targetCrs.toString());\n }\n\n if (\"operations\" in options) {\n endpoint.searchParams.set(\n \"ops\",\n (Array.isArray(options.operations)\n ? options.operations\n : [options.operations]\n ).join(\"|\")\n );\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateTransformResult;\n}\n\n/**\n * The **coordinate** namespace contains asynchronous functions to call the [MapTiler Coordinate API](https://docs.maptiler.com/cloud/api/coordinates/).\n * The goal of the **Coordinate API* is query information about spatial coordinate reference system (CRS) as well as to transform coordinates from one CRS to another.\n */\nconst coordinates = {\n search,\n transform,\n};\n\nexport { coordinates };\n","import { FeatureCollection } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GetDataOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\n/**\n * Get user data and returns it as GeoJSON using the MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/data/#geojson\n * @param dataId\n * @returns\n */\nasync function get(\n dataId: string,\n options: GetDataOptions = {}\n): Promise {\n if (typeof dataId !== \"string\" || dataId.trim().length === 0) {\n throw new Error(\"The data ID must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `data/${encodeURIComponent(dataId)}/features.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj;\n}\n\n/**\n * The **data** namespace contains an asynchronous function to call the [MapTiler Data API](https://docs.maptiler.com/cloud/api/data/).\n * The **Data API** provides a way to retrieve user data in GeoJSON format.\n */\nconst data = {\n get,\n};\n\nexport { data };\n","/**\n * Expand the map style provided as argument of the Map constructor\n * @param style\n * @returns\n */\nexport function expandMapStyle(style): string {\n // testing if the style provided is of form \"maptiler://some-style\"\n const maptilerDomainRegex = /^maptiler:\\/\\/(.*)/;\n let match;\n const trimmed = style.trim();\n let expandedStyle;\n\n // The style was possibly already given as expanded URL\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n expandedStyle = trimmed;\n } else if ((match = maptilerDomainRegex.exec(trimmed)) !== null) {\n expandedStyle = `https://api.maptiler.com/maps/${match[1]}/style.json`;\n } else {\n // The style could also possibly just be the name of the style without any URI style\n expandedStyle = `https://api.maptiler.com/maps/${trimmed}/style.json`;\n }\n\n return expandedStyle;\n}\n\n/**\n * Type for object containing style details\n */\nexport type MapStylePreset = {\n referenceStyleID: string;\n name: string;\n description: string;\n variants: Array<{\n id: string;\n name: string;\n variantType: string;\n description: string;\n imageURL: string;\n }>;\n};\n\n/**\n * An instance of MapStyleVariant contains information about a style to use that belong to a reference style\n */\nexport class MapStyleVariant {\n constructor(\n /**\n * Human-friendly name\n */\n private name: string,\n\n /**\n * Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE`\n */\n private variantType: string,\n\n /**\n * MapTiler Cloud id\n */\n private id: string,\n\n /**\n * Reference map style, used to retrieve sibling variants\n */\n private referenceStyle: ReferenceMapStyle,\n\n /**\n * Human-friendly description\n */\n private description: string,\n\n /**\n * URL to an image describing the style variant\n */\n private imageURL: string\n ) {}\n\n /**\n * Get the human-friendly name\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n getFullName(): string {\n return `${this.referenceStyle.getName()} ${this.name}`;\n }\n\n /**\n * Get the variant type (eg. \"DEFAULT\", \"DARK\", \"PASTEL\", etc.)\n * @returns\n */\n getType(): string {\n return this.variantType;\n }\n\n /**\n * Get the MapTiler Cloud id\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Get the human-friendly description\n */\n getDescription(): string {\n return this.description;\n }\n\n /**\n * Get the reference style this variant belongs to\n * @returns\n */\n getReferenceStyle(): ReferenceMapStyle {\n return this.referenceStyle;\n }\n\n /**\n * Check if a variant of a given type exists for _this_ variants\n * (eg. if this is a \"DARK\", then we can check if there is a \"LIGHT\" variant of it)\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return this.referenceStyle.hasVariant(variantType);\n }\n\n /**\n * Retrieve the variant of a given type. If not found, will return the \"DEFAULT\" variant.\n * (eg. _this_ \"DARK\" variant does not have any \"PASTEL\" variant, then the \"DEFAULT\" is returned)\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return this.referenceStyle.getVariant(variantType);\n }\n\n /**\n * Get all the variants for _this_ variants, except _this_ current one\n * @returns\n */\n getVariants(): Array {\n return this.referenceStyle.getVariants().filter((v) => v !== this);\n }\n\n /**\n * Get the image URL that represent _this_ variant\n * @returns\n */\n getImageURL(): string {\n return this.imageURL;\n }\n\n /**\n * Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)\n * @returns\n */\n getExpandedStyleURL(): string {\n return expandMapStyle(this.getId());\n }\n}\n\n/**\n * An instance of reference style contains a list of StyleVariants ordered by relevance\n */\nexport class ReferenceMapStyle {\n /**\n * Variants that belong to this reference style, key being the reference type\n */\n private variants: { [key: string]: MapStyleVariant } = {};\n\n /**\n * Variants that belong to this reference style, ordered by relevance\n */\n private orderedVariants: Array = [];\n\n constructor(\n /**\n * Human-friendly name of this reference style\n */\n private name: string,\n\n /**\n * ID of this reference style\n */\n private id: string\n ) {}\n\n /**\n * Get the human-friendly name of this reference style\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the id of _this_ reference style\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Add a variant to _this_ reference style\n * @param v\n */\n addVariant(v: MapStyleVariant) {\n this.variants[v.getType()] = v;\n this.orderedVariants.push(v);\n }\n\n /**\n * Check if a given variant type exists for this reference style\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return variantType in this.variants;\n }\n\n /**\n * Get a given variant. If the given type of variant does not exist for this reference style,\n * then the most relevant default variant is returned instead\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return variantType in this.variants\n ? this.variants[variantType]\n : this.orderedVariants[0];\n }\n\n /**\n * Get the list of variants for this reference style\n * @returns\n */\n getVariants(): Array {\n return Object.values(this.variants);\n }\n\n /**\n * Get the defualt variant for this reference style\n * @returns\n */\n getDefaultVariant(): MapStyleVariant {\n return this.orderedVariants[0];\n }\n}\n\n/**\n * All the styles and variants maintained by MapTiler.\n */\nexport type MapStyleType = {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings\n */\n STREETS: ReferenceMapStyle & {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in dark mode.\n */\n DARK: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode.\n */\n LIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in blue night mode.\n */\n NIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette.\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n OUTDOOR: ReferenceMapStyle & {\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading, in dark mode.\n */\n DARK: MapStyleVariant;\n };\n\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n WINTER: ReferenceMapStyle & {\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading, in dark mode.\n */\n DARK: MapStyleVariant;\n };\n\n /**\n * High resolution imagery only, without any label.\n */\n SATELLITE: ReferenceMapStyle & {\n /**\n * High resolution imagery only, without any label.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n HYBRID: ReferenceMapStyle & {\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A minimalist street-oriented style without POI\n */\n BASIC: ReferenceMapStyle & {\n /**\n * A minimalist street-oriented style without POI\n */\n DEFAULT: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n BRIGHT: ReferenceMapStyle & {\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, with a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Classic OpenStreetMap style\n */\n OPENSTREETMAP: ReferenceMapStyle & {\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPO: ReferenceMapStyle & {\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n SHINY: MapStyleVariant;\n /**\n * A nice low-contrast, alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, using a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n\n /**\n * A nice very high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPOGRAPHIQUE: MapStyleVariant;\n };\n\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n VOYAGER: ReferenceMapStyle & {\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in very dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A nice alternative to `streets` with a soft sepia color palette and vintage look\n */\n VINTAGE: MapStyleVariant;\n };\n\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n TONER: ReferenceMapStyle & {\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, without any label\n */\n BACKGROUND: MapStyleVariant;\n /**\n * A bold very high contrast, yet faded, style for the city\n */\n LITE: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, with no building, only roads!\n */\n LINES: MapStyleVariant;\n };\n\n /**\n * Minimalist style, perfect for data visualization\n */\n DATAVIZ: ReferenceMapStyle & {\n /**\n * Minimalist style, perfect for data visualization\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in dark mode\n */\n DARK: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n OCEAN: ReferenceMapStyle & {\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n DEFAULT: MapStyleVariant;\n };\n};\n\nexport const mapStylePresetList: Array = [\n {\n referenceStyleID: \"STREETS\",\n name: \"Streets\",\n description: \"\",\n variants: [\n {\n id: \"streets-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-night\",\n name: \"Night\",\n variantType: \"NIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OUTDOOR\",\n name: \"Outdoor\",\n description: \"\",\n variants: [\n {\n id: \"outdoor-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"outdoor-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"WINTER\",\n name: \"Winter\",\n description: \"\",\n variants: [\n {\n id: \"winter-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"winter-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"SATELLITE\",\n name: \"Satellite\",\n description: \"\",\n variants: [\n {\n id: \"satellite\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"HYBRID\",\n name: \"Hybrid\",\n description: \"\",\n variants: [\n {\n id: \"hybrid\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BASIC\",\n name: \"Basic\",\n description: \"\",\n variants: [\n {\n id: \"basic-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BRIGHT\",\n name: \"Bright\",\n description: \"\",\n variants: [\n {\n id: \"bright-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OPENSTREETMAP\",\n name: \"OpenStreetMap\",\n description: \"\",\n variants: [\n {\n id: \"openstreetmap\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TOPO\",\n name: \"Topo\",\n description: \"\",\n variants: [\n {\n id: \"topo-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-shiny\",\n name: \"Shiny\",\n variantType: \"SHINY\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-topographique\",\n name: \"Topographique\",\n variantType: \"TOPOGRAPHIQUE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"VOYAGER\",\n name: \"Voyager\",\n description: \"\",\n variants: [\n {\n id: \"voyager-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-darkmatter\",\n name: \"Darkmatter\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-positron\",\n name: \"Positron\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-vintage\",\n name: \"Vintage\",\n variantType: \"VINTAGE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TONER\",\n name: \"Toner\",\n description: \"\",\n variants: [\n {\n id: \"toner-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-background\",\n name: \"Background\",\n variantType: \"BACKGROUND\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lite\",\n name: \"Lite\",\n variantType: \"LITE\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lines\",\n name: \"Lines\",\n variantType: \"LINES\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"DATAVIZ\",\n name: \"Dataviz\",\n description: \"\",\n variants: [\n {\n id: \"dataviz\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OCEAN\",\n name: \"Ocean\",\n description: \"\",\n variants: [\n {\n id: \"ocean\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n];\n\nfunction makeReferenceStyleProxy(referenceStyle: ReferenceMapStyle) {\n return new Proxy(referenceStyle, {\n get(target, prop, receiver) {\n if (target.hasVariant(prop as string)) {\n return target.getVariant(prop as string);\n }\n\n // This variant does not exist for this style, but since it's full uppercase\n // we guess that the dev tries to access a style variant. So instead of\n // returning the default (STREETS.DEFAULT), we return the non-variant of the current style\n if (prop.toString().toUpperCase() === (prop as string)) {\n return referenceStyle.getDefaultVariant();\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\nfunction buildMapStyles(): MapStyleType {\n const mapStyle = {};\n\n for (let i = 0; i < mapStylePresetList.length; i += 1) {\n const refStyleInfo = mapStylePresetList[i];\n\n const refStyle = makeReferenceStyleProxy(\n new ReferenceMapStyle(refStyleInfo.name, refStyleInfo.referenceStyleID)\n );\n\n for (let j = 0; j < refStyleInfo.variants.length; j += 1) {\n const variantInfo = refStyleInfo.variants[j];\n const variant = new MapStyleVariant(\n variantInfo.name, // name\n variantInfo.variantType, // variantType\n variantInfo.id, // id\n refStyle, // referenceStyle\n variantInfo.description,\n variantInfo.imageURL // imageURL\n );\n\n refStyle.addVariant(variant);\n }\n mapStyle[refStyleInfo.referenceStyleID] = refStyle;\n }\n return mapStyle as MapStyleType;\n}\n\nexport function styleToStyle(\n style: string | ReferenceMapStyle | MapStyleVariant | null | undefined\n): string {\n if (!style) {\n return MapStyle[mapStylePresetList[0].referenceStyleID]\n .getDefaultVariant()\n .getId();\n }\n\n // If the provided style is a shorthand (eg. \"streets-v2\") then we make sure it's trimmed and lowercase\n if (typeof style === \"string\" || style instanceof String) {\n return style.trim().toLowerCase();\n }\n\n if (style instanceof MapStyleVariant) {\n return style.getId();\n }\n\n if (style instanceof ReferenceMapStyle) {\n return style.getDefaultVariant().getId();\n }\n}\n\n/**\n * Contains all the reference map style created by MapTiler team as well as all the variants.\n * For example, `MapStyle.STREETS` and the variants:\n * - `MapStyle.STREETS.DARK`\n * - `MapStyle.STREETS.LIGHT`\n * - `MapStyle.STREETS.PASTEL`\n *\n */\nexport const MapStyle: MapStyleType = buildMapStyles();\n","/**\\\n * This code is borrowed from https://github.com/mourner/simplify-js and reworked a little.\n */\n\nimport { Position } from \"geojson\";\n\n// square distance from a point to a segment\nfunction getSqSegDist(p: Position, p1: Position, p2: Position): number {\n let x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n\nfunction simplifyDPStep(\n points: Array,\n first: number,\n last: number,\n sqTolerance: number,\n simplified: Array\n) {\n let maxSqDist = sqTolerance,\n index;\n\n for (let i = first + 1; i < last; i++) {\n const sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) {\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n }\n simplified.push(points[index]);\n\n if (last - index > 1) {\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(\n points: Array,\n sqTolerance: number\n): Array {\n const last = points.length - 1;\n const simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nexport default function simplify(\n points: Array,\n tolerance: number\n): Array {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n const simplePoints = simplifyDouglasPeucker(points, sqTolerance);\n return simplePoints;\n}\n","import { BBox, Position } from \"geojson\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { MapStyleVariant, ReferenceMapStyle, styleToStyle } from \"../mapstyle\";\nimport simplify from \"./simplify\";\n\n/**\n * Base set of options that can be provided to all the types of static maps\n */\nexport type StaticMapBaseOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Style of the map (not full style URL). Example: \"winter\", \"streets-v2\".\n * Default: `\"streets-v2\"`\n */\n style?: string | ReferenceMapStyle | MapStyleVariant;\n\n /**\n * Double the size of the static map image to support hiDPI/Retina monitors.\n * Default: `false`\n */\n hiDPI?: boolean;\n\n /**\n * Image format.\n * Default: `\"png\"`\n */\n format?: \"png\" | \"jpg\" | \"webp\";\n\n /**\n * Width of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n width?: number;\n\n /**\n * Height of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n height?: number;\n\n /**\n * Placement of the attribution. Can also be set to `false` to not show attribution.\n * Default: `\"bottomright\"`\n */\n attribution?: \"bottomright\" | \"bottomleft\" | \"topleft\" | \"topright\" | false;\n\n /**\n * A marker or list of markers to show on the map\n * Default: none provided\n */\n markers?: StaticMapMarker | Array;\n\n /**\n * URL of the marker image. Applies only if one or multiple markers positions are provided.\n * Default: none provided\n */\n markerIcon?: string;\n\n /**\n * Position of the marker regarding its coordinates. Applies only:\n * - with a custom icon provided with `markerIcon`\n * - if one or multiple markers positions are provided.\n * Default: `\"bottom\"`\n */\n markerAnchor?:\n | \"top\"\n | \"left\"\n | \"bottom\"\n | \"right\"\n | \"center\"\n | \"topleft\"\n | \"bottomleft\"\n | \"topright\"\n | \"bottomright\";\n\n /**\n * Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.\n * Default: none provided\n */\n path?: Array;\n\n /**\n * Color of the path line. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: `\"blue\"`\n */\n pathStrokeColor?: string;\n\n /**\n * Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: none (transparent filling)\n */\n pathFillColor?: string;\n\n /**\n * Width of the path line in pixel. It can be floating point precision (ex: `0.5`)\n * Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.\n */\n pathWidth?: number;\n};\n\n/**\n * Options that can be provided to centered static maps\n */\nexport type CenteredStaticMapOptions = StaticMapBaseOptions;\n\n/**\n * Options that can be provided to bounded static maps\n */\nexport type BoundedStaticMapOptions = StaticMapBaseOptions & {\n /**\n * Extra space added around the regio of interest, in percentage.\n * Default: `0.1` (for 10%)\n */\n padding?: number;\n};\n\n/**\n * Options that can be provided to automatic static maps\n */\nexport type AutomaticStaticMapOptions = BoundedStaticMapOptions;\n\n/**\n * Definition of a maker to show on a static map\n */\nexport type StaticMapMarker = [\n /**\n * Longitude of the marker\n */\n number,\n /**\n * latitude of the marker\n */\n number,\n /**\n * Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.\n */\n string\n];\n\nfunction staticMapMarkerToString(\n marker: StaticMapMarker,\n includeColor = true\n): string {\n let str = `${marker[0]},${marker[1]}`;\n\n if (marker.length === 3 && includeColor) {\n str += `,${marker[2]}`;\n }\n\n return str;\n}\n\nfunction simplifyAndStringify(path: Array, maxNbChar = 3000): string {\n let str = path.map((point) => point.join(\",\")).join(\"|\");\n let tolerance = 0.000005;\n const toleranceStep = 0.00001;\n\n while (str.length > maxNbChar) {\n const simplerPath = simplify(path, tolerance);\n // str = simplerPath.map(point => point.join(',')).join('|');\n str = simplerPath.map((point) => `${point[0]},${point[1]}`).join(\"|\");\n tolerance += toleranceStep;\n }\n\n return str;\n}\n\n/**\n * Construct the URL for a static map centered on one point.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param center\n * @param zoom\n * @param options\n * @returns\n */\nfunction centered(\n center: Position,\n zoom: number,\n options: CenteredStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${center[0]},${\n center[1]\n },${zoom}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map using a bounding box\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param boundingBox\n * @param options\n * @returns\n */\nfunction bounded(\n boundingBox: BBox,\n options: BoundedStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${\n boundingBox[1]\n },${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map automatically fitted around the provided path or markers.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param options\n * @returns\n */\nfunction automatic(options: AutomaticStaticMapOptions = {}): string {\n if (!(\"markers\" in options) && !(\"path\" in options)) {\n throw new Error(\n \"Automatic static maps require markers and/or path to be created.\"\n );\n }\n\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(\n style\n )}/static/auto/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).\n * The URL of static maps can then be used within a `` markup element, as the `src` property value.\n */\nconst staticMaps = {\n centered,\n bounded,\n automatic,\n};\n\nexport { staticMaps };\n"],"names":["__async","customMessages"],"mappings":"AAEA,SAAS,eAAkB,GAAA;AAEzB,EAAI,IAAA,OAAO,SAAS,WAAa,EAAA;AAC/B,IAAO,OAAA,KAAA,CAAM,KAAK,IAAI,CAAA,CAAA;AAAA,GACxB;AAEA,EAAA,IAAI,OAAO,MAAA,KAAW,WAAe,IAAA,MAAA,CAAO,KAAO,EAAA;AACjD,IAAA,OAAO,MAAO,CAAA,KAAA,CAAA;AAAA,GAChB;AAEA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAKA,MAAM,YAAa,CAAA;AAAA,EAAnB,WAAA,GAAA;AAIE;AAAA;AAAA;AAAA,IAAA,IAAA,CAAQ,OAAU,GAAA,EAAA,CAAA;AAMlB;AAAA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAQ,SAA+B,eAAgB,EAAA,CAAA;AAAA,GAAA;AAAA;AAAA;AAAA;AAAA,EAKvD,IAAI,OAAO,CAAW,EAAA;AACpB,IAAA,IAAA,CAAK,OAAU,GAAA,CAAA,CAAA;AAAA,GACjB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAiB,GAAA;AACnB,IAAA,OAAO,IAAK,CAAA,OAAA,CAAA;AAAA,GACd;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAM,CAAkB,EAAA;AAC1B,IAAA,IAAA,CAAK,MAAS,GAAA,CAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,KAA8B,GAAA;AAChC,IAAA,OAAO,IAAK,CAAA,MAAA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AS,EAAA;AACrB,IAAA,IAAI,OAAU,GAAA,EAAA,CAAA;AAEd,IAAW,OAAA,IAAA,CAAA,KAAA,EAAA,CAAQ,EAAQ,GAAA,OAAA,CAAA,aAAA,KAAR,IAAyB,GAAA,EAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AAE5C,IAAA,IAAI,qBAAqB,OAAS,EAAA;AAChC,MAAA,OAAA,IAAW,UAAU,OAAQ,CAAA,eAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KAC/B;AAEA,IAAA,IAAI,eAAe,OAAS,EAAA;AAC1B,MAAA,MAAM,SAAY,GAAA,OAAA,CAAQ,SAAa,IAAA,OAAA,CAAQ,QAAQ,CAAI,GAAA,CAAA,CAAA,CAAA;AAC3D,MAAW,OAAA,IAAA,CAAA,MAAA,EAAS,UAAU,QAAS,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KACzC;AAEA,IAAW,OAAA,IAAA,oBAAA,CAAqB,QAAQ,IAAI,CAAA,CAAA;AAC5C,IAAS,QAAA,CAAA,YAAA,CAAa,GAAI,CAAA,MAAA,EAAQ,OAAO,CAAA,CAAA;AAAA,GAC3C;AAEA,EAAA,QAAA,CAAS,aAAa,GAAI,CAAA,KAAA,EAAA,CAAO,aAAQ,MAAR,KAAA,IAAA,GAAA,EAAA,GAAkB,OAAO,MAAM,CAAA,CAAA;AAEhE,EAAA,OAAO,SAAS,QAAS,EAAA,CAAA;AAC3B,CAAA;AAMA,MAAM,UAAa,GAAA;AAAA,EACjB,QAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AACF;;;;"} \ No newline at end of file diff --git a/dist/maptiler-client.umd.js b/dist/maptiler-client.umd.js index 7165dab..246a049 100644 --- a/dist/maptiler-client.umd.js +++ b/dist/maptiler-client.umd.js @@ -680,6 +680,13 @@ description: "", imageURL: "" }, + { + id: "streets-v2-night", + name: "Night", + variantType: "NIGHT", + description: "", + imageURL: "" + }, { id: "streets-v2-pastel", name: "Pastel", @@ -700,6 +707,13 @@ variantType: "DEFAULT", description: "", imageURL: "" + }, + { + id: "outdoor-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" } ] }, @@ -710,10 +724,17 @@ variants: [ { id: "winter-v2", - name: "Winter", + name: "Default", variantType: "DEFAULT", description: "", imageURL: "" + }, + { + id: "winter-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" } ] }, @@ -834,6 +855,13 @@ description: "", imageURL: "" }, + { + id: "topo-v2-dark", + name: "Dark", + variantType: "DARK", + description: "", + imageURL: "" + }, { id: "topo-v2-shiny", name: "Shiny", diff --git a/dist/maptiler-client.umd.js.map b/dist/maptiler-client.umd.js.map index 09beca4..17936d2 100644 --- a/dist/maptiler-client.umd.js.map +++ b/dist/maptiler-client.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"maptiler-client.umd.js","sources":["../src/config.ts","../src/language.ts","../src/callFetch.ts","../src/defaults.ts","../src/services/ServiceError.ts","../src/services/geocoding.ts","../src/services/geolocation.ts","../src/services/coordinates.ts","../src/services/data.ts","../src/mapstyle.ts","../src/services/simplify.ts","../src/services/staticMaps.ts"],"sourcesContent":["export type FetchFunction = (url: string, options: object) => Promise;\n\nfunction tryGettingFetch() {\n // this is browser, fetch exists\n if (typeof self !== \"undefined\") {\n return fetch.bind(self);\n }\n\n if (typeof global !== \"undefined\" && global.fetch) {\n return global.fetch;\n }\n\n return null;\n}\n\n/**\n * The configuration object definition\n */\nclass ClientConfig {\n /**\n * MapTiler Cloud API key\n */\n private _apiKey = \"\";\n\n /**\n * The fetch function. To be set if in Node < 18, otherwise\n * will be automatically resolved.\n */\n private _fetch: FetchFunction | null = tryGettingFetch();\n\n /**\n * Set the MapTiler Cloud API key\n */\n set apiKey(k: string) {\n this._apiKey = k;\n }\n\n /**\n * Get the MapTiler Cloud API key\n */\n get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * Set a the custom fetch function to replace the default one\n */\n set fetch(f: FetchFunction) {\n this._fetch = f;\n }\n\n /**\n * Get the fetch fucntion\n */\n get fetch(): FetchFunction | null {\n return this._fetch;\n }\n}\n\n/**\n * Configuration object\n */\nconst config = new ClientConfig();\n\nexport { ClientConfig, config };\n","/**\n * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.\n */\nconst LanguageGeocoding = {\n AUTO: \"auto\",\n ALBANIAN: \"sq\",\n ARABIC: \"ar\",\n ARMENIAN: \"hy\",\n AZERBAIJANI: \"az\",\n BELORUSSIAN: \"be\",\n BOSNIAN: \"bs\",\n BRETON: \"br\",\n BULGARIAN: \"bg\",\n CATALAN: \"ca\",\n CHINESE: \"zh\",\n CROATIAN: \"hr\",\n CZECH: \"cs\",\n DANISH: \"da\",\n DUTCH: \"nl\",\n ENGLISH: \"en\",\n ESPERANTO: \"eo\",\n ESTONIAN: \"et\",\n FINNISH: \"fi\",\n FRENCH: \"fr\",\n FRISIAN: \"fy\",\n GEORGIAN: \"ka\",\n GERMAN: \"de\",\n GREEK: \"el\",\n HEBREW: \"he\",\n HUNGARIAN: \"hu\",\n ICELANDIC: \"is\",\n IRISH: \"ga\",\n ITALIAN: \"it\",\n JAPANESE: \"ja\",\n KANNADA: \"kn\",\n KAZAKH: \"kk\",\n KOREAN: \"ko\",\n ROMAN_LATIN: \"la\",\n LATVIAN: \"lv\",\n LITHUANIAN: \"lt\",\n LUXEMBOURGISH: \"lb\",\n MACEDONIAN: \"mk\",\n MALTESE: \"mt\",\n NORWEGIAN: \"no\",\n POLISH: \"pl\",\n PORTUGUESE: \"pt\",\n ROMANIAN: \"ro\",\n ROMANSH: \"rm\",\n RUSSIAN: \"ru\",\n SCOTTISH_GAELIC: \"gd\",\n SERBIAN_CYRILLIC: \"sr\",\n SLOVAK: \"sk\",\n SLOVENE: \"sl\",\n SPANISH: \"es\",\n SWEDISH: \"sv\",\n THAI: \"th\",\n TURKISH: \"tr\",\n UKRAINIAN: \"uk\",\n WELSH: \"cy\",\n};\n\nconst languageCodeSet = new Set(Object.values(LanguageGeocoding));\n\ntype Values = T[keyof T];\n\n/**\n * Built-in languages values as strings\n */\ntype LanguageGeocodingString = Values;\n\nfunction getAutoLanguageGeocoding(): LanguageGeocodingString {\n if (typeof navigator === \"undefined\") {\n return Intl.DateTimeFormat()\n .resolvedOptions()\n .locale.split(\"-\")[0] as LanguageGeocodingString;\n }\n\n const canditatelangs = Array.from(\n new Set(navigator.languages.map((l) => l.split(\"-\")[0]))\n ).filter((l) => languageCodeSet.has(l as LanguageGeocodingString));\n\n return canditatelangs.length\n ? (canditatelangs[0] as LanguageGeocodingString)\n : LanguageGeocoding.ENGLISH;\n}\n\nexport { LanguageGeocoding, LanguageGeocodingString, getAutoLanguageGeocoding };\n","import { config } from \"./config\";\n\nexport async function callFetch(resource, options = {}) {\n if (config.fetch === null) {\n throw new Error(\n \"The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch\"\n );\n }\n\n // Control if URL contains the api key\n if (new URL(resource).searchParams.get(\"key\").trim() === \"\") {\n throw new Error(\n \"The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com\"\n );\n }\n\n return config.fetch(resource, options);\n}\n","/**\n * Some default settings for the SDK\n */\nconst defaults = {\n maptilerApiURL: \"https://api.maptiler.com/\",\n mapStyle: \"streets-v2\",\n};\n\nObject.freeze(defaults);\n\nexport { defaults };\n","/**\n * A ServiceError is an Error that includes the HTTP response details\n */\nexport class ServiceError extends Error {\n constructor(public res: Response, customMessage = \"\") {\n super(\n `Call to enpoint ${res.url} failed with the status code ${res.status}. ${customMessage}`\n );\n }\n}\n","import { BBox, Feature, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\n\nimport {\n getAutoLanguageGeocoding,\n LanguageGeocoding,\n LanguageGeocodingString,\n} from \"../language\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 400: \"Query too long / Invalid parameters\",\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type LanguageGeocodingOptions = {\n /**\n * Prefer results in specific language. It’s possible to specify multiple values.\n */\n language?: LanguageGeocodingString | Array;\n};\n\nexport type CommonForwardAndReverseGeocodingOptions =\n LanguageGeocodingOptions & {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.\n */\n limit?: number;\n\n /**\n * Filter of feature types to return. If not specified, all available feature types are returned.\n */\n types?: (\n | \"country\"\n | \"region\"\n | \"subregion\"\n | \"county\"\n | \"joint_municipality\"\n | \"joint_submunicipality\"\n | \"municipality\"\n | \"municipal_district\"\n | \"locality\"\n | \"neighbourhood\"\n | \"place\"\n | \"postal_code\"\n | \"address\"\n )[];\n };\n\nexport type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {\n /**\n * Only search for results in the specified area.\n */\n bbox?: BBox;\n\n /**\n * Prefer results close to a specific location.\n */\n proximity?: Position;\n\n /**\n * Limit search to specific country/countries specified as list of Alpha-2 ISO 3166-1 codes.\n */\n country?: string[];\n\n /**\n * Set to `false` to disable fuzzy (typo-tolerant) search. Default is `true`.\n */\n fuzzyMatch?: boolean;\n\n /**\n * Set to `true` to use autocomplete, `false` to disable it.\n * Default (`undefined`) is to combine autocomplete with non-autocomplete results.\n */\n autocomplete?: boolean;\n};\n\nexport type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;\n\nexport type ByIdGeocodingOptions = LanguageGeocodingOptions;\n\nexport type Coordinates = Position;\n\nexport type FeatureHierarchy = {\n /**\n * Unique feature ID\n */\n id: string;\n\n /**\n * Localized feature name\n */\n text: string;\n};\n\nexport type GeocodingFeature = Feature & {\n /**\n * Bounding box of the original feature as [w, s, e, n] array\n */\n bbox: BBox;\n\n /**\n * A [lon, lat] array of the original feature centeroid\n */\n center: Coordinates;\n\n /**\n * Formatted (including the hierarchy) and localized feature full name\n */\n place_name: string;\n\n /**\n * Localized feature name\n */\n text: string;\n\n /**\n * Feature hierarchy\n */\n context?: Array;\n\n /**\n * Address number, if applicable\n */\n address?: string;\n};\n\nexport type GeocodingSearchResult = {\n type: \"FeatureCollection\";\n\n /**\n * Array of features found\n */\n features: Array;\n\n /**\n * Tokenized search query\n */\n query: Array;\n\n /**\n * Attribution of the result\n */\n attribution: string;\n};\n\nfunction addLanguageGeocodingOptions(\n searchParams: URLSearchParams,\n options: LanguageGeocodingOptions\n) {\n if (options.language == undefined) {\n return;\n }\n\n const languages = Array.from(\n new Set(\n (Array.isArray(options.language)\n ? options.language\n : [options.language]\n ).map((lang) =>\n lang === LanguageGeocoding.AUTO ? getAutoLanguageGeocoding() : lang\n )\n )\n ).join(\",\");\n\n searchParams.set(\"language\", languages);\n}\n\nfunction addCommonForwardAndReverseGeocodingOptions(\n searchParams: URLSearchParams,\n options: CommonForwardAndReverseGeocodingOptions\n) {\n searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (options.limit != undefined) {\n searchParams.set(\"limit\", String(options.limit));\n }\n\n if (options.types != undefined) {\n searchParams.set(\"types\", options.types.join(\",\"));\n }\n\n addLanguageGeocodingOptions(searchParams, options);\n}\n\n/**\n * Performs a forward geocoding query to MapTiler API.\n * Providing a human readable place name (of a city, country, street, etc.), the function returns\n * a list of candidate locations including longitude and latitude.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward\n * @param query\n * @param options\n * @returns\n */\nasync function forward(\n query: string,\n options: GeocodingOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `geocoding/${encodeURIComponent(query)}.json`,\n defaults.maptilerApiURL\n );\n\n const { searchParams } = endpoint;\n\n addCommonForwardAndReverseGeocodingOptions(searchParams, options);\n\n if (options.bbox != undefined) {\n searchParams.set(\"bbox\", options.bbox.join(\",\"));\n }\n\n if (options.proximity != undefined) {\n searchParams.set(\"proximity\", options.proximity.join(\",\"));\n }\n\n if (options.country != undefined) {\n searchParams.set(\"country\", options.country.join(\",\"));\n }\n\n if (options.fuzzyMatch != undefined) {\n searchParams.set(\"fuzzyMatch\", options.fuzzyMatch ? \"true\" : \"false\");\n }\n\n if (options.autocomplete != undefined) {\n searchParams.set(\"autocomplete\", options.autocomplete ? \"true\" : \"false\");\n }\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a reverse geocoding query to MapTiler API.\n * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse\n * @param position\n * @param options\n * @returns\n */\nasync function reverse(\n position: Position,\n options: ReverseGeocodingOptions = {}\n): Promise {\n if (!Array.isArray(position) || position.length < 2) {\n throw new Error(\"The position must be an array of form [lng, lat].\");\n }\n\n const endpoint = new URL(\n `geocoding/${position[0]},${position[1]}.json`,\n defaults.maptilerApiURL\n );\n\n addCommonForwardAndReverseGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a geocoding query to MapTiler API to obtain fature by its ID.\n * Providing a feature ID, this function returns a feature which includes its full geometry.\n * Note that the feature ID is not stable and it changes when the database is re-indexed.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id\n * @param id\n * @param options\n * @returns\n */\nasync function byId(\n id: string,\n options: ByIdGeocodingOptions = {}\n): Promise {\n const endpoint = new URL(`geocoding/${id}.json`, defaults.maptilerApiURL);\n\n addLanguageGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * The **geocoding** namespace contains asynchronous functions to call the [MapTiler Geocoding API](https://docs.maptiler.com/cloud/api/geocoding/).\n * The **Geocoding API** provides ways to get geographic coordinates from a human-readable search query of a place (forward geocoding)\n * and to get the location details (country, city, street, etc.) from a geographic coordinate (reverse geocoding);\n */\nconst geocoding = {\n forward,\n reverse,\n byId,\n language: LanguageGeocoding,\n};\n\nexport { geocoding };\n","import { BBox } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GeolocationInfoOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\nexport type GeolocationResult = {\n /**\n * Name of the country\n * Example: Switzerland\n */\n country?: string;\n\n /**\n * Two-letter code of the country ISO 3166-1 alpha-2 codes\n * Example: CH\n */\n country_code?: string;\n\n /**\n * Bounds of the country in WGS84 degrees [west, south, east, north].\n * Example: [5.95538,45.818852,10.490936,47.809357]\n */\n country_bounds?: BBox;\n\n /**\n * Official country languages in ISO 639-1 format. ISO 639-1 codes\n * Example: [\"de\",\"fr\",\"it\"]\n */\n country_languages?: Array;\n\n /**\n * Name of the continent\n * Example: Europe\n */\n continent?: string;\n\n /**\n * Two-letter code of the continent\n * Example: EU\n */\n continent_code?: string;\n\n /**\n * Indicated whether the country is part of the European Union.\n */\n eu?: boolean;\n\n /**\n * Name of the city\n * Example: Zurich\n */\n city?: string;\n\n /**\n * Latitude of the location\n * Example: 47.36667\n */\n latitude?: number;\n\n /**\n * Longitude of the location\n * Example: 8.55\n */\n longitude?: number;\n\n /**\n * Postal code\n * Example: 8000\n */\n postal?: string;\n\n /**\n * If known, the ISO 3166-2 name for the first level region. ISO 3166-2 codes\n * Example: Zurich\n */\n region?: string;\n\n /**\n * If known, the ISO 3166-2 code for the first level region. ISO 3166-2 codes\n * Example: ZH\n */\n region_code?: string;\n\n /**\n * Name of the timezone\n * Example: Europe/Zurich\n */\n timezone?: string;\n};\n\n/**\n * Looks up geolocation details from IP address using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geolocation/#ip-geolocation\n * @returns\n */\nasync function info(\n options: GeolocationInfoOptions = {}\n): Promise {\n const endpoint = new URL(`geolocation/ip.json`, defaults.maptilerApiURL);\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as GeolocationResult;\n}\n\n/**\n * The **geolocation** namespace contains an asynchronous function to call the [MapTiler Geolocation API](https://docs.maptiler.com/cloud/api/geolocation/).\n * The **Geolocation API** provides a way to retrieve the IP address as well as geographic informations of a machine performing the query (most likely: a user)\n */\nconst geolocation = {\n info,\n};\n\nexport { geolocation };\n","import { BBox, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type CoordinatesSearchOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results returned (default: 10)\n */\n limit?: number;\n\n /**\n * Show detailed transformations for each CRS (default: false)\n */\n transformations?: boolean;\n\n /**\n * Show exports in WKT and Proj4 notations (default: false)\n */\n exports?: boolean;\n};\n\nexport type CoordinateId = {\n authority: string;\n code: BigInteger;\n};\n\nexport type CoordinateExport = {\n proj4: string;\n wkt: string;\n};\n\nexport type CoordinateGrid = {\n path: string;\n};\n\nexport type CoordinateTransformation = {\n id: CoordinateId;\n name: string;\n reversible: boolean;\n usable: boolean;\n deprecated: boolean;\n grids: Array;\n accuracy?: number;\n area?: string;\n bbox?: BBox;\n target_crs?: CoordinateId;\n unit?: string;\n};\n\nexport type CoordinateSearch = {\n id: CoordinateId;\n\n name: string;\n\n kind: string;\n\n deprecated: boolean;\n\n transformations?: Array;\n\n accuracy?: number;\n\n unit?: string;\n\n area?: string;\n\n /**\n * Bounding box of the resource in [min_lon, min_lat, max_lon, max_lat] order.\n */\n bbox?: BBox;\n\n /**\n * Most suitable transformation for this CRS.\n */\n default_transformation?: any;\n\n exports: CoordinateExport;\n};\n\nexport type CoordinateSearchResult = {\n /**\n * The coordinate search results\n */\n results: Array;\n\n /**\n * The number of results\n */\n total: number;\n};\n\n/**\n * Search information about coordinate systems using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems\n * @param query Can be any kind of CRS by name or code\n * @param options\n * @returns\n */\nasync function search(\n query: string,\n options: CoordinatesSearchOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `coordinates/search/${query}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"limit\" in options) {\n endpoint.searchParams.set(\"limit\", options.limit.toString());\n }\n\n if (\"transformations\" in options) {\n endpoint.searchParams.set(\n \"transformations\",\n options.transformations.toString()\n );\n }\n\n if (\"exports\" in options) {\n endpoint.searchParams.set(\"exports\", options.exports.toString());\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateSearchResult;\n}\n\nexport type XYZ = {\n x?: number;\n y?: number;\n z?: number;\n};\n\nexport type CoordinateTransformResult = {\n results: Array;\n\n /**\n * Transformations are selected using given ops parameter.\n * If no parameter is given, auto strategy is used.\n * If given, it may try to use a listed transformation,\n * then fallback to towgs84 patching, and finally boundcrs.\n */\n transformer_selection_strategy: string;\n};\n\n/**\n * Options that can be provided when transforming a coordinate from one CRS to another.\n */\nexport type CoordinatesTransformOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Source coordinate reference system (default: 4326)\n */\n sourceCrs?: number;\n\n /**\n * Target coordinate reference system (default: 4326)\n */\n targetCrs?: number;\n\n /**\n * List of codes of operations\n */\n operations?: number | Array;\n};\n\n/**\n * Transforms coordinates from a source reference system to a target reference system using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates\n * @param positions\n * @param options\n * @returns\n */\nasync function transform(\n positions: Position | Array,\n options: CoordinatesTransformOptions = {}\n): Promise {\n const coordinatesStr = (Array.isArray(positions[0]) ? positions : [positions])\n .map((coord) => `${coord[0]},${coord[1]}`)\n .join(\";\");\n\n const endpoint = new URL(\n `coordinates/transform/${coordinatesStr}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"sourceCrs\" in options) {\n endpoint.searchParams.set(\"s_srs\", options.sourceCrs.toString());\n }\n\n if (\"targetCrs\" in options) {\n endpoint.searchParams.set(\"t_srs\", options.targetCrs.toString());\n }\n\n if (\"operations\" in options) {\n endpoint.searchParams.set(\n \"ops\",\n (Array.isArray(options.operations)\n ? options.operations\n : [options.operations]\n ).join(\"|\")\n );\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateTransformResult;\n}\n\n/**\n * The **coordinate** namespace contains asynchronous functions to call the [MapTiler Coordinate API](https://docs.maptiler.com/cloud/api/coordinates/).\n * The goal of the **Coordinate API* is query information about spatial coordinate reference system (CRS) as well as to transform coordinates from one CRS to another.\n */\nconst coordinates = {\n search,\n transform,\n};\n\nexport { coordinates };\n","import { FeatureCollection } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GetDataOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\n/**\n * Get user data and returns it as GeoJSON using the MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/data/#geojson\n * @param dataId\n * @returns\n */\nasync function get(\n dataId: string,\n options: GetDataOptions = {}\n): Promise {\n if (typeof dataId !== \"string\" || dataId.trim().length === 0) {\n throw new Error(\"The data ID must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `data/${encodeURIComponent(dataId)}/features.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj;\n}\n\n/**\n * The **data** namespace contains an asynchronous function to call the [MapTiler Data API](https://docs.maptiler.com/cloud/api/data/).\n * The **Data API** provides a way to retrieve user data in GeoJSON format.\n */\nconst data = {\n get,\n};\n\nexport { data };\n","/**\n * Expand the map style provided as argument of the Map constructor\n * @param style\n * @returns\n */\nexport function expandMapStyle(style): string {\n // testing if the style provided is of form \"maptiler://some-style\"\n const maptilerDomainRegex = /^maptiler:\\/\\/(.*)/;\n let match;\n const trimmed = style.trim();\n let expandedStyle;\n\n // The style was possibly already given as expanded URL\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n expandedStyle = trimmed;\n } else if ((match = maptilerDomainRegex.exec(trimmed)) !== null) {\n expandedStyle = `https://api.maptiler.com/maps/${match[1]}/style.json`;\n } else {\n // The style could also possibly just be the name of the style without any URI style\n expandedStyle = `https://api.maptiler.com/maps/${trimmed}/style.json`;\n }\n\n return expandedStyle;\n}\n\n/**\n * Type for object containing style details\n */\nexport type MapStylePreset = {\n referenceStyleID: string;\n name: string;\n description: string;\n variants: Array<{\n id: string;\n name: string;\n variantType: string;\n description: string;\n imageURL: string;\n }>;\n};\n\n/**\n * An instance of MapStyleVariant contains information about a style to use that belong to a reference style\n */\nexport class MapStyleVariant {\n constructor(\n /**\n * Human-friendly name\n */\n private name: string,\n\n /**\n * Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE`\n */\n private variantType: string,\n\n /**\n * MapTiler Cloud id\n */\n private id: string,\n\n /**\n * Reference map style, used to retrieve sibling variants\n */\n private referenceStyle: ReferenceMapStyle,\n\n /**\n * Human-friendly description\n */\n private description: string,\n\n /**\n * URL to an image describing the style variant\n */\n private imageURL: string\n ) {}\n\n /**\n * Get the human-friendly name\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n getFullName(): string {\n return `${this.referenceStyle.getName()} ${this.name}`;\n }\n\n /**\n * Get the variant type (eg. \"DEFAULT\", \"DARK\", \"PASTEL\", etc.)\n * @returns\n */\n getType(): string {\n return this.variantType;\n }\n\n /**\n * Get the MapTiler Cloud id\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Get the human-friendly description\n */\n getDescription(): string {\n return this.description;\n }\n\n /**\n * Get the reference style this variant belongs to\n * @returns\n */\n getReferenceStyle(): ReferenceMapStyle {\n return this.referenceStyle;\n }\n\n /**\n * Check if a variant of a given type exists for _this_ variants\n * (eg. if this is a \"DARK\", then we can check if there is a \"LIGHT\" variant of it)\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return this.referenceStyle.hasVariant(variantType);\n }\n\n /**\n * Retrieve the variant of a given type. If not found, will return the \"DEFAULT\" variant.\n * (eg. _this_ \"DARK\" variant does not have any \"PASTEL\" variant, then the \"DEFAULT\" is returned)\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return this.referenceStyle.getVariant(variantType);\n }\n\n /**\n * Get all the variants for _this_ variants, except _this_ current one\n * @returns\n */\n getVariants(): Array {\n return this.referenceStyle.getVariants().filter((v) => v !== this);\n }\n\n /**\n * Get the image URL that represent _this_ variant\n * @returns\n */\n getImageURL(): string {\n return this.imageURL;\n }\n\n /**\n * Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)\n * @returns\n */\n getExpandedStyleURL(): string {\n return expandMapStyle(this.getId());\n }\n}\n\n/**\n * An instance of reference style contains a list of StyleVariants ordered by relevance\n */\nexport class ReferenceMapStyle {\n /**\n * Variants that belong to this reference style, key being the reference type\n */\n private variants: { [key: string]: MapStyleVariant } = {};\n\n /**\n * Variants that belong to this reference style, ordered by relevance\n */\n private orderedVariants: Array = [];\n\n constructor(\n /**\n * Human-friendly name of this reference style\n */\n private name: string,\n\n /**\n * ID of this reference style\n */\n private id: string\n ) {}\n\n /**\n * Get the human-friendly name of this reference style\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the id of _this_ reference style\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Add a variant to _this_ reference style\n * @param v\n */\n addVariant(v: MapStyleVariant) {\n this.variants[v.getType()] = v;\n this.orderedVariants.push(v);\n }\n\n /**\n * Check if a given variant type exists for this reference style\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return variantType in this.variants;\n }\n\n /**\n * Get a given variant. If the given type of variant does not exist for this reference style,\n * then the most relevant default variant is returned instead\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return variantType in this.variants\n ? this.variants[variantType]\n : this.orderedVariants[0];\n }\n\n /**\n * Get the list of variants for this reference style\n * @returns\n */\n getVariants(): Array {\n return Object.values(this.variants);\n }\n\n /**\n * Get the defualt variant for this reference style\n * @returns\n */\n getDefaultVariant(): MapStyleVariant {\n return this.orderedVariants[0];\n }\n}\n\n/**\n * All the styles and variants maintained by MapTiler.\n */\nexport type MapStyleType = {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings\n */\n STREETS: ReferenceMapStyle & {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in dark mode.\n */\n DARK: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode.\n */\n LIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette.\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n OUTDOOR: ReferenceMapStyle & {\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n WINTER: ReferenceMapStyle & {\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery only, without any label.\n */\n SATELLITE: ReferenceMapStyle & {\n /**\n * High resolution imagery only, without any label.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n HYBRID: ReferenceMapStyle & {\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A minimalist street-oriented style without POI\n */\n BASIC: ReferenceMapStyle & {\n /**\n * A minimalist street-oriented style without POI\n */\n DEFAULT: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n BRIGHT: ReferenceMapStyle & {\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, with a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Classic OpenStreetMap style\n */\n OPENSTREETMAP: ReferenceMapStyle & {\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPO: ReferenceMapStyle & {\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n SHINY: MapStyleVariant;\n /**\n * A nice low-contrast, alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, using a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n\n /**\n * A nice very high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPOGRAPHIQUE: MapStyleVariant;\n };\n\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n VOYAGER: ReferenceMapStyle & {\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in very dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A nice alternative to `streets` with a soft sepia color palette and vintage look\n */\n VINTAGE: MapStyleVariant;\n };\n\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n TONER: ReferenceMapStyle & {\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, without any label\n */\n BACKGROUND: MapStyleVariant;\n /**\n * A bold very high contrast, yet faded, style for the city\n */\n LITE: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, with no building, only roads!\n */\n LINES: MapStyleVariant;\n };\n\n /**\n * Minimalist style, perfect for data visualization\n */\n DATAVIZ: ReferenceMapStyle & {\n /**\n * Minimalist style, perfect for data visualization\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in dark mode\n */\n DARK: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n OCEAN: ReferenceMapStyle & {\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n DEFAULT: MapStyleVariant;\n };\n};\n\nexport const mapStylePresetList: Array = [\n {\n referenceStyleID: \"STREETS\",\n name: \"Streets\",\n description: \"\",\n variants: [\n {\n id: \"streets-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OUTDOOR\",\n name: \"Outdoor\",\n description: \"\",\n variants: [\n {\n id: \"outdoor-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"WINTER\",\n name: \"Winter\",\n description: \"\",\n variants: [\n {\n id: \"winter-v2\",\n name: \"Winter\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"SATELLITE\",\n name: \"Satellite\",\n description: \"\",\n variants: [\n {\n id: \"satellite\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"HYBRID\",\n name: \"Hybrid\",\n description: \"\",\n variants: [\n {\n id: \"hybrid\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BASIC\",\n name: \"Basic\",\n description: \"\",\n variants: [\n {\n id: \"basic-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BRIGHT\",\n name: \"Bright\",\n description: \"\",\n variants: [\n {\n id: \"bright-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OPENSTREETMAP\",\n name: \"OpenStreetMap\",\n description: \"\",\n variants: [\n {\n id: \"openstreetmap\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TOPO\",\n name: \"Topo\",\n description: \"\",\n variants: [\n {\n id: \"topo-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-shiny\",\n name: \"Shiny\",\n variantType: \"SHINY\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-topographique\",\n name: \"Topographique\",\n variantType: \"TOPOGRAPHIQUE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"VOYAGER\",\n name: \"Voyager\",\n description: \"\",\n variants: [\n {\n id: \"voyager-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-darkmatter\",\n name: \"Darkmatter\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-positron\",\n name: \"Positron\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-vintage\",\n name: \"Vintage\",\n variantType: \"VINTAGE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TONER\",\n name: \"Toner\",\n description: \"\",\n variants: [\n {\n id: \"toner-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-background\",\n name: \"Background\",\n variantType: \"BACKGROUND\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lite\",\n name: \"Lite\",\n variantType: \"LITE\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lines\",\n name: \"Lines\",\n variantType: \"LINES\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"DATAVIZ\",\n name: \"Dataviz\",\n description: \"\",\n variants: [\n {\n id: \"dataviz\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OCEAN\",\n name: \"Ocean\",\n description: \"\",\n variants: [\n {\n id: \"ocean\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n];\n\nfunction makeReferenceStyleProxy(referenceStyle: ReferenceMapStyle) {\n return new Proxy(referenceStyle, {\n get(target, prop, receiver) {\n if (target.hasVariant(prop as string)) {\n return target.getVariant(prop as string);\n }\n\n // This variant does not exist for this style, but since it's full uppercase\n // we guess that the dev tries to access a style variant. So instead of\n // returning the default (STREETS.DEFAULT), we return the non-variant of the current style\n if (prop.toString().toUpperCase() === (prop as string)) {\n return referenceStyle.getDefaultVariant();\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\nfunction buildMapStyles(): MapStyleType {\n const mapStyle = {};\n\n for (let i = 0; i < mapStylePresetList.length; i += 1) {\n const refStyleInfo = mapStylePresetList[i];\n\n const refStyle = makeReferenceStyleProxy(\n new ReferenceMapStyle(refStyleInfo.name, refStyleInfo.referenceStyleID)\n );\n\n for (let j = 0; j < refStyleInfo.variants.length; j += 1) {\n const variantInfo = refStyleInfo.variants[j];\n const variant = new MapStyleVariant(\n variantInfo.name, // name\n variantInfo.variantType, // variantType\n variantInfo.id, // id\n refStyle, // referenceStyle\n variantInfo.description,\n variantInfo.imageURL // imageURL\n );\n\n refStyle.addVariant(variant);\n }\n mapStyle[refStyleInfo.referenceStyleID] = refStyle;\n }\n return mapStyle as MapStyleType;\n}\n\nexport function styleToStyle(\n style: string | ReferenceMapStyle | MapStyleVariant | null | undefined\n): string {\n if (!style) {\n return MapStyle[mapStylePresetList[0].referenceStyleID]\n .getDefaultVariant()\n .getId();\n }\n\n // If the provided style is a shorthand (eg. \"streets-v2\") then we make sure it's trimmed and lowercase\n if (typeof style === \"string\" || style instanceof String) {\n return style.trim().toLowerCase();\n }\n\n if (style instanceof MapStyleVariant) {\n return style.getId();\n }\n\n if (style instanceof ReferenceMapStyle) {\n return style.getDefaultVariant().getId();\n }\n}\n\n/**\n * Contains all the reference map style created by MapTiler team as well as all the variants.\n * For example, `MapStyle.STREETS` and the variants:\n * - `MapStyle.STREETS.DARK`\n * - `MapStyle.STREETS.LIGHT`\n * - `MapStyle.STREETS.PASTEL`\n *\n */\nexport const MapStyle: MapStyleType = buildMapStyles();\n","/**\\\n * This code is borrowed from https://github.com/mourner/simplify-js and reworked a little.\n */\n\nimport { Position } from \"geojson\";\n\n// square distance from a point to a segment\nfunction getSqSegDist(p: Position, p1: Position, p2: Position): number {\n let x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n\nfunction simplifyDPStep(\n points: Array,\n first: number,\n last: number,\n sqTolerance: number,\n simplified: Array\n) {\n let maxSqDist = sqTolerance,\n index;\n\n for (let i = first + 1; i < last; i++) {\n const sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) {\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n }\n simplified.push(points[index]);\n\n if (last - index > 1) {\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(\n points: Array,\n sqTolerance: number\n): Array {\n const last = points.length - 1;\n const simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nexport default function simplify(\n points: Array,\n tolerance: number\n): Array {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n const simplePoints = simplifyDouglasPeucker(points, sqTolerance);\n return simplePoints;\n}\n","import { BBox, Position } from \"geojson\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { MapStyleVariant, ReferenceMapStyle, styleToStyle } from \"../mapstyle\";\nimport simplify from \"./simplify\";\n\n/**\n * Base set of options that can be provided to all the types of static maps\n */\nexport type StaticMapBaseOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Style of the map (not full style URL). Example: \"winter\", \"streets-v2\".\n * Default: `\"streets-v2\"`\n */\n style?: string | ReferenceMapStyle | MapStyleVariant;\n\n /**\n * Double the size of the static map image to support hiDPI/Retina monitors.\n * Default: `false`\n */\n hiDPI?: boolean;\n\n /**\n * Image format.\n * Default: `\"png\"`\n */\n format?: \"png\" | \"jpg\" | \"webp\";\n\n /**\n * Width of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n width?: number;\n\n /**\n * Height of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n height?: number;\n\n /**\n * Placement of the attribution. Can also be set to `false` to not show attribution.\n * Default: `\"bottomright\"`\n */\n attribution?: \"bottomright\" | \"bottomleft\" | \"topleft\" | \"topright\" | false;\n\n /**\n * A marker or list of markers to show on the map\n * Default: none provided\n */\n markers?: StaticMapMarker | Array;\n\n /**\n * URL of the marker image. Applies only if one or multiple markers positions are provided.\n * Default: none provided\n */\n markerIcon?: string;\n\n /**\n * Position of the marker regarding its coordinates. Applies only:\n * - with a custom icon provided with `markerIcon`\n * - if one or multiple markers positions are provided.\n * Default: `\"bottom\"`\n */\n markerAnchor?:\n | \"top\"\n | \"left\"\n | \"bottom\"\n | \"right\"\n | \"center\"\n | \"topleft\"\n | \"bottomleft\"\n | \"topright\"\n | \"bottomright\";\n\n /**\n * Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.\n * Default: none provided\n */\n path?: Array;\n\n /**\n * Color of the path line. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: `\"blue\"`\n */\n pathStrokeColor?: string;\n\n /**\n * Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: none (transparent filling)\n */\n pathFillColor?: string;\n\n /**\n * Width of the path line in pixel. It can be floating point precision (ex: `0.5`)\n * Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.\n */\n pathWidth?: number;\n};\n\n/**\n * Options that can be provided to centered static maps\n */\nexport type CenteredStaticMapOptions = StaticMapBaseOptions;\n\n/**\n * Options that can be provided to bounded static maps\n */\nexport type BoundedStaticMapOptions = StaticMapBaseOptions & {\n /**\n * Extra space added around the regio of interest, in percentage.\n * Default: `0.1` (for 10%)\n */\n padding?: number;\n};\n\n/**\n * Options that can be provided to automatic static maps\n */\nexport type AutomaticStaticMapOptions = BoundedStaticMapOptions;\n\n/**\n * Definition of a maker to show on a static map\n */\nexport type StaticMapMarker = [\n /**\n * Longitude of the marker\n */\n number,\n /**\n * latitude of the marker\n */\n number,\n /**\n * Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.\n */\n string\n];\n\nfunction staticMapMarkerToString(\n marker: StaticMapMarker,\n includeColor = true\n): string {\n let str = `${marker[0]},${marker[1]}`;\n\n if (marker.length === 3 && includeColor) {\n str += `,${marker[2]}`;\n }\n\n return str;\n}\n\nfunction simplifyAndStringify(path: Array, maxNbChar = 3000): string {\n let str = path.map((point) => point.join(\",\")).join(\"|\");\n let tolerance = 0.000005;\n const toleranceStep = 0.00001;\n\n while (str.length > maxNbChar) {\n const simplerPath = simplify(path, tolerance);\n // str = simplerPath.map(point => point.join(',')).join('|');\n str = simplerPath.map((point) => `${point[0]},${point[1]}`).join(\"|\");\n tolerance += toleranceStep;\n }\n\n return str;\n}\n\n/**\n * Construct the URL for a static map centered on one point.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param center\n * @param zoom\n * @param options\n * @returns\n */\nfunction centered(\n center: Position,\n zoom: number,\n options: CenteredStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${center[0]},${\n center[1]\n },${zoom}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map using a bounding box\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param boundingBox\n * @param options\n * @returns\n */\nfunction bounded(\n boundingBox: BBox,\n options: BoundedStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${\n boundingBox[1]\n },${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map automatically fitted around the provided path or markers.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param options\n * @returns\n */\nfunction automatic(options: AutomaticStaticMapOptions = {}): string {\n if (!(\"markers\" in options) && !(\"path\" in options)) {\n throw new Error(\n \"Automatic static maps require markers and/or path to be created.\"\n );\n }\n\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(\n style\n )}/static/auto/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).\n * The URL of static maps can then be used within a `` markup element, as the `src` property value.\n */\nconst staticMaps = {\n centered,\n bounded,\n automatic,\n};\n\nexport { staticMaps };\n"],"names":["__async","customMessages"],"mappings":";;;;;;EAEA,SAAS,eAAkB,GAAA;EAEzB,EAAI,IAAA,OAAO,SAAS,WAAa,EAAA;EAC/B,IAAO,OAAA,KAAA,CAAM,KAAK,IAAI,CAAA,CAAA;EAAA,GACxB;EAEA,EAAA,IAAI,OAAO,MAAA,KAAW,WAAe,IAAA,MAAA,CAAO,KAAO,EAAA;EACjD,IAAA,OAAO,MAAO,CAAA,KAAA,CAAA;EAAA,GAChB;EAEA,EAAO,OAAA,IAAA,CAAA;EACT,CAAA;EAKA,MAAM,YAAa,CAAA;EAAA,EAAnB,WAAA,GAAA;EAIE;EAAA;EAAA;EAAA,IAAA,IAAA,CAAQ,OAAU,GAAA,EAAA,CAAA;EAMlB;EAAA;EAAA;EAAA;EAAA,IAAA,IAAA,CAAQ,SAA+B,eAAgB,EAAA,CAAA;EAAA,GAAA;EAAA;EAAA;EAAA;EAAA,EAKvD,IAAI,OAAO,CAAW,EAAA;EACpB,IAAA,IAAA,CAAK,OAAU,GAAA,CAAA,CAAA;EAAA,GACjB;EAAA;EAAA;EAAA;EAAA,EAKA,IAAI,MAAiB,GAAA;EACnB,IAAA,OAAO,IAAK,CAAA,OAAA,CAAA;EAAA,GACd;EAAA;EAAA;EAAA;EAAA,EAKA,IAAI,MAAM,CAAkB,EAAA;EAC1B,IAAA,IAAA,CAAK,MAAS,GAAA,CAAA,CAAA;EAAA,GAChB;EAAA;EAAA;EAAA;EAAA,EAKA,IAAI,KAA8B,GAAA;EAChC,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;EAAA,GACd;EACF,CAAA;AAKM,QAAA,MAAA,GAAS,IAAI,YAAa;;AC3DhC,QAAM,iBAAoB,GAAA;EAAA,EACxB,IAAM,EAAA,MAAA;EAAA,EACN,QAAU,EAAA,IAAA;EAAA,EACV,MAAQ,EAAA,IAAA;EAAA,EACR,QAAU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,EAAA,CAAA;EAC3B,CAAA;AAMA,QAAM,UAAa,GAAA;EAAA,EACjB,QAAA;EAAA,EACA,OAAA;EAAA,EACA,SAAA;EACF;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"maptiler-client.umd.js","sources":["../src/config.ts","../src/language.ts","../src/callFetch.ts","../src/defaults.ts","../src/services/ServiceError.ts","../src/services/geocoding.ts","../src/services/geolocation.ts","../src/services/coordinates.ts","../src/services/data.ts","../src/mapstyle.ts","../src/services/simplify.ts","../src/services/staticMaps.ts"],"sourcesContent":["export type FetchFunction = (url: string, options: object) => Promise;\n\nfunction tryGettingFetch() {\n // this is browser, fetch exists\n if (typeof self !== \"undefined\") {\n return fetch.bind(self);\n }\n\n if (typeof global !== \"undefined\" && global.fetch) {\n return global.fetch;\n }\n\n return null;\n}\n\n/**\n * The configuration object definition\n */\nclass ClientConfig {\n /**\n * MapTiler Cloud API key\n */\n private _apiKey = \"\";\n\n /**\n * The fetch function. To be set if in Node < 18, otherwise\n * will be automatically resolved.\n */\n private _fetch: FetchFunction | null = tryGettingFetch();\n\n /**\n * Set the MapTiler Cloud API key\n */\n set apiKey(k: string) {\n this._apiKey = k;\n }\n\n /**\n * Get the MapTiler Cloud API key\n */\n get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * Set a the custom fetch function to replace the default one\n */\n set fetch(f: FetchFunction) {\n this._fetch = f;\n }\n\n /**\n * Get the fetch fucntion\n */\n get fetch(): FetchFunction | null {\n return this._fetch;\n }\n}\n\n/**\n * Configuration object\n */\nconst config = new ClientConfig();\n\nexport { ClientConfig, config };\n","/**\n * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.\n */\nconst LanguageGeocoding = {\n AUTO: \"auto\",\n ALBANIAN: \"sq\",\n ARABIC: \"ar\",\n ARMENIAN: \"hy\",\n AZERBAIJANI: \"az\",\n BELORUSSIAN: \"be\",\n BOSNIAN: \"bs\",\n BRETON: \"br\",\n BULGARIAN: \"bg\",\n CATALAN: \"ca\",\n CHINESE: \"zh\",\n CROATIAN: \"hr\",\n CZECH: \"cs\",\n DANISH: \"da\",\n DUTCH: \"nl\",\n ENGLISH: \"en\",\n ESPERANTO: \"eo\",\n ESTONIAN: \"et\",\n FINNISH: \"fi\",\n FRENCH: \"fr\",\n FRISIAN: \"fy\",\n GEORGIAN: \"ka\",\n GERMAN: \"de\",\n GREEK: \"el\",\n HEBREW: \"he\",\n HUNGARIAN: \"hu\",\n ICELANDIC: \"is\",\n IRISH: \"ga\",\n ITALIAN: \"it\",\n JAPANESE: \"ja\",\n KANNADA: \"kn\",\n KAZAKH: \"kk\",\n KOREAN: \"ko\",\n ROMAN_LATIN: \"la\",\n LATVIAN: \"lv\",\n LITHUANIAN: \"lt\",\n LUXEMBOURGISH: \"lb\",\n MACEDONIAN: \"mk\",\n MALTESE: \"mt\",\n NORWEGIAN: \"no\",\n POLISH: \"pl\",\n PORTUGUESE: \"pt\",\n ROMANIAN: \"ro\",\n ROMANSH: \"rm\",\n RUSSIAN: \"ru\",\n SCOTTISH_GAELIC: \"gd\",\n SERBIAN_CYRILLIC: \"sr\",\n SLOVAK: \"sk\",\n SLOVENE: \"sl\",\n SPANISH: \"es\",\n SWEDISH: \"sv\",\n THAI: \"th\",\n TURKISH: \"tr\",\n UKRAINIAN: \"uk\",\n WELSH: \"cy\",\n};\n\nconst languageCodeSet = new Set(Object.values(LanguageGeocoding));\n\ntype Values = T[keyof T];\n\n/**\n * Built-in languages values as strings\n */\ntype LanguageGeocodingString = Values;\n\nfunction getAutoLanguageGeocoding(): LanguageGeocodingString {\n if (typeof navigator === \"undefined\") {\n return Intl.DateTimeFormat()\n .resolvedOptions()\n .locale.split(\"-\")[0] as LanguageGeocodingString;\n }\n\n const canditatelangs = Array.from(\n new Set(navigator.languages.map((l) => l.split(\"-\")[0]))\n ).filter((l) => languageCodeSet.has(l as LanguageGeocodingString));\n\n return canditatelangs.length\n ? (canditatelangs[0] as LanguageGeocodingString)\n : LanguageGeocoding.ENGLISH;\n}\n\nexport { LanguageGeocoding, LanguageGeocodingString, getAutoLanguageGeocoding };\n","import { config } from \"./config\";\n\nexport async function callFetch(resource, options = {}) {\n if (config.fetch === null) {\n throw new Error(\n \"The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch\"\n );\n }\n\n // Control if URL contains the api key\n if (new URL(resource).searchParams.get(\"key\").trim() === \"\") {\n throw new Error(\n \"The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com\"\n );\n }\n\n return config.fetch(resource, options);\n}\n","/**\n * Some default settings for the SDK\n */\nconst defaults = {\n maptilerApiURL: \"https://api.maptiler.com/\",\n mapStyle: \"streets-v2\",\n};\n\nObject.freeze(defaults);\n\nexport { defaults };\n","/**\n * A ServiceError is an Error that includes the HTTP response details\n */\nexport class ServiceError extends Error {\n constructor(public res: Response, customMessage = \"\") {\n super(\n `Call to enpoint ${res.url} failed with the status code ${res.status}. ${customMessage}`\n );\n }\n}\n","import { BBox, Feature, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\n\nimport {\n getAutoLanguageGeocoding,\n LanguageGeocoding,\n LanguageGeocodingString,\n} from \"../language\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 400: \"Query too long / Invalid parameters\",\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type LanguageGeocodingOptions = {\n /**\n * Prefer results in specific language. It’s possible to specify multiple values.\n */\n language?: LanguageGeocodingString | Array;\n};\n\nexport type CommonForwardAndReverseGeocodingOptions =\n LanguageGeocodingOptions & {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.\n */\n limit?: number;\n\n /**\n * Filter of feature types to return. If not specified, all available feature types are returned.\n */\n types?: (\n | \"country\"\n | \"region\"\n | \"subregion\"\n | \"county\"\n | \"joint_municipality\"\n | \"joint_submunicipality\"\n | \"municipality\"\n | \"municipal_district\"\n | \"locality\"\n | \"neighbourhood\"\n | \"place\"\n | \"postal_code\"\n | \"address\"\n )[];\n };\n\nexport type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {\n /**\n * Only search for results in the specified area.\n */\n bbox?: BBox;\n\n /**\n * Prefer results close to a specific location.\n */\n proximity?: Position;\n\n /**\n * Limit search to specific country/countries specified as list of Alpha-2 ISO 3166-1 codes.\n */\n country?: string[];\n\n /**\n * Set to `false` to disable fuzzy (typo-tolerant) search. Default is `true`.\n */\n fuzzyMatch?: boolean;\n\n /**\n * Set to `true` to use autocomplete, `false` to disable it.\n * Default (`undefined`) is to combine autocomplete with non-autocomplete results.\n */\n autocomplete?: boolean;\n};\n\nexport type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;\n\nexport type ByIdGeocodingOptions = LanguageGeocodingOptions;\n\nexport type Coordinates = Position;\n\nexport type FeatureHierarchy = {\n /**\n * Unique feature ID\n */\n id: string;\n\n /**\n * Localized feature name\n */\n text: string;\n};\n\nexport type GeocodingFeature = Feature & {\n /**\n * Bounding box of the original feature as [w, s, e, n] array\n */\n bbox: BBox;\n\n /**\n * A [lon, lat] array of the original feature centeroid\n */\n center: Coordinates;\n\n /**\n * Formatted (including the hierarchy) and localized feature full name\n */\n place_name: string;\n\n /**\n * Localized feature name\n */\n text: string;\n\n /**\n * Feature hierarchy\n */\n context?: Array;\n\n /**\n * Address number, if applicable\n */\n address?: string;\n};\n\nexport type GeocodingSearchResult = {\n type: \"FeatureCollection\";\n\n /**\n * Array of features found\n */\n features: Array;\n\n /**\n * Tokenized search query\n */\n query: Array;\n\n /**\n * Attribution of the result\n */\n attribution: string;\n};\n\nfunction addLanguageGeocodingOptions(\n searchParams: URLSearchParams,\n options: LanguageGeocodingOptions\n) {\n if (options.language == undefined) {\n return;\n }\n\n const languages = Array.from(\n new Set(\n (Array.isArray(options.language)\n ? options.language\n : [options.language]\n ).map((lang) =>\n lang === LanguageGeocoding.AUTO ? getAutoLanguageGeocoding() : lang\n )\n )\n ).join(\",\");\n\n searchParams.set(\"language\", languages);\n}\n\nfunction addCommonForwardAndReverseGeocodingOptions(\n searchParams: URLSearchParams,\n options: CommonForwardAndReverseGeocodingOptions\n) {\n searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (options.limit != undefined) {\n searchParams.set(\"limit\", String(options.limit));\n }\n\n if (options.types != undefined) {\n searchParams.set(\"types\", options.types.join(\",\"));\n }\n\n addLanguageGeocodingOptions(searchParams, options);\n}\n\n/**\n * Performs a forward geocoding query to MapTiler API.\n * Providing a human readable place name (of a city, country, street, etc.), the function returns\n * a list of candidate locations including longitude and latitude.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward\n * @param query\n * @param options\n * @returns\n */\nasync function forward(\n query: string,\n options: GeocodingOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `geocoding/${encodeURIComponent(query)}.json`,\n defaults.maptilerApiURL\n );\n\n const { searchParams } = endpoint;\n\n addCommonForwardAndReverseGeocodingOptions(searchParams, options);\n\n if (options.bbox != undefined) {\n searchParams.set(\"bbox\", options.bbox.join(\",\"));\n }\n\n if (options.proximity != undefined) {\n searchParams.set(\"proximity\", options.proximity.join(\",\"));\n }\n\n if (options.country != undefined) {\n searchParams.set(\"country\", options.country.join(\",\"));\n }\n\n if (options.fuzzyMatch != undefined) {\n searchParams.set(\"fuzzyMatch\", options.fuzzyMatch ? \"true\" : \"false\");\n }\n\n if (options.autocomplete != undefined) {\n searchParams.set(\"autocomplete\", options.autocomplete ? \"true\" : \"false\");\n }\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a reverse geocoding query to MapTiler API.\n * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse\n * @param position\n * @param options\n * @returns\n */\nasync function reverse(\n position: Position,\n options: ReverseGeocodingOptions = {}\n): Promise {\n if (!Array.isArray(position) || position.length < 2) {\n throw new Error(\"The position must be an array of form [lng, lat].\");\n }\n\n const endpoint = new URL(\n `geocoding/${position[0]},${position[1]}.json`,\n defaults.maptilerApiURL\n );\n\n addCommonForwardAndReverseGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * Perform a geocoding query to MapTiler API to obtain fature by its ID.\n * Providing a feature ID, this function returns a feature which includes its full geometry.\n * Note that the feature ID is not stable and it changes when the database is re-indexed.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id\n * @param id\n * @param options\n * @returns\n */\nasync function byId(\n id: string,\n options: ByIdGeocodingOptions = {}\n): Promise {\n const endpoint = new URL(`geocoding/${id}.json`, defaults.maptilerApiURL);\n\n addLanguageGeocodingOptions(endpoint.searchParams, options);\n\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(res, customMessages[res.status] ?? \"\");\n }\n\n const obj: GeocodingSearchResult = await res.json();\n\n return obj;\n}\n\n/**\n * The **geocoding** namespace contains asynchronous functions to call the [MapTiler Geocoding API](https://docs.maptiler.com/cloud/api/geocoding/).\n * The **Geocoding API** provides ways to get geographic coordinates from a human-readable search query of a place (forward geocoding)\n * and to get the location details (country, city, street, etc.) from a geographic coordinate (reverse geocoding);\n */\nconst geocoding = {\n forward,\n reverse,\n byId,\n language: LanguageGeocoding,\n};\n\nexport { geocoding };\n","import { BBox } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GeolocationInfoOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\nexport type GeolocationResult = {\n /**\n * Name of the country\n * Example: Switzerland\n */\n country?: string;\n\n /**\n * Two-letter code of the country ISO 3166-1 alpha-2 codes\n * Example: CH\n */\n country_code?: string;\n\n /**\n * Bounds of the country in WGS84 degrees [west, south, east, north].\n * Example: [5.95538,45.818852,10.490936,47.809357]\n */\n country_bounds?: BBox;\n\n /**\n * Official country languages in ISO 639-1 format. ISO 639-1 codes\n * Example: [\"de\",\"fr\",\"it\"]\n */\n country_languages?: Array;\n\n /**\n * Name of the continent\n * Example: Europe\n */\n continent?: string;\n\n /**\n * Two-letter code of the continent\n * Example: EU\n */\n continent_code?: string;\n\n /**\n * Indicated whether the country is part of the European Union.\n */\n eu?: boolean;\n\n /**\n * Name of the city\n * Example: Zurich\n */\n city?: string;\n\n /**\n * Latitude of the location\n * Example: 47.36667\n */\n latitude?: number;\n\n /**\n * Longitude of the location\n * Example: 8.55\n */\n longitude?: number;\n\n /**\n * Postal code\n * Example: 8000\n */\n postal?: string;\n\n /**\n * If known, the ISO 3166-2 name for the first level region. ISO 3166-2 codes\n * Example: Zurich\n */\n region?: string;\n\n /**\n * If known, the ISO 3166-2 code for the first level region. ISO 3166-2 codes\n * Example: ZH\n */\n region_code?: string;\n\n /**\n * Name of the timezone\n * Example: Europe/Zurich\n */\n timezone?: string;\n};\n\n/**\n * Looks up geolocation details from IP address using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geolocation/#ip-geolocation\n * @returns\n */\nasync function info(\n options: GeolocationInfoOptions = {}\n): Promise {\n const endpoint = new URL(`geolocation/ip.json`, defaults.maptilerApiURL);\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as GeolocationResult;\n}\n\n/**\n * The **geolocation** namespace contains an asynchronous function to call the [MapTiler Geolocation API](https://docs.maptiler.com/cloud/api/geolocation/).\n * The **Geolocation API** provides a way to retrieve the IP address as well as geographic informations of a machine performing the query (most likely: a user)\n */\nconst geolocation = {\n info,\n};\n\nexport { geolocation };\n","import { BBox, Position } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\nexport type CoordinatesSearchOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Maximum number of results returned (default: 10)\n */\n limit?: number;\n\n /**\n * Show detailed transformations for each CRS (default: false)\n */\n transformations?: boolean;\n\n /**\n * Show exports in WKT and Proj4 notations (default: false)\n */\n exports?: boolean;\n};\n\nexport type CoordinateId = {\n authority: string;\n code: BigInteger;\n};\n\nexport type CoordinateExport = {\n proj4: string;\n wkt: string;\n};\n\nexport type CoordinateGrid = {\n path: string;\n};\n\nexport type CoordinateTransformation = {\n id: CoordinateId;\n name: string;\n reversible: boolean;\n usable: boolean;\n deprecated: boolean;\n grids: Array;\n accuracy?: number;\n area?: string;\n bbox?: BBox;\n target_crs?: CoordinateId;\n unit?: string;\n};\n\nexport type CoordinateSearch = {\n id: CoordinateId;\n\n name: string;\n\n kind: string;\n\n deprecated: boolean;\n\n transformations?: Array;\n\n accuracy?: number;\n\n unit?: string;\n\n area?: string;\n\n /**\n * Bounding box of the resource in [min_lon, min_lat, max_lon, max_lat] order.\n */\n bbox?: BBox;\n\n /**\n * Most suitable transformation for this CRS.\n */\n default_transformation?: any;\n\n exports: CoordinateExport;\n};\n\nexport type CoordinateSearchResult = {\n /**\n * The coordinate search results\n */\n results: Array;\n\n /**\n * The number of results\n */\n total: number;\n};\n\n/**\n * Search information about coordinate systems using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems\n * @param query Can be any kind of CRS by name or code\n * @param options\n * @returns\n */\nasync function search(\n query: string,\n options: CoordinatesSearchOptions = {}\n): Promise {\n if (typeof query !== \"string\" || query.trim().length === 0) {\n throw new Error(\"The query must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `coordinates/search/${query}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"limit\" in options) {\n endpoint.searchParams.set(\"limit\", options.limit.toString());\n }\n\n if (\"transformations\" in options) {\n endpoint.searchParams.set(\n \"transformations\",\n options.transformations.toString()\n );\n }\n\n if (\"exports\" in options) {\n endpoint.searchParams.set(\"exports\", options.exports.toString());\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateSearchResult;\n}\n\nexport type XYZ = {\n x?: number;\n y?: number;\n z?: number;\n};\n\nexport type CoordinateTransformResult = {\n results: Array;\n\n /**\n * Transformations are selected using given ops parameter.\n * If no parameter is given, auto strategy is used.\n * If given, it may try to use a listed transformation,\n * then fallback to towgs84 patching, and finally boundcrs.\n */\n transformer_selection_strategy: string;\n};\n\n/**\n * Options that can be provided when transforming a coordinate from one CRS to another.\n */\nexport type CoordinatesTransformOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Source coordinate reference system (default: 4326)\n */\n sourceCrs?: number;\n\n /**\n * Target coordinate reference system (default: 4326)\n */\n targetCrs?: number;\n\n /**\n * List of codes of operations\n */\n operations?: number | Array;\n};\n\n/**\n * Transforms coordinates from a source reference system to a target reference system using MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates\n * @param positions\n * @param options\n * @returns\n */\nasync function transform(\n positions: Position | Array,\n options: CoordinatesTransformOptions = {}\n): Promise {\n const coordinatesStr = (Array.isArray(positions[0]) ? positions : [positions])\n .map((coord) => `${coord[0]},${coord[1]}`)\n .join(\";\");\n\n const endpoint = new URL(\n `coordinates/transform/${coordinatesStr}.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n if (\"sourceCrs\" in options) {\n endpoint.searchParams.set(\"s_srs\", options.sourceCrs.toString());\n }\n\n if (\"targetCrs\" in options) {\n endpoint.searchParams.set(\"t_srs\", options.targetCrs.toString());\n }\n\n if (\"operations\" in options) {\n endpoint.searchParams.set(\n \"ops\",\n (Array.isArray(options.operations)\n ? options.operations\n : [options.operations]\n ).join(\"|\")\n );\n }\n\n const urlWithParams = endpoint.toString();\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj as CoordinateTransformResult;\n}\n\n/**\n * The **coordinate** namespace contains asynchronous functions to call the [MapTiler Coordinate API](https://docs.maptiler.com/cloud/api/coordinates/).\n * The goal of the **Coordinate API* is query information about spatial coordinate reference system (CRS) as well as to transform coordinates from one CRS to another.\n */\nconst coordinates = {\n search,\n transform,\n};\n\nexport { coordinates };\n","import { FeatureCollection } from \"geojson\";\nimport { callFetch } from \"../callFetch\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { ServiceError } from \"./ServiceError\";\n\nconst customMessages = {\n 403: \"Key is missing, invalid or restricted\",\n};\n\n/**\n * Options that can be provided to get user data.\n */\nexport type GetDataOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n};\n\n/**\n * Get user data and returns it as GeoJSON using the MapTiler API.\n * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/data/#geojson\n * @param dataId\n * @returns\n */\nasync function get(\n dataId: string,\n options: GetDataOptions = {}\n): Promise {\n if (typeof dataId !== \"string\" || dataId.trim().length === 0) {\n throw new Error(\"The data ID must be a non-empty string\");\n }\n\n const endpoint = new URL(\n `data/${encodeURIComponent(dataId)}/features.json`,\n defaults.maptilerApiURL\n );\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n const urlWithParams = endpoint.toString();\n\n const res = await callFetch(urlWithParams);\n\n if (!res.ok) {\n throw new ServiceError(\n res,\n res.status in customMessages ? customMessages[res.status] : \"\"\n );\n }\n\n const obj = await res.json();\n return obj;\n}\n\n/**\n * The **data** namespace contains an asynchronous function to call the [MapTiler Data API](https://docs.maptiler.com/cloud/api/data/).\n * The **Data API** provides a way to retrieve user data in GeoJSON format.\n */\nconst data = {\n get,\n};\n\nexport { data };\n","/**\n * Expand the map style provided as argument of the Map constructor\n * @param style\n * @returns\n */\nexport function expandMapStyle(style): string {\n // testing if the style provided is of form \"maptiler://some-style\"\n const maptilerDomainRegex = /^maptiler:\\/\\/(.*)/;\n let match;\n const trimmed = style.trim();\n let expandedStyle;\n\n // The style was possibly already given as expanded URL\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n expandedStyle = trimmed;\n } else if ((match = maptilerDomainRegex.exec(trimmed)) !== null) {\n expandedStyle = `https://api.maptiler.com/maps/${match[1]}/style.json`;\n } else {\n // The style could also possibly just be the name of the style without any URI style\n expandedStyle = `https://api.maptiler.com/maps/${trimmed}/style.json`;\n }\n\n return expandedStyle;\n}\n\n/**\n * Type for object containing style details\n */\nexport type MapStylePreset = {\n referenceStyleID: string;\n name: string;\n description: string;\n variants: Array<{\n id: string;\n name: string;\n variantType: string;\n description: string;\n imageURL: string;\n }>;\n};\n\n/**\n * An instance of MapStyleVariant contains information about a style to use that belong to a reference style\n */\nexport class MapStyleVariant {\n constructor(\n /**\n * Human-friendly name\n */\n private name: string,\n\n /**\n * Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE`\n */\n private variantType: string,\n\n /**\n * MapTiler Cloud id\n */\n private id: string,\n\n /**\n * Reference map style, used to retrieve sibling variants\n */\n private referenceStyle: ReferenceMapStyle,\n\n /**\n * Human-friendly description\n */\n private description: string,\n\n /**\n * URL to an image describing the style variant\n */\n private imageURL: string\n ) {}\n\n /**\n * Get the human-friendly name\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n getFullName(): string {\n return `${this.referenceStyle.getName()} ${this.name}`;\n }\n\n /**\n * Get the variant type (eg. \"DEFAULT\", \"DARK\", \"PASTEL\", etc.)\n * @returns\n */\n getType(): string {\n return this.variantType;\n }\n\n /**\n * Get the MapTiler Cloud id\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Get the human-friendly description\n */\n getDescription(): string {\n return this.description;\n }\n\n /**\n * Get the reference style this variant belongs to\n * @returns\n */\n getReferenceStyle(): ReferenceMapStyle {\n return this.referenceStyle;\n }\n\n /**\n * Check if a variant of a given type exists for _this_ variants\n * (eg. if this is a \"DARK\", then we can check if there is a \"LIGHT\" variant of it)\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return this.referenceStyle.hasVariant(variantType);\n }\n\n /**\n * Retrieve the variant of a given type. If not found, will return the \"DEFAULT\" variant.\n * (eg. _this_ \"DARK\" variant does not have any \"PASTEL\" variant, then the \"DEFAULT\" is returned)\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return this.referenceStyle.getVariant(variantType);\n }\n\n /**\n * Get all the variants for _this_ variants, except _this_ current one\n * @returns\n */\n getVariants(): Array {\n return this.referenceStyle.getVariants().filter((v) => v !== this);\n }\n\n /**\n * Get the image URL that represent _this_ variant\n * @returns\n */\n getImageURL(): string {\n return this.imageURL;\n }\n\n /**\n * Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)\n * @returns\n */\n getExpandedStyleURL(): string {\n return expandMapStyle(this.getId());\n }\n}\n\n/**\n * An instance of reference style contains a list of StyleVariants ordered by relevance\n */\nexport class ReferenceMapStyle {\n /**\n * Variants that belong to this reference style, key being the reference type\n */\n private variants: { [key: string]: MapStyleVariant } = {};\n\n /**\n * Variants that belong to this reference style, ordered by relevance\n */\n private orderedVariants: Array = [];\n\n constructor(\n /**\n * Human-friendly name of this reference style\n */\n private name: string,\n\n /**\n * ID of this reference style\n */\n private id: string\n ) {}\n\n /**\n * Get the human-friendly name of this reference style\n * @returns\n */\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the id of _this_ reference style\n * @returns\n */\n getId(): string {\n return this.id;\n }\n\n /**\n * Add a variant to _this_ reference style\n * @param v\n */\n addVariant(v: MapStyleVariant) {\n this.variants[v.getType()] = v;\n this.orderedVariants.push(v);\n }\n\n /**\n * Check if a given variant type exists for this reference style\n * @param variantType\n * @returns\n */\n hasVariant(variantType: string): boolean {\n return variantType in this.variants;\n }\n\n /**\n * Get a given variant. If the given type of variant does not exist for this reference style,\n * then the most relevant default variant is returned instead\n * @param variantType\n * @returns\n */\n getVariant(variantType: string): MapStyleVariant {\n return variantType in this.variants\n ? this.variants[variantType]\n : this.orderedVariants[0];\n }\n\n /**\n * Get the list of variants for this reference style\n * @returns\n */\n getVariants(): Array {\n return Object.values(this.variants);\n }\n\n /**\n * Get the defualt variant for this reference style\n * @returns\n */\n getDefaultVariant(): MapStyleVariant {\n return this.orderedVariants[0];\n }\n}\n\n/**\n * All the styles and variants maintained by MapTiler.\n */\nexport type MapStyleType = {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings\n */\n STREETS: ReferenceMapStyle & {\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in dark mode.\n */\n DARK: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in light mode.\n */\n LIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, in blue night mode.\n */\n NIGHT: MapStyleVariant;\n /**\n * Suitable for navigation, with high level of detail on urban areas, plenty of POIs and 3D buildings, with a pastel color palette.\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n OUTDOOR: ReferenceMapStyle & {\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Suitable for outdoor activities. With elevation isolines and hillshading, in dark mode.\n */\n DARK: MapStyleVariant;\n };\n\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n WINTER: ReferenceMapStyle & {\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading.\n */\n DEFAULT: MapStyleVariant;\n /**\n * Suitabe for winter outdoor activities. With ski tracks, elevation isolines and hillshading, in dark mode.\n */\n DARK: MapStyleVariant;\n };\n\n /**\n * High resolution imagery only, without any label.\n */\n SATELLITE: ReferenceMapStyle & {\n /**\n * High resolution imagery only, without any label.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n HYBRID: ReferenceMapStyle & {\n /**\n * High resolution imagery with labels, political borders and roads.\n */\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A minimalist street-oriented style without POI\n */\n BASIC: ReferenceMapStyle & {\n /**\n * A minimalist street-oriented style without POI\n */\n DEFAULT: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A minimalist street-oriented style without POI, in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n BRIGHT: ReferenceMapStyle & {\n /**\n * A bright street-oriented style, a nice alternative to `streets`\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A bright street-oriented style, a nice alternative to `streets`, with a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n };\n\n /**\n * Classic OpenStreetMap style\n */\n OPENSTREETMAP: ReferenceMapStyle & {\n DEFAULT: MapStyleVariant;\n };\n\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPO: ReferenceMapStyle & {\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, in dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice high-contrast, and high saturation alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n SHINY: MapStyleVariant;\n /**\n * A nice low-contrast, alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details, using a soft pastel color palette\n */\n PASTEL: MapStyleVariant;\n\n /**\n * A nice very high-contrast, yet less saturated alternative to the `outdoor` style, with hillshading, 3D buildings and fairly high street details\n */\n TOPOGRAPHIQUE: MapStyleVariant;\n };\n\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n VOYAGER: ReferenceMapStyle & {\n /**\n * A nice alternative to `streets` with a soft color palette\n */\n DEFAULT: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in very dark mode\n */\n DARK: MapStyleVariant;\n /**\n * A nice alternative to `streets`, in light mode\n */\n LIGHT: MapStyleVariant;\n /**\n * A nice alternative to `streets` with a soft sepia color palette and vintage look\n */\n VINTAGE: MapStyleVariant;\n };\n\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n TONER: ReferenceMapStyle & {\n /**\n * A bold very high contrast black and white (no gray!) style for the city\n */\n DEFAULT: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, without any label\n */\n BACKGROUND: MapStyleVariant;\n /**\n * A bold very high contrast, yet faded, style for the city\n */\n LITE: MapStyleVariant;\n /**\n * A bold very high contrast black and white (no gray!) style for the city, with no building, only roads!\n */\n LINES: MapStyleVariant;\n };\n\n /**\n * Minimalist style, perfect for data visualization\n */\n DATAVIZ: ReferenceMapStyle & {\n /**\n * Minimalist style, perfect for data visualization\n */\n DEFAULT: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in dark mode\n */\n DARK: MapStyleVariant;\n\n /**\n * Minimalist style, perfect for data visualization in light mode\n */\n LIGHT: MapStyleVariant;\n };\n\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n OCEAN: ReferenceMapStyle & {\n /**\n * Explore deep see trenches and mountains, with isolines and depth labels\n */\n DEFAULT: MapStyleVariant;\n };\n};\n\nexport const mapStylePresetList: Array = [\n {\n referenceStyleID: \"STREETS\",\n name: \"Streets\",\n description: \"\",\n variants: [\n {\n id: \"streets-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-night\",\n name: \"Night\",\n variantType: \"NIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"streets-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OUTDOOR\",\n name: \"Outdoor\",\n description: \"\",\n variants: [\n {\n id: \"outdoor-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"outdoor-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"WINTER\",\n name: \"Winter\",\n description: \"\",\n variants: [\n {\n id: \"winter-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"winter-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"SATELLITE\",\n name: \"Satellite\",\n description: \"\",\n variants: [\n {\n id: \"satellite\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"HYBRID\",\n name: \"Hybrid\",\n description: \"\",\n variants: [\n {\n id: \"hybrid\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BASIC\",\n name: \"Basic\",\n description: \"\",\n variants: [\n {\n id: \"basic-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"basic-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"BRIGHT\",\n name: \"Bright\",\n description: \"\",\n variants: [\n {\n id: \"bright-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"bright-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OPENSTREETMAP\",\n name: \"OpenStreetMap\",\n description: \"\",\n variants: [\n {\n id: \"openstreetmap\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TOPO\",\n name: \"Topo\",\n description: \"\",\n variants: [\n {\n id: \"topo-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-shiny\",\n name: \"Shiny\",\n variantType: \"SHINY\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-pastel\",\n name: \"Pastel\",\n variantType: \"PASTEL\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"topo-v2-topographique\",\n name: \"Topographique\",\n variantType: \"TOPOGRAPHIQUE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"VOYAGER\",\n name: \"Voyager\",\n description: \"\",\n variants: [\n {\n id: \"voyager-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-darkmatter\",\n name: \"Darkmatter\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-positron\",\n name: \"Positron\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"voyager-v2-vintage\",\n name: \"Vintage\",\n variantType: \"VINTAGE\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"TONER\",\n name: \"Toner\",\n description: \"\",\n variants: [\n {\n id: \"toner-v2\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-background\",\n name: \"Background\",\n variantType: \"BACKGROUND\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lite\",\n name: \"Lite\",\n variantType: \"LITE\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"toner-v2-lines\",\n name: \"Lines\",\n variantType: \"LINES\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"DATAVIZ\",\n name: \"Dataviz\",\n description: \"\",\n variants: [\n {\n id: \"dataviz\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-dark\",\n name: \"Dark\",\n variantType: \"DARK\",\n description: \"\",\n imageURL: \"\",\n },\n {\n id: \"dataviz-light\",\n name: \"Light\",\n variantType: \"LIGHT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n\n {\n referenceStyleID: \"OCEAN\",\n name: \"Ocean\",\n description: \"\",\n variants: [\n {\n id: \"ocean\",\n name: \"Default\",\n variantType: \"DEFAULT\",\n description: \"\",\n imageURL: \"\",\n },\n ],\n },\n];\n\nfunction makeReferenceStyleProxy(referenceStyle: ReferenceMapStyle) {\n return new Proxy(referenceStyle, {\n get(target, prop, receiver) {\n if (target.hasVariant(prop as string)) {\n return target.getVariant(prop as string);\n }\n\n // This variant does not exist for this style, but since it's full uppercase\n // we guess that the dev tries to access a style variant. So instead of\n // returning the default (STREETS.DEFAULT), we return the non-variant of the current style\n if (prop.toString().toUpperCase() === (prop as string)) {\n return referenceStyle.getDefaultVariant();\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\nfunction buildMapStyles(): MapStyleType {\n const mapStyle = {};\n\n for (let i = 0; i < mapStylePresetList.length; i += 1) {\n const refStyleInfo = mapStylePresetList[i];\n\n const refStyle = makeReferenceStyleProxy(\n new ReferenceMapStyle(refStyleInfo.name, refStyleInfo.referenceStyleID)\n );\n\n for (let j = 0; j < refStyleInfo.variants.length; j += 1) {\n const variantInfo = refStyleInfo.variants[j];\n const variant = new MapStyleVariant(\n variantInfo.name, // name\n variantInfo.variantType, // variantType\n variantInfo.id, // id\n refStyle, // referenceStyle\n variantInfo.description,\n variantInfo.imageURL // imageURL\n );\n\n refStyle.addVariant(variant);\n }\n mapStyle[refStyleInfo.referenceStyleID] = refStyle;\n }\n return mapStyle as MapStyleType;\n}\n\nexport function styleToStyle(\n style: string | ReferenceMapStyle | MapStyleVariant | null | undefined\n): string {\n if (!style) {\n return MapStyle[mapStylePresetList[0].referenceStyleID]\n .getDefaultVariant()\n .getId();\n }\n\n // If the provided style is a shorthand (eg. \"streets-v2\") then we make sure it's trimmed and lowercase\n if (typeof style === \"string\" || style instanceof String) {\n return style.trim().toLowerCase();\n }\n\n if (style instanceof MapStyleVariant) {\n return style.getId();\n }\n\n if (style instanceof ReferenceMapStyle) {\n return style.getDefaultVariant().getId();\n }\n}\n\n/**\n * Contains all the reference map style created by MapTiler team as well as all the variants.\n * For example, `MapStyle.STREETS` and the variants:\n * - `MapStyle.STREETS.DARK`\n * - `MapStyle.STREETS.LIGHT`\n * - `MapStyle.STREETS.PASTEL`\n *\n */\nexport const MapStyle: MapStyleType = buildMapStyles();\n","/**\\\n * This code is borrowed from https://github.com/mourner/simplify-js and reworked a little.\n */\n\nimport { Position } from \"geojson\";\n\n// square distance from a point to a segment\nfunction getSqSegDist(p: Position, p1: Position, p2: Position): number {\n let x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n\nfunction simplifyDPStep(\n points: Array,\n first: number,\n last: number,\n sqTolerance: number,\n simplified: Array\n) {\n let maxSqDist = sqTolerance,\n index;\n\n for (let i = first + 1; i < last; i++) {\n const sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) {\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n }\n simplified.push(points[index]);\n\n if (last - index > 1) {\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(\n points: Array,\n sqTolerance: number\n): Array {\n const last = points.length - 1;\n const simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nexport default function simplify(\n points: Array,\n tolerance: number\n): Array {\n if (points.length <= 2) {\n return points;\n }\n\n const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n const simplePoints = simplifyDouglasPeucker(points, sqTolerance);\n return simplePoints;\n}\n","import { BBox, Position } from \"geojson\";\nimport { config } from \"../config\";\nimport { defaults } from \"../defaults\";\nimport { MapStyleVariant, ReferenceMapStyle, styleToStyle } from \"../mapstyle\";\nimport simplify from \"./simplify\";\n\n/**\n * Base set of options that can be provided to all the types of static maps\n */\nexport type StaticMapBaseOptions = {\n /**\n * Custom MapTiler Cloud API key to use instead of the one in global `config`\n */\n apiKey?: string;\n\n /**\n * Style of the map (not full style URL). Example: \"winter\", \"streets-v2\".\n * Default: `\"streets-v2\"`\n */\n style?: string | ReferenceMapStyle | MapStyleVariant;\n\n /**\n * Double the size of the static map image to support hiDPI/Retina monitors.\n * Default: `false`\n */\n hiDPI?: boolean;\n\n /**\n * Image format.\n * Default: `\"png\"`\n */\n format?: \"png\" | \"jpg\" | \"webp\";\n\n /**\n * Width of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n width?: number;\n\n /**\n * Height of the output image. Maximum value: `2048`.\n * Default: `1024`\n */\n height?: number;\n\n /**\n * Placement of the attribution. Can also be set to `false` to not show attribution.\n * Default: `\"bottomright\"`\n */\n attribution?: \"bottomright\" | \"bottomleft\" | \"topleft\" | \"topright\" | false;\n\n /**\n * A marker or list of markers to show on the map\n * Default: none provided\n */\n markers?: StaticMapMarker | Array;\n\n /**\n * URL of the marker image. Applies only if one or multiple markers positions are provided.\n * Default: none provided\n */\n markerIcon?: string;\n\n /**\n * Position of the marker regarding its coordinates. Applies only:\n * - with a custom icon provided with `markerIcon`\n * - if one or multiple markers positions are provided.\n * Default: `\"bottom\"`\n */\n markerAnchor?:\n | \"top\"\n | \"left\"\n | \"bottom\"\n | \"right\"\n | \"center\"\n | \"topleft\"\n | \"bottomleft\"\n | \"topright\"\n | \"bottomright\";\n\n /**\n * Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.\n * Default: none provided\n */\n path?: Array;\n\n /**\n * Color of the path line. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: `\"blue\"`\n */\n pathStrokeColor?: string;\n\n /**\n * Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.\n * Examples:\n * - long form hex without transparency `\"#FF0000\"` (red)\n * - short form hex without transparency `\"#F00\"` (red)\n * - long form hex with transparency `\"#FF000008\"` (red, half opacity)\n * - short form hex with transparency `\"#F008\"` (red, half opacity)\n * - CSS color shorthands: `\"red\"`, `\"chartreuse\"`, etc.\n * - decimal RGB values without transparency: `\"rgb(128, 100, 255)\"`\n * - decimal RGB values with transparency: `\"rgb(128, 100, 255, 0.5)\"`\n * Default: none (transparent filling)\n */\n pathFillColor?: string;\n\n /**\n * Width of the path line in pixel. It can be floating point precision (ex: `0.5`)\n * Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.\n */\n pathWidth?: number;\n};\n\n/**\n * Options that can be provided to centered static maps\n */\nexport type CenteredStaticMapOptions = StaticMapBaseOptions;\n\n/**\n * Options that can be provided to bounded static maps\n */\nexport type BoundedStaticMapOptions = StaticMapBaseOptions & {\n /**\n * Extra space added around the regio of interest, in percentage.\n * Default: `0.1` (for 10%)\n */\n padding?: number;\n};\n\n/**\n * Options that can be provided to automatic static maps\n */\nexport type AutomaticStaticMapOptions = BoundedStaticMapOptions;\n\n/**\n * Definition of a maker to show on a static map\n */\nexport type StaticMapMarker = [\n /**\n * Longitude of the marker\n */\n number,\n /**\n * latitude of the marker\n */\n number,\n /**\n * Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.\n */\n string\n];\n\nfunction staticMapMarkerToString(\n marker: StaticMapMarker,\n includeColor = true\n): string {\n let str = `${marker[0]},${marker[1]}`;\n\n if (marker.length === 3 && includeColor) {\n str += `,${marker[2]}`;\n }\n\n return str;\n}\n\nfunction simplifyAndStringify(path: Array, maxNbChar = 3000): string {\n let str = path.map((point) => point.join(\",\")).join(\"|\");\n let tolerance = 0.000005;\n const toleranceStep = 0.00001;\n\n while (str.length > maxNbChar) {\n const simplerPath = simplify(path, tolerance);\n // str = simplerPath.map(point => point.join(',')).join('|');\n str = simplerPath.map((point) => `${point[0]},${point[1]}`).join(\"|\");\n tolerance += toleranceStep;\n }\n\n return str;\n}\n\n/**\n * Construct the URL for a static map centered on one point.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param center\n * @param zoom\n * @param options\n * @returns\n */\nfunction centered(\n center: Position,\n zoom: number,\n options: CenteredStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${center[0]},${\n center[1]\n },${zoom}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map using a bounding box\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param boundingBox\n * @param options\n * @returns\n */\nfunction bounded(\n boundingBox: BBox,\n options: BoundedStaticMapOptions = {}\n): string {\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${\n boundingBox[1]\n },${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * Construct the URL for a static map automatically fitted around the provided path or markers.\n * Note: this function does not fetch the binary content of the image since\n * the purpose of a static map is generally to have its URL as a `src` property of a element.\n * If a path is provided and is too long, it will be simplified in an accurate way.\n * @param options\n * @returns\n */\nfunction automatic(options: AutomaticStaticMapOptions = {}): string {\n if (!(\"markers\" in options) && !(\"path\" in options)) {\n throw new Error(\n \"Automatic static maps require markers and/or path to be created.\"\n );\n }\n\n const style = styleToStyle(options.style);\n const scale = options.hiDPI ? \"@2x\" : \"\";\n const format = options.format ?? \"png\";\n let width = ~~(options.width ?? 1024);\n let height = ~~(options.height ?? 1024);\n\n if (options.hiDPI) {\n width = ~~(width / 2);\n height = ~~(height / 2);\n }\n\n const endpoint = new URL(\n `maps/${encodeURIComponent(\n style\n )}/static/auto/${width}x${height}${scale}.${format}`,\n defaults.maptilerApiURL\n );\n\n if (\"attribution\" in options) {\n endpoint.searchParams.set(\"attribution\", options.attribution.toString());\n }\n\n if (\"padding\" in options) {\n endpoint.searchParams.set(\"padding\", options.padding.toString());\n }\n\n if (\"markers\" in options) {\n let markerStr = \"\";\n\n const hasIcon = \"markerIcon\" in options;\n\n if (hasIcon) {\n markerStr += `icon:${options.markerIcon}|`;\n }\n\n if (hasIcon && \"markerAnchor\" in options) {\n markerStr += `anchor:${options.markerAnchor}|`;\n }\n\n if (hasIcon && options.hiDPI) {\n markerStr += `scale:2|`;\n }\n\n const markerList = Array.isArray(options.markers[0])\n ? options.markers\n : [options.markers];\n markerStr += markerList\n .map((m) => staticMapMarkerToString(m, !hasIcon))\n .join(\"|\");\n endpoint.searchParams.set(\"markers\", markerStr);\n }\n\n if (\"path\" in options) {\n let pathStr = \"\";\n\n pathStr += `fill:${options.pathFillColor ?? \"none\"}|`;\n\n if (\"pathStrokeColor\" in options) {\n pathStr += `stroke:${options.pathStrokeColor}|`;\n }\n\n if (\"pathWidth\" in options) {\n const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);\n pathStr += `width:${pathWidth.toString()}|`;\n }\n\n pathStr += simplifyAndStringify(options.path);\n endpoint.searchParams.set(\"path\", pathStr);\n }\n\n endpoint.searchParams.set(\"key\", options.apiKey ?? config.apiKey);\n\n return endpoint.toString();\n}\n\n/**\n * The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).\n * The URL of static maps can then be used within a `` markup element, as the `src` property value.\n */\nconst staticMaps = {\n centered,\n bounded,\n automatic,\n};\n\nexport { staticMaps };\n"],"names":["__async","customMessages"],"mappings":";;;;;;EAEA,SAAS,eAAkB,GAAA;EAEzB,EAAI,IAAA,OAAO,SAAS,WAAa,EAAA;EAC/B,IAAO,OAAA,KAAA,CAAM,KAAK,IAAI,CAAA,CAAA;EAAA,GACxB;EAEA,EAAA,IAAI,OAAO,MAAA,KAAW,WAAe,IAAA,MAAA,CAAO,KAAO,EAAA;EACjD,IAAA,OAAO,MAAO,CAAA,KAAA,CAAA;EAAA,GAChB;EAEA,EAAO,OAAA,IAAA,CAAA;EACT,CAAA;EAKA,MAAM,YAAa,CAAA;EAAA,EAAnB,WAAA,GAAA;EAIE;EAAA;EAAA;EAAA,IAAA,IAAA,CAAQ,OAAU,GAAA,EAAA,CAAA;EAMlB;EAAA;EAAA;EAAA;EAAA,IAAA,IAAA,CAAQ,SAA+B,eAAgB,EAAA,CAAA;EAAA,GAAA;EAAA;EAAA;EAAA;EAAA,EAKvD,IAAI,OAAO,CAAW,EAAA;EACpB,IAAA,IAAA,CAAK,OAAU,GAAA,CAAA,CAAA;EAAA,GACjB;EAAA;EAAA;EAAA;EAAA,EAKA,IAAI,MAAiB,GAAA;EACnB,IAAA,OAAO,IAAK,CAAA,OAAA,CAAA;EAAA,GACd;EAAA;EAAA;EAAA;EAAA,EAKA,IAAI,MAAM,CAAkB,EAAA;EAC1B,IAAA,IAAA,CAAK,MAAS,GAAA,CAAA,CAAA;EAAA,GAChB;EAA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GAAI,CAAA,SAAA,EAAW,SAAS,CAAA,CAAA;EAAA,GAChD;EAEA,EAAA,IAAI,UAAU,OAAS,EAAA;EACrB,IAAA,IAAI,OAAU,GAAA,EAAA,CAAA;EAEd,IAAW,OAAA,IAAA,CAAA,KAAA,EAAA,CAAQ,EAAQ,GAAA,OAAA,CAAA,aAAA,KAAR,IAAyB,GAAA,EAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;EAE5C,IAAA,IAAI,qBAAqB,OAAS,EAAA;EAChC,MAAA,OAAA,IAAW,UAAU,OAAQ,CAAA,eAAA,CAAA,CAAA,CAAA,CAAA;EAAA,KAC/B;EAEA,IAAA,IAAI,eAAe,OAAS,EAAA;EAC1B,MAAA,MAAM,SAAY,GAAA,OAAA,CAAQ,SAAa,IAAA,OAAA,CAAQ,QAAQ,CAAI,GAAA,CAAA,CAAA,CAAA;EAC3D,MAAW,OAAA,IAAA,CAAA,MAAA,EAAS,UAAU,QAAS,EAAA,CAAA,CAAA,CAAA,CAAA;EAAA,KACzC;EAEA,IAAW,OAAA,IAAA,oBAAA,CAAqB,QAAQ,IAAI,CAAA,CAAA;EAC5C,IAAS,QAAA,CAAA,YAAA,CAAa,GAAI,CAAA,MAAA,EAAQ,OAAO,CAAA,CAAA;EAAA,GAC3C;EAEA,EAAA,QAAA,CAAS,aAAa,GAAI,CAAA,KAAA,EAAA,CAAO,aAAQ,MAAR,KAAA,IAAA,GAAA,EAAA,GAAkB,OAAO,MAAM,CAAA,CAAA;EAEhE,EAAA,OAAO,SAAS,QAAS,EAAA,CAAA;EAC3B,CAAA;AAMA,QAAM,UAAa,GAAA;EAAA,EACjB,QAAA;EAAA,EACA,OAAA;EAAA,EACA,SAAA;EACF;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/maptiler-client.umd.min.js b/dist/maptiler-client.umd.min.js index dc0afb9..078b40d 100644 --- a/dist/maptiler-client.umd.min.js +++ b/dist/maptiler-client.umd.min.js @@ -1 +1 @@ -(function(u,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):(u=typeof globalThis<"u"?globalThis:u||self,I(u.maptilerClient={}))})(this,function(u){"use strict";function I(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class C{constructor(){this._apiKey="",this._fetch=I()}set apiKey(t){this._apiKey=t}get apiKey(){return this._apiKey}set fetch(t){this._fetch=t}get fetch(){return this._fetch}}const g=new C,L={AUTO:"auto",ALBANIAN:"sq",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HUNGARIAN:"hu",ICELANDIC:"is",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALTESE:"mt",NORWEGIAN:"no",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},F=new Set(Object.values(L));function x(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const n=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>F.has(t));return n.length?n[0]:L.ENGLISH}var B=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});function S(n){return B(this,arguments,function*(t,e={}){if(g.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(t).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return g.fetch(t,e)})}const y={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(y);class A extends Error{constructor(t,e=""){super(`Call to enpoint ${t.url} failed with the status code ${t.status}. ${e}`),this.res=t}}var U=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const D={400:"Query too long / Invalid parameters",403:"Key is missing, invalid or restricted"};function O(n,t){if(t.language==null)return;const e=Array.from(new Set((Array.isArray(t.language)?t.language:[t.language]).map(r=>r===L.AUTO?x():r))).join(",");n.set("language",e)}function K(n,t){var e;n.set("key",(e=t.apiKey)!=null?e:g.apiKey),t.limit!=null&&n.set("limit",String(t.limit)),t.types!=null&&n.set("types",t.types.join(",")),O(n,t)}function W(n){return U(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const i=new URL(`geocoding/${encodeURIComponent(t)}.json`,y.maptilerApiURL),{searchParams:a}=i;K(a,e),e.bbox!=null&&a.set("bbox",e.bbox.join(",")),e.proximity!=null&&a.set("proximity",e.proximity.join(",")),e.country!=null&&a.set("country",e.country.join(",")),e.fuzzyMatch!=null&&a.set("fuzzyMatch",e.fuzzyMatch?"true":"false"),e.autocomplete!=null&&a.set("autocomplete",e.autocomplete?"true":"false");const s=i.toString(),c=yield S(s);if(!c.ok)throw new A(c,(r=D[c.status])!=null?r:"");return yield c.json()})}function z(n){return U(this,arguments,function*(t,e={}){var r;if(!Array.isArray(t)||t.length<2)throw new Error("The position must be an array of form [lng, lat].");const i=new URL(`geocoding/${t[0]},${t[1]}.json`,y.maptilerApiURL);K(i.searchParams,e);const a=i.toString(),s=yield S(a);if(!s.ok)throw new A(s,(r=D[s.status])!=null?r:"");return yield s.json()})}function _(n){return U(this,arguments,function*(t,e={}){var r;const i=new URL(`geocoding/${t}.json`,y.maptilerApiURL);O(i.searchParams,e);const a=i.toString(),s=yield S(a);if(!s.ok)throw new A(s,(r=D[s.status])!=null?r:"");return yield s.json()})}const q={forward:W,reverse:z,byId:_,language:L};var Y=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const j={403:"Key is missing, invalid or restricted"};function Z(){return Y(this,arguments,function*(n={}){var t;const e=new URL("geolocation/ip.json",y.maptilerApiURL);e.searchParams.set("key",(t=n.apiKey)!=null?t:g.apiKey);const r=e.toString(),i=yield S(r);if(!i.ok)throw new A(i,i.status in j?j[i.status]:"");return yield i.json()})}const J={info:Z};var H=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const R={403:"Key is missing, invalid or restricted"};function Q(n){return H(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const i=new URL(`coordinates/search/${t}.json`,y.maptilerApiURL);i.searchParams.set("key",(r=e.apiKey)!=null?r:g.apiKey),"limit"in e&&i.searchParams.set("limit",e.limit.toString()),"transformations"in e&&i.searchParams.set("transformations",e.transformations.toString()),"exports"in e&&i.searchParams.set("exports",e.exports.toString());const a=i.toString(),s=yield S(a);if(!s.ok)throw new A(s,s.status in R?R[s.status]:"");return yield s.json()})}function X(n){return H(this,arguments,function*(t,e={}){var r;const i=(Array.isArray(t[0])?t:[t]).map(o=>`${o[0]},${o[1]}`).join(";"),a=new URL(`coordinates/transform/${i}.json`,y.maptilerApiURL);a.searchParams.set("key",(r=e.apiKey)!=null?r:g.apiKey),"sourceCrs"in e&&a.searchParams.set("s_srs",e.sourceCrs.toString()),"targetCrs"in e&&a.searchParams.set("t_srs",e.targetCrs.toString()),"operations"in e&&a.searchParams.set("ops",(Array.isArray(e.operations)?e.operations:[e.operations]).join("|"));const s=a.toString(),c=yield S(s);if(!c.ok)throw new A(c,c.status in R?R[c.status]:"");return yield c.json()})}const ee={search:Q,transform:X};var te=(n,t,e)=>new Promise((r,i)=>{var a=o=>{try{c(e.next(o))}catch(l){i(l)}},s=o=>{try{c(e.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const V={403:"Key is missing, invalid or restricted"};function ne(n){return te(this,arguments,function*(t,e={}){var r;if(typeof t!="string"||t.trim().length===0)throw new Error("The data ID must be a non-empty string");const i=new URL(`data/${encodeURIComponent(t)}/features.json`,y.maptilerApiURL);i.searchParams.set("key",(r=e.apiKey)!=null?r:g.apiKey);const a=i.toString(),s=yield S(a);if(!s.ok)throw new A(s,s.status in V?V[s.status]:"");return yield s.json()})}const re={get:ne};function M(n){const t=/^maptiler:\/\/(.*)/;let e;const r=n.trim();let i;return r.startsWith("http://")||r.startsWith("https://")?i=r:(e=t.exec(r))!==null?i=`https://api.maptiler.com/maps/${e[1]}/style.json`:i=`https://api.maptiler.com/maps/${r}/style.json`,i}class k{constructor(t,e,r,i,a,s){this.name=t,this.variantType=e,this.id=r,this.referenceStyle=i,this.description=a,this.imageURL=s}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(t){return this.referenceStyle.hasVariant(t)}getVariant(t){return this.referenceStyle.getVariant(t)}getVariants(){return this.referenceStyle.getVariants().filter(t=>t!==this)}getImageURL(){return this.imageURL}getExpandedStyleURL(){return M(this.getId())}}class E{constructor(t,e){this.name=t,this.id=e,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(t){this.variants[t.getType()]=t,this.orderedVariants.push(t)}hasVariant(t){return t in this.variants}getVariant(t){return t in this.variants?this.variants[t]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0]}}const T=[{referenceStyleID:"STREETS",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"WINTER",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Winter",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"BASIC",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"TOPO",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:""},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]},{referenceStyleID:"VOYAGER",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER",name:"Toner",description:"",variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",description:"",imageURL:""},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:""},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OCEAN",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]}];function ie(n){return new Proxy(n,{get(t,e,r){return t.hasVariant(e)?t.getVariant(e):e.toString().toUpperCase()===e?n.getDefaultVariant():Reflect.get(t,e,r)}})}function ae(){const n={};for(let t=0;t1?(r=e[0],i=e[1]):c>0&&(r+=a*c,i+=s*c)}return a=n[0]-r,s=n[1]-i,a*a+s*s}function $(n,t,e,r,i){let a=r,s;for(let c=t+1;ca&&(s=c,a=o)}a>r&&(s-t>1&&$(n,t,s,r,i),i.push(n[s]),e-s>1&&$(n,s,e,r,i))}function oe(n,t){const e=n.length-1,r=[n[0]];return $(n,0,e,t,r),r.push(n[e]),r}function ce(n,t){if(n.length<=2)return n;const e=t!==void 0?t*t:1;return oe(n,e)}function w(n,t=!0){let e=`${n[0]},${n[1]}`;return n.length===3&&t&&(e+=`,${n[2]}`),e}function N(n,t=3e3){let e=n.map(a=>a.join(",")).join("|"),r=5e-6;const i=1e-5;for(;e.length>t;)e=ce(n,r).map(a=>`${a[0]},${a[1]}`).join("|"),r+=i;return e}function le(n,t,e={}){var r,i,a,s,c;const o=P(e.style),l=e.hiDPI?"@2x":"",v=(r=e.format)!=null?r:"png";let d=~~((i=e.width)!=null?i:1024),m=~~((a=e.height)!=null?a:1024);e.hiDPI&&(d=~~(d/2),m=~~(m/2));const p=new URL(`maps/${encodeURIComponent(o)}/static/${n[0]},${n[1]},${t}/${d}x${m}${l}.${v}`,y.maptilerApiURL);if("attribution"in e&&p.searchParams.set("attribution",e.attribution.toString()),"markers"in e){let h="";const f="markerIcon"in e;f&&(h+=`icon:${e.markerIcon}|`),f&&"markerAnchor"in e&&(h+=`anchor:${e.markerAnchor}|`),f&&e.hiDPI&&(h+="scale:2|");const b=Array.isArray(e.markers[0])?e.markers:[e.markers];h+=b.map(ue=>w(ue,!f)).join("|"),p.searchParams.set("markers",h)}if("path"in e){let h="";if(h+=`fill:${(s=e.pathFillColor)!=null?s:"none"}|`,"pathStrokeColor"in e&&(h+=`stroke:${e.pathStrokeColor}|`),"pathWidth"in e){const f=e.pathWidth/(e.hiDPI?2:1);h+=`width:${f.toString()}|`}h+=N(e.path),p.searchParams.set("path",h)}return p.searchParams.set("key",(c=e.apiKey)!=null?c:g.apiKey),p.toString()}function pe(n,t={}){var e,r,i,a,s;const c=P(t.style),o=t.hiDPI?"@2x":"",l=(e=t.format)!=null?e:"png";let v=~~((r=t.width)!=null?r:1024),d=~~((i=t.height)!=null?i:1024);t.hiDPI&&(v=~~(v/2),d=~~(d/2));const m=new URL(`maps/${encodeURIComponent(c)}/static/${n[0]},${n[1]},${n[2]},${n[3]}/${v}x${d}${o}.${l}`,y.maptilerApiURL);if("attribution"in t&&m.searchParams.set("attribution",t.attribution.toString()),"padding"in t&&m.searchParams.set("padding",t.padding.toString()),"markers"in t){let p="";const h="markerIcon"in t;h&&(p+=`icon:${t.markerIcon}|`),h&&"markerAnchor"in t&&(p+=`anchor:${t.markerAnchor}|`),h&&t.hiDPI&&(p+="scale:2|");const f=Array.isArray(t.markers[0])?t.markers:[t.markers];p+=f.map(b=>w(b,!h)).join("|"),m.searchParams.set("markers",p)}if("path"in t){let p="";if(p+=`fill:${(a=t.pathFillColor)!=null?a:"none"}|`,"pathStrokeColor"in t&&(p+=`stroke:${t.pathStrokeColor}|`),"pathWidth"in t){const h=t.pathWidth/(t.hiDPI?2:1);p+=`width:${h.toString()}|`}p+=N(t.path),m.searchParams.set("path",p)}return m.searchParams.set("key",(s=t.apiKey)!=null?s:g.apiKey),m.toString()}function me(n={}){var t,e,r,i,a;if(!("markers"in n)&&!("path"in n))throw new Error("Automatic static maps require markers and/or path to be created.");const s=P(n.style),c=n.hiDPI?"@2x":"",o=(t=n.format)!=null?t:"png";let l=~~((e=n.width)!=null?e:1024),v=~~((r=n.height)!=null?r:1024);n.hiDPI&&(l=~~(l/2),v=~~(v/2));const d=new URL(`maps/${encodeURIComponent(s)}/static/auto/${l}x${v}${c}.${o}`,y.maptilerApiURL);if("attribution"in n&&d.searchParams.set("attribution",n.attribution.toString()),"padding"in n&&d.searchParams.set("padding",n.padding.toString()),"markers"in n){let m="";const p="markerIcon"in n;p&&(m+=`icon:${n.markerIcon}|`),p&&"markerAnchor"in n&&(m+=`anchor:${n.markerAnchor}|`),p&&n.hiDPI&&(m+="scale:2|");const h=Array.isArray(n.markers[0])?n.markers:[n.markers];m+=h.map(f=>w(f,!p)).join("|"),d.searchParams.set("markers",m)}if("path"in n){let m="";if(m+=`fill:${(i=n.pathFillColor)!=null?i:"none"}|`,"pathStrokeColor"in n&&(m+=`stroke:${n.pathStrokeColor}|`),"pathWidth"in n){const p=n.pathWidth/(n.hiDPI?2:1);m+=`width:${p.toString()}|`}m+=N(n.path),d.searchParams.set("path",m)}return d.searchParams.set("key",(a=n.apiKey)!=null?a:g.apiKey),d.toString()}const he={centered:le,bounded:pe,automatic:me};u.ClientConfig=C,u.LanguageGeocoding=L,u.MapStyle=G,u.MapStyleVariant=k,u.ReferenceMapStyle=E,u.ServiceError=A,u.config=g,u.coordinates=ee,u.data=re,u.expandMapStyle=M,u.geocoding=q,u.geolocation=J,u.mapStylePresetList=T,u.staticMaps=he,Object.defineProperty(u,"__esModule",{value:!0})}); +(function(u,R){typeof exports=="object"&&typeof module<"u"?R(exports):typeof define=="function"&&define.amd?define(["exports"],R):(u=typeof globalThis<"u"?globalThis:u||self,R(u.maptilerClient={}))})(this,function(u){"use strict";function R(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class C{constructor(){this._apiKey="",this._fetch=R()}set apiKey(t){this._apiKey=t}get apiKey(){return this._apiKey}set fetch(t){this._fetch=t}get fetch(){return this._fetch}}const g=new C,L={AUTO:"auto",ALBANIAN:"sq",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HUNGARIAN:"hu",ICELANDIC:"is",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALTESE:"mt",NORWEGIAN:"no",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},F=new Set(Object.values(L));function x(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const n=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>F.has(t));return n.length?n[0]:L.ENGLISH}var B=(n,t,e)=>new Promise((i,r)=>{var a=o=>{try{c(e.next(o))}catch(l){r(l)}},s=o=>{try{c(e.throw(o))}catch(l){r(l)}},c=o=>o.done?i(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});function S(n){return B(this,arguments,function*(t,e={}){if(g.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(t).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return g.fetch(t,e)})}const y={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(y);class A extends Error{constructor(t,e=""){super(`Call to enpoint ${t.url} failed with the status code ${t.status}. ${e}`),this.res=t}}var U=(n,t,e)=>new Promise((i,r)=>{var a=o=>{try{c(e.next(o))}catch(l){r(l)}},s=o=>{try{c(e.throw(o))}catch(l){r(l)}},c=o=>o.done?i(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const D={400:"Query too long / Invalid parameters",403:"Key is missing, invalid or restricted"};function K(n,t){if(t.language==null)return;const e=Array.from(new Set((Array.isArray(t.language)?t.language:[t.language]).map(i=>i===L.AUTO?x():i))).join(",");n.set("language",e)}function O(n,t){var e;n.set("key",(e=t.apiKey)!=null?e:g.apiKey),t.limit!=null&&n.set("limit",String(t.limit)),t.types!=null&&n.set("types",t.types.join(",")),K(n,t)}function W(n){return U(this,arguments,function*(t,e={}){var i;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const r=new URL(`geocoding/${encodeURIComponent(t)}.json`,y.maptilerApiURL),{searchParams:a}=r;O(a,e),e.bbox!=null&&a.set("bbox",e.bbox.join(",")),e.proximity!=null&&a.set("proximity",e.proximity.join(",")),e.country!=null&&a.set("country",e.country.join(",")),e.fuzzyMatch!=null&&a.set("fuzzyMatch",e.fuzzyMatch?"true":"false"),e.autocomplete!=null&&a.set("autocomplete",e.autocomplete?"true":"false");const s=r.toString(),c=yield S(s);if(!c.ok)throw new A(c,(i=D[c.status])!=null?i:"");return yield c.json()})}function z(n){return U(this,arguments,function*(t,e={}){var i;if(!Array.isArray(t)||t.length<2)throw new Error("The position must be an array of form [lng, lat].");const r=new URL(`geocoding/${t[0]},${t[1]}.json`,y.maptilerApiURL);O(r.searchParams,e);const a=r.toString(),s=yield S(a);if(!s.ok)throw new A(s,(i=D[s.status])!=null?i:"");return yield s.json()})}function _(n){return U(this,arguments,function*(t,e={}){var i;const r=new URL(`geocoding/${t}.json`,y.maptilerApiURL);K(r.searchParams,e);const a=r.toString(),s=yield S(a);if(!s.ok)throw new A(s,(i=D[s.status])!=null?i:"");return yield s.json()})}const q={forward:W,reverse:z,byId:_,language:L};var Y=(n,t,e)=>new Promise((i,r)=>{var a=o=>{try{c(e.next(o))}catch(l){r(l)}},s=o=>{try{c(e.throw(o))}catch(l){r(l)}},c=o=>o.done?i(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const j={403:"Key is missing, invalid or restricted"};function Z(){return Y(this,arguments,function*(n={}){var t;const e=new URL("geolocation/ip.json",y.maptilerApiURL);e.searchParams.set("key",(t=n.apiKey)!=null?t:g.apiKey);const i=e.toString(),r=yield S(i);if(!r.ok)throw new A(r,r.status in j?j[r.status]:"");return yield r.json()})}const J={info:Z};var H=(n,t,e)=>new Promise((i,r)=>{var a=o=>{try{c(e.next(o))}catch(l){r(l)}},s=o=>{try{c(e.throw(o))}catch(l){r(l)}},c=o=>o.done?i(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const I={403:"Key is missing, invalid or restricted"};function Q(n){return H(this,arguments,function*(t,e={}){var i;if(typeof t!="string"||t.trim().length===0)throw new Error("The query must be a non-empty string");const r=new URL(`coordinates/search/${t}.json`,y.maptilerApiURL);r.searchParams.set("key",(i=e.apiKey)!=null?i:g.apiKey),"limit"in e&&r.searchParams.set("limit",e.limit.toString()),"transformations"in e&&r.searchParams.set("transformations",e.transformations.toString()),"exports"in e&&r.searchParams.set("exports",e.exports.toString());const a=r.toString(),s=yield S(a);if(!s.ok)throw new A(s,s.status in I?I[s.status]:"");return yield s.json()})}function X(n){return H(this,arguments,function*(t,e={}){var i;const r=(Array.isArray(t[0])?t:[t]).map(o=>`${o[0]},${o[1]}`).join(";"),a=new URL(`coordinates/transform/${r}.json`,y.maptilerApiURL);a.searchParams.set("key",(i=e.apiKey)!=null?i:g.apiKey),"sourceCrs"in e&&a.searchParams.set("s_srs",e.sourceCrs.toString()),"targetCrs"in e&&a.searchParams.set("t_srs",e.targetCrs.toString()),"operations"in e&&a.searchParams.set("ops",(Array.isArray(e.operations)?e.operations:[e.operations]).join("|"));const s=a.toString(),c=yield S(s);if(!c.ok)throw new A(c,c.status in I?I[c.status]:"");return yield c.json()})}const ee={search:Q,transform:X};var te=(n,t,e)=>new Promise((i,r)=>{var a=o=>{try{c(e.next(o))}catch(l){r(l)}},s=o=>{try{c(e.throw(o))}catch(l){r(l)}},c=o=>o.done?i(o.value):Promise.resolve(o.value).then(a,s);c((e=e.apply(n,t)).next())});const V={403:"Key is missing, invalid or restricted"};function ne(n){return te(this,arguments,function*(t,e={}){var i;if(typeof t!="string"||t.trim().length===0)throw new Error("The data ID must be a non-empty string");const r=new URL(`data/${encodeURIComponent(t)}/features.json`,y.maptilerApiURL);r.searchParams.set("key",(i=e.apiKey)!=null?i:g.apiKey);const a=r.toString(),s=yield S(a);if(!s.ok)throw new A(s,s.status in V?V[s.status]:"");return yield s.json()})}const ie={get:ne};function G(n){const t=/^maptiler:\/\/(.*)/;let e;const i=n.trim();let r;return i.startsWith("http://")||i.startsWith("https://")?r=i:(e=t.exec(i))!==null?r=`https://api.maptiler.com/maps/${e[1]}/style.json`:r=`https://api.maptiler.com/maps/${i}/style.json`,r}class k{constructor(t,e,i,r,a,s){this.name=t,this.variantType=e,this.id=i,this.referenceStyle=r,this.description=a,this.imageURL=s}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(t){return this.referenceStyle.hasVariant(t)}getVariant(t){return this.referenceStyle.getVariant(t)}getVariants(){return this.referenceStyle.getVariants().filter(t=>t!==this)}getImageURL(){return this.imageURL}getExpandedStyleURL(){return G(this.getId())}}class E{constructor(t,e){this.name=t,this.id=e,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(t){this.variants[t.getType()]=t,this.orderedVariants.push(t)}hasVariant(t){return t in this.variants}getVariant(t){return t in this.variants?this.variants[t]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0]}}const T=[{referenceStyleID:"STREETS",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"streets-v2-night",name:"Night",variantType:"NIGHT",description:"",imageURL:""},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"outdoor-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"WINTER",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"BASIC",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"TOPO",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:""},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]},{referenceStyleID:"VOYAGER",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER",name:"Toner",description:"",variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",description:"",imageURL:""},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:""},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OCEAN",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]}];function re(n){return new Proxy(n,{get(t,e,i){return t.hasVariant(e)?t.getVariant(e):e.toString().toUpperCase()===e?n.getDefaultVariant():Reflect.get(t,e,i)}})}function ae(){const n={};for(let t=0;t1?(i=e[0],r=e[1]):c>0&&(i+=a*c,r+=s*c)}return a=n[0]-i,s=n[1]-r,a*a+s*s}function $(n,t,e,i,r){let a=i,s;for(let c=t+1;ca&&(s=c,a=o)}a>i&&(s-t>1&&$(n,t,s,i,r),r.push(n[s]),e-s>1&&$(n,s,e,i,r))}function oe(n,t){const e=n.length-1,i=[n[0]];return $(n,0,e,t,i),i.push(n[e]),i}function ce(n,t){if(n.length<=2)return n;const e=t!==void 0?t*t:1;return oe(n,e)}function w(n,t=!0){let e=`${n[0]},${n[1]}`;return n.length===3&&t&&(e+=`,${n[2]}`),e}function N(n,t=3e3){let e=n.map(a=>a.join(",")).join("|"),i=5e-6;const r=1e-5;for(;e.length>t;)e=ce(n,i).map(a=>`${a[0]},${a[1]}`).join("|"),i+=r;return e}function le(n,t,e={}){var i,r,a,s,c;const o=P(e.style),l=e.hiDPI?"@2x":"",v=(i=e.format)!=null?i:"png";let d=~~((r=e.width)!=null?r:1024),m=~~((a=e.height)!=null?a:1024);e.hiDPI&&(d=~~(d/2),m=~~(m/2));const p=new URL(`maps/${encodeURIComponent(o)}/static/${n[0]},${n[1]},${t}/${d}x${m}${l}.${v}`,y.maptilerApiURL);if("attribution"in e&&p.searchParams.set("attribution",e.attribution.toString()),"markers"in e){let h="";const f="markerIcon"in e;f&&(h+=`icon:${e.markerIcon}|`),f&&"markerAnchor"in e&&(h+=`anchor:${e.markerAnchor}|`),f&&e.hiDPI&&(h+="scale:2|");const b=Array.isArray(e.markers[0])?e.markers:[e.markers];h+=b.map(ue=>w(ue,!f)).join("|"),p.searchParams.set("markers",h)}if("path"in e){let h="";if(h+=`fill:${(s=e.pathFillColor)!=null?s:"none"}|`,"pathStrokeColor"in e&&(h+=`stroke:${e.pathStrokeColor}|`),"pathWidth"in e){const f=e.pathWidth/(e.hiDPI?2:1);h+=`width:${f.toString()}|`}h+=N(e.path),p.searchParams.set("path",h)}return p.searchParams.set("key",(c=e.apiKey)!=null?c:g.apiKey),p.toString()}function pe(n,t={}){var e,i,r,a,s;const c=P(t.style),o=t.hiDPI?"@2x":"",l=(e=t.format)!=null?e:"png";let v=~~((i=t.width)!=null?i:1024),d=~~((r=t.height)!=null?r:1024);t.hiDPI&&(v=~~(v/2),d=~~(d/2));const m=new URL(`maps/${encodeURIComponent(c)}/static/${n[0]},${n[1]},${n[2]},${n[3]}/${v}x${d}${o}.${l}`,y.maptilerApiURL);if("attribution"in t&&m.searchParams.set("attribution",t.attribution.toString()),"padding"in t&&m.searchParams.set("padding",t.padding.toString()),"markers"in t){let p="";const h="markerIcon"in t;h&&(p+=`icon:${t.markerIcon}|`),h&&"markerAnchor"in t&&(p+=`anchor:${t.markerAnchor}|`),h&&t.hiDPI&&(p+="scale:2|");const f=Array.isArray(t.markers[0])?t.markers:[t.markers];p+=f.map(b=>w(b,!h)).join("|"),m.searchParams.set("markers",p)}if("path"in t){let p="";if(p+=`fill:${(a=t.pathFillColor)!=null?a:"none"}|`,"pathStrokeColor"in t&&(p+=`stroke:${t.pathStrokeColor}|`),"pathWidth"in t){const h=t.pathWidth/(t.hiDPI?2:1);p+=`width:${h.toString()}|`}p+=N(t.path),m.searchParams.set("path",p)}return m.searchParams.set("key",(s=t.apiKey)!=null?s:g.apiKey),m.toString()}function me(n={}){var t,e,i,r,a;if(!("markers"in n)&&!("path"in n))throw new Error("Automatic static maps require markers and/or path to be created.");const s=P(n.style),c=n.hiDPI?"@2x":"",o=(t=n.format)!=null?t:"png";let l=~~((e=n.width)!=null?e:1024),v=~~((i=n.height)!=null?i:1024);n.hiDPI&&(l=~~(l/2),v=~~(v/2));const d=new URL(`maps/${encodeURIComponent(s)}/static/auto/${l}x${v}${c}.${o}`,y.maptilerApiURL);if("attribution"in n&&d.searchParams.set("attribution",n.attribution.toString()),"padding"in n&&d.searchParams.set("padding",n.padding.toString()),"markers"in n){let m="";const p="markerIcon"in n;p&&(m+=`icon:${n.markerIcon}|`),p&&"markerAnchor"in n&&(m+=`anchor:${n.markerAnchor}|`),p&&n.hiDPI&&(m+="scale:2|");const h=Array.isArray(n.markers[0])?n.markers:[n.markers];m+=h.map(f=>w(f,!p)).join("|"),d.searchParams.set("markers",m)}if("path"in n){let m="";if(m+=`fill:${(r=n.pathFillColor)!=null?r:"none"}|`,"pathStrokeColor"in n&&(m+=`stroke:${n.pathStrokeColor}|`),"pathWidth"in n){const p=n.pathWidth/(n.hiDPI?2:1);m+=`width:${p.toString()}|`}m+=N(n.path),d.searchParams.set("path",m)}return d.searchParams.set("key",(a=n.apiKey)!=null?a:g.apiKey),d.toString()}const he={centered:le,bounded:pe,automatic:me};u.ClientConfig=C,u.LanguageGeocoding=L,u.MapStyle=M,u.MapStyleVariant=k,u.ReferenceMapStyle=E,u.ServiceError=A,u.config=g,u.coordinates=ee,u.data=ie,u.expandMapStyle=G,u.geocoding=q,u.geolocation=J,u.mapStylePresetList=T,u.staticMaps=he,Object.defineProperty(u,"__esModule",{value:!0})}); diff --git a/docs/classes/config.ClientConfig.html b/docs/classes/config.ClientConfig.html index 6a8713c..e09b6a0 100644 --- a/docs/classes/config.ClientConfig.html +++ b/docs/classes/config.ClientConfig.html @@ -1,4 +1,4 @@ -ClientConfig | MapTiler Client - v1.2.0
+ClientConfig | MapTiler Client - v1.3.0
  • Preparing search index...
  • -
  • The search index is not available
MapTiler Client - v1.2.0
+
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -24,7 +24,7 @@

    Hierarchy

    • ClientConfig
    +
  • Defined in config.ts:19
  • @@ -58,7 +58,7 @@

    Returns void

    +
  • Defined in config.ts:34
  • set fetch(f: FetchFunction): void
  • Set a the custom fetch function to replace the default one

    @@ -92,7 +92,7 @@

    Parameters

    f: FetchFunction
  • Returns void

    +
  • Defined in config.ts:48
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -26,7 +26,7 @@

    Hierarchy

    • ServiceError
    +
  • Defined in services/ServiceError.ts:4
  • @@ -57,14 +57,14 @@
    customMessage: stringReturns ServiceError
    +
  • Defined in services/ServiceError.ts:5
  • Properties

    res: Response
    +
  • Defined in services/ServiceError.ts:5
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -22,7 +22,7 @@

    Function getAutoLanguageGeocoding

  • Returns LanguageGeocodingString

  • +
  • Defined in language.ts:71
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -29,7 +29,7 @@
    points: Positionnumber

    Returns Position[]

    +
  • Defined in services/simplify.ts:76
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    -

    MapTiler Client - v1.2.0

    +

    MapTiler Client - v1.3.0

    offcial page →
    @@ -318,7 +318,7 @@

    Theme

    @@ -6,12 +6,12 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    -

    MapTiler Client - v1.2.0

    +

    MapTiler Client - v1.3.0

    Index

    @@ -43,7 +43,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in config.ts:1
  • @@ -50,7 +50,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in language.ts:4
  • @@ -50,7 +50,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/ServiceError.ts:4
  • @@ -42,7 +42,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/coordinates.ts:1
  • @@ -55,7 +55,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/data.ts:1
  • @@ -46,7 +46,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/geocoding.ts:1
  • @@ -54,7 +54,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/geolocation.ts:1
  • @@ -47,7 +47,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/simplify.ts:5
  • @@ -42,7 +42,7 @@

    Theme

    @@ -6,17 +6,17 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    +
  • Defined in services/staticMaps.ts:1
  • @@ -50,7 +50,7 @@

    Theme

    @@ -6,13 +6,13 @@
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -33,7 +33,7 @@
    url: string
    options: object

    Returns Promise<any>

    +
  • Defined in config.ts:1
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -20,7 +20,7 @@

    Type alias LanguageGeocodingString

    Built-in languages values as strings

    +
  • Defined in language.ts:69
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -25,7 +25,7 @@
    proj4:
    wkt: string
    +
  • Defined in services/coordinates.ts:38
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -23,7 +23,7 @@

    Type declaration

  • path: string
  • +
  • Defined in services/coordinates.ts:43
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -25,7 +25,7 @@
    authority:
    code: BigInteger
    +
  • Defined in services/coordinates.ts:33
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -47,7 +47,7 @@
    Optional transformations
    Optional unit?: string
    +
  • Defined in services/coordinates.ts:61
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -29,7 +29,7 @@
    total:

    The number of results

    +
  • Defined in services/coordinates.ts:91
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -30,7 +30,7 @@
    transformer_selection_strategy
    +
  • Defined in services/coordinates.ts:159
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -43,7 +43,7 @@
    Optional unit
    usable: boolean
    +
  • Defined in services/coordinates.ts:47
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -37,7 +37,7 @@
    Optional transformations

    Show detailed transformations for each CRS (default: false)

    +
  • Defined in services/coordinates.ts:11
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -39,7 +39,7 @@
    Optional targetCrs

    Target coordinate reference system (default: 4326)

    +
  • Defined in services/coordinates.ts:174
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -27,7 +27,7 @@
    Optional y
    Optional z?: number
    +
  • Defined in services/coordinates.ts:153
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -27,7 +27,7 @@
    Optional apiKey

    Custom MapTiler Cloud API key to use instead of the one in global config

    +
  • Defined in services/data.ts:14
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    CommonForwardAndReverseGeocodingOptions: LanguageGeocodingOptions & {
        apiKey?: string;
        limit?: number;
        types?: ("country" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address")[];
    }
    +
  • Defined in services/geocoding.ts:25
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -29,7 +29,7 @@
    text:

    Localized feature name

    +
  • Defined in services/geocoding.ts:91
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    GeocodingFeature: Feature & {
        address?: string;
        bbox: BBox;
        center: Coordinates;
        context?: FeatureHierarchy[];
        place_name: string;
        text: string;
    }
    +
  • Defined in services/geocoding.ts:103
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    GeocodingOptions: CommonForwardAndReverseGeocodingOptions & {
        autocomplete?: boolean;
        bbox?: BBox;
        country?: string[];
        fuzzyMatch?: boolean;
        proximity?: Position;
    }
    +
  • Defined in services/geocoding.ts:57
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -35,7 +35,7 @@
    query:
    type: "FeatureCollection"
    +
  • Defined in services/geocoding.ts:135
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -25,7 +25,7 @@
    Optional language

    Prefer results in specific language. It’s possible to specify multiple values.

    +
  • Defined in services/geocoding.ts:18
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -27,7 +27,7 @@
    Optional apiKey

    Custom MapTiler Cloud API key to use instead of the one in global config

    +
  • Defined in services/geolocation.ts:14
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -90,7 +90,7 @@
    Optional timezone
    +
  • Defined in services/geolocation.ts:21
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -20,7 +20,7 @@

    Type alias AutomaticStaticMapOptions

    Options that can be provided to automatic static maps

    +
  • Defined in services/staticMaps.ts:141
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -20,7 +20,7 @@

    Type alias BoundedStaticMapOptions

    Options that can be provided to bounded static maps

    +
  • Defined in services/staticMaps.ts:130
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -20,7 +20,7 @@

    Type alias CenteredStaticMapOptions

    Options that can be provided to centered static maps

    +
  • Defined in services/staticMaps.ts:125
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -116,7 +116,7 @@
    Optional width
    +
  • Defined in services/staticMaps.ts:10
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -20,7 +20,7 @@

    Type alias StaticMapMarker

    Definition of a maker to show on a static map

    +
  • Defined in services/staticMaps.ts:146
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -20,7 +20,7 @@

    Variable configConst

    Configuration object

    +
  • Defined in config.ts:63
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -133,7 +133,7 @@
    UKRAINIAN:
    WELSH: string
    +
  • Defined in language.ts:4
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -64,7 +64,7 @@
    positions: PositionCoordinatesTransformOptions = {}

    Returns Promise<CoordinateTransformResult>

    +
  • Defined in services/coordinates.ts:253
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -43,7 +43,7 @@
    dataId: string
    options: GetDataOptions = {}

    Returns Promise<FeatureCollection>

    +
  • Defined in services/data.ts:59
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -200,7 +200,7 @@
    position: Position
    options: CommonForwardAndReverseGeocodingOptions = {}

    Returns Promise<GeocodingSearchResult>

    +
  • Defined in services/geocoding.ts:323
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -41,7 +41,7 @@

    Parameters

    options: GeolocationInfoOptions = {}

    Returns Promise<GeolocationResult>

    +
  • Defined in services/geolocation.ts:135
    • Preparing search index...
    • -
    • The search index is not available
    MapTiler Client - v1.2.0 +
  • The search index is not available
  • MapTiler Client - v1.3.0
    @@ -87,7 +87,7 @@
    zoom: number
    options: StaticMapBaseOptions = {}

    Returns string

    +
  • Defined in services/staticMaps.ts:457