@maptiler/geocoding-control 2.1.0-with-autocomplete-timeout → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/leaflet-controller.js +1942 -1523
  2. package/leaflet-controller.js.map +1 -1
  3. package/leaflet-controller.umd.js +1 -22
  4. package/leaflet-controller.umd.js.map +1 -1
  5. package/leaflet.js +2798 -2385
  6. package/leaflet.js.map +1 -1
  7. package/leaflet.umd.js +1 -22
  8. package/leaflet.umd.js.map +1 -1
  9. package/maplibregl-controller.js +1918 -1498
  10. package/maplibregl-controller.js.map +1 -1
  11. package/maplibregl-controller.umd.js +1 -22
  12. package/maplibregl-controller.umd.js.map +1 -1
  13. package/maplibregl.js +2892 -2478
  14. package/maplibregl.js.map +1 -1
  15. package/maplibregl.umd.js +1 -22
  16. package/maplibregl.umd.js.map +1 -1
  17. package/maptilersdk.js +2898 -2482
  18. package/maptilersdk.js.map +1 -1
  19. package/maptilersdk.umd.js +1 -22
  20. package/maptilersdk.umd.js.map +1 -1
  21. package/openlayers-controller.js +1686 -1264
  22. package/openlayers-controller.js.map +1 -1
  23. package/openlayers-controller.umd.js +1 -22
  24. package/openlayers-controller.umd.js.map +1 -1
  25. package/openlayers.js +2778 -2365
  26. package/openlayers.js.map +1 -1
  27. package/openlayers.umd.js +1 -22
  28. package/openlayers.umd.js.map +1 -1
  29. package/package.json +19 -19
  30. package/react.js +753 -756
  31. package/react.js.map +1 -1
  32. package/react.umd.js +1 -1
  33. package/react.umd.js.map +1 -1
  34. package/{MapLibreBasedGeocodingControl.d.ts → src/MapLibreBasedGeocodingControl.d.ts} +35 -69
  35. package/{maplibregl.d.ts → src/maplibregl.d.ts} +34 -68
  36. package/{maptilersdk.d.ts → src/maptilersdk.d.ts} +34 -68
  37. package/src/types.d.ts +391 -0
  38. package/svelte/GeocodingControl.svelte +71 -58
  39. package/svelte/GeocodingControl.svelte.d.ts +5 -3
  40. package/svelte/MapLibreBasedGeocodingControl.d.ts +35 -69
  41. package/svelte/maplibregl.d.ts +34 -68
  42. package/svelte/maptilersdk.d.ts +34 -68
  43. package/svelte/maptilersdk.js +2 -0
  44. package/svelte/react.js +3 -0
  45. package/svelte/types.d.ts +175 -128
  46. package/vanilla.js +847 -853
  47. package/vanilla.js.map +1 -1
  48. package/vanilla.umd.js +1 -1
  49. package/vanilla.umd.js.map +1 -1
  50. package/types.d.ts +0 -344
  51. /package/{geo-coordinates-parser.t.d.ts → src/geo-coordinates-parser.t.d.ts} +0 -0
  52. /package/{geoUtils.d.ts → src/geoUtils.d.ts} +0 -0
  53. /package/{leaflet-controller.d.ts → src/leaflet-controller.d.ts} +0 -0
  54. /package/{leaflet.d.ts → src/leaflet.d.ts} +0 -0
  55. /package/{maplibregl-controller.d.ts → src/maplibregl-controller.d.ts} +0 -0
  56. /package/{mask.d.ts → src/mask.d.ts} +0 -0
  57. /package/{openlayers-controller.d.ts → src/openlayers-controller.d.ts} +0 -0
  58. /package/{openlayers.d.ts → src/openlayers.d.ts} +0 -0
  59. /package/{proximity.d.ts → src/proximity.d.ts} +0 -0
  60. /package/{react.d.ts → src/react.d.ts} +0 -0
  61. /package/{vanilla.d.ts → src/vanilla.d.ts} +0 -0
package/types.d.ts DELETED
@@ -1,344 +0,0 @@
1
- import type { Feature as FeatureType, Geometry } from "geojson";
2
- export type BBox = [minx: number, miny: number, maxx: number, maxy: number];
3
- export type Position = [x: number, y: number];
4
- export type Feature<T extends Geometry = Geometry> = FeatureType<T> & {
5
- id: string;
6
- text: string;
7
- place_name: string;
8
- place_type: string[];
9
- center: Position;
10
- bbox: BBox;
11
- address?: string;
12
- matching_text?: string;
13
- };
14
- export type FeatureCollection<T extends Geometry = Geometry> = {
15
- type: "FeatureCollection";
16
- features: Feature<T>[];
17
- };
18
- export type MapEvent = {
19
- type: "mapClick";
20
- coordinates: Position;
21
- } | {
22
- type: "markerClick";
23
- id: string;
24
- } | {
25
- type: "markerMouseEnter";
26
- id: string;
27
- } | {
28
- type: "markerMouseLeave";
29
- id: string;
30
- };
31
- export type MapController = {
32
- setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
33
- flyTo(center: Position, zoom?: number): void;
34
- fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
35
- indicateReverse(reverse: boolean): void;
36
- setFeatures(features: Feature[] | undefined, picked: Feature | undefined, showPolygonMarker: boolean): void;
37
- setReverseMarker(coordinates?: Position): void;
38
- setSelectedMarker(index: number): void;
39
- getCenterAndZoom(): [zoom: number, lon: number, lat: number] | undefined;
40
- };
41
- export type ProximityRule = {
42
- /** minimal map zoom for the rule to be used */
43
- minZoom?: number;
44
- /** maximal map zoom for the rule to be used */
45
- maxZoom?: number;
46
- } & ({
47
- /** fixed proximity */
48
- type: "fixed";
49
- /** coordinates of the fixed proximity */
50
- coordinates: Position;
51
- } | {
52
- /** use map center coordinates for the proximity */
53
- type: "map-center";
54
- } | {
55
- /** resolve proximity by geolocating IP of the geocoding API call */
56
- type: "server-geolocation";
57
- } | ({
58
- /** use browser's geolocation API for proximity. If it fails, following proximity rules are iterated. */
59
- type: "client-geolocation";
60
- /** how long should the geolocation result be cached, in milliseconds */
61
- cachedLocationExpiry?: number;
62
- } & PositionOptions));
63
- export type ControlOptions = {
64
- /**
65
- * Maptiler API key
66
- */
67
- apiKey: string;
68
- /**
69
- * Sets the amount of time, in milliseconds, to wait before querying the server when a user types into the Geocoder input box.
70
- * This parameter may be useful for reducing the total number of API calls made for a single query.
71
- *
72
- * Default value is `200`.
73
- */
74
- debounceSearch?: number;
75
- /**
76
- * Search results closer to the proximity point will be given higher priority. First matching rule from the array will be used.
77
- * Set to `null` to disable the proximity.
78
- *
79
- * Default value is `[{ type: "server-geolocation" }]`.
80
- */
81
- proximity?: ProximityRule[] | null;
82
- /**
83
- * Override the default placeholder attribute value.
84
- *
85
- * Default value is `"Search"`.
86
- */
87
- placeholder?: string;
88
- /**
89
- * Override the default error message.
90
- *
91
- * Default value is `"Something went wrong…"`.
92
- */
93
- errorMessage?: string;
94
- /**
95
- * Override the default message if no results are found.
96
- *
97
- * Default value is `"Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"`.
98
- */
99
- noResultsMessage?: string;
100
- /**
101
- * Minimum number of characters to enter before results are shown.
102
- *
103
- * Default value is `2`.
104
- */
105
- minLength?: number;
106
- /**
107
- * A bounding box argument: this is a bounding box given as an array in the format [minX, minY, maxX, maxY].
108
- * Search results will be limited to the bounding box.
109
- *
110
- * Default value is `undefined`.
111
- */
112
- bbox?: BBox;
113
- /**
114
- * Maximum number of results to show.
115
- *
116
- * Default value is `5`.
117
- */
118
- limit?: number;
119
- /**
120
- * Specify the language to use for response text and query result weighting.
121
- * Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script.
122
- * More than one value can also be specified, separated by commas.
123
- * Set to `null` or empty string for disabling language-specific searching.
124
- *
125
- * Default value is `undefined` which means to use the browser's language settings.
126
- */
127
- language?: string | string[] | null;
128
- /**
129
- * If `false`, indicates that search will only occur on enter key press.
130
- * If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.
131
- *
132
- * Default value is `false`.
133
- */
134
- showResultsWhileTyping?: boolean;
135
- autocompleteTimeout?: number;
136
- /**
137
- * Set to `false` to disable fuzzy search.
138
- *
139
- * Default value is `true`.
140
- */
141
- fuzzyMatch?: boolean;
142
- /**
143
- * On geocoded result what zoom level should the map animate to when a bbox in the response isn't present or is a point.
144
- * If a bbox is present and not a point then the map will fit to the bbox.
145
- *
146
- * Value is key-value pairs, where key is a &lt;type&gt; or &lt;type&gt;.&lt;categoy&gt; and the value is the zoom level.
147
- *
148
- * Default value is `GeocodingControl.ZOOM_DEFAULTS`.
149
- */
150
- zoom?: Record<string, number>;
151
- /**
152
- * If `true`, the geocoder control will collapse until hovered or in focus.
153
- *
154
- * Default value is `false`.
155
- */
156
- collapsed?: boolean;
157
- /**
158
- * If `true`, the geocoder control will clear its value when the input blurs.
159
- *
160
- * Default value is `false`.
161
- */
162
- clearOnBlur?: boolean;
163
- /**
164
- * If `true`, then after picking a result from the list or map the list will be cleared and not re-displayed on input box focus.
165
- *
166
- * Default value is `false`.
167
- */
168
- clearListOnPick?: boolean;
169
- /**
170
- * Keep the list open even if the control is not focused.
171
- *
172
- * Default value is `false`.
173
- */
174
- keepListOpen?: boolean;
175
- /**
176
- * A function which accepts a Feature in the Carmen GeoJSON format to filter out results from the Geocoding API response before they are included in the suggestions list.
177
- * Return true to keep the item, false otherwise.
178
- *
179
- * Default value is a function returning always `true`.
180
- */
181
- filter?: (feature: Feature) => boolean;
182
- /**
183
- * Class of the root element.
184
- *
185
- * Default value is `undefined`.
186
- */
187
- class?: string;
188
- /**
189
- * Set to `button` to enable reverse geocoding button with title. Set to `"always"` to reverse geocoding be always active.
190
- *
191
- * Default value is `"never"`.
192
- */
193
- enableReverse?: EnableReverse;
194
- /**
195
- * Reverse mode active.
196
- *
197
- * Default value is `false`.
198
- */
199
- reverseActive?: boolean;
200
- /**
201
- * Title of the reverse toggle button.
202
- *
203
- * Default value is `"toggle reverse geocoding"`.
204
- */
205
- reverseButtonTitle?: string;
206
- /**
207
- * Title of the clear button.
208
- *
209
- * Default value is `"clear"`.
210
- */
211
- clearButtonTitle?: string;
212
- /**
213
- * Set to `"never"` to hide place/POI type. If set to `"always"` then type is shown for all items.
214
- * If set to `"if-needed"` then type is shown only for places/POIs not determined from the icon.
215
- *
216
- * Default value is `"if-needed"`.
217
- */
218
- showPlaceType?: ShowPlaceType;
219
- /**
220
- * Style of the picked result on the map:
221
- *
222
- * - `"marker-only"` - show only marker at the center of the feature
223
- * - `"full-geometry"` - show full feature geometry of the chosen result
224
- * - `"full-geometry-including-polygon-center-marker"` - show full feature geometry of the chosen result together with a marker in the center of polygon feature
225
- *
226
- * Default value is `true`.
227
- */
228
- pickedResultStyle?: PickedResultStyle;
229
- /**
230
- * Limit search to specified country(ies).
231
- *
232
- * Default value is `undefined` - use all countries.
233
- */
234
- country?: string | string[];
235
- /**
236
- * Filter of feature types to return.
237
- *
238
- * Default value is `undefined` - all available feature types are returned.
239
- */
240
- types?: string[];
241
- /**
242
- * Use `limit` value for reverse geocoding even if `types` is not an array with a single element.
243
- * Will work only if enabled on the server.
244
- *
245
- * Default value is `false`.
246
- */
247
- exhaustiveReverseGeocoding?: boolean;
248
- /**
249
- * If set to `true` then use all types except for those listed in `types`.
250
- *
251
- * Default value is `false`.
252
- */
253
- excludeTypes?: boolean;
254
- /**
255
- * Geocoding API URL.
256
- *
257
- * Default value is MapTiler Geocoding API URL.
258
- */
259
- apiUrl?: string;
260
- /**
261
- * Extra fetch parameters.
262
- *
263
- * Default value is `undefined`.
264
- */
265
- fetchParameters?: RequestInit;
266
- /**
267
- * Base URL for POI icons.
268
- *
269
- * Default value is `"icons/"` for Svelte apps, otherwise `"https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/icons/"`.
270
- */
271
- iconsBaseUrl?: string;
272
- /**
273
- * Function to adjust URL search parameters.
274
- *
275
- * Default value is empty function.
276
- *
277
- * @deprecated use `adjustUrl`
278
- */
279
- adjustUrlQuery?: (sp: URLSearchParams) => void;
280
- /**
281
- * Function to adjust geocoding URL before the fetch.
282
- *
283
- * @param url [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) parameter which can be modified
284
- *
285
- * Default value is empty function.
286
- */
287
- adjustUrl?: (url: URL) => void;
288
- /**
289
- * Automatically select the first feature from the result list.
290
- *
291
- * Default value is `true`.
292
- */
293
- selectFirst?: boolean;
294
- /**
295
- * Fly to selected feature from the result list.
296
- *
297
- * Default value is `false`.
298
- */
299
- flyToSelected?: boolean;
300
- /**
301
- * Show marker on the selected feature from the result list.
302
- *
303
- * Default value is `true`.
304
- */
305
- markerOnSelected?: boolean;
306
- };
307
- export type PickedResultStyle = "marker-only" | "full-geometry" | "full-geometry-including-polygon-center-marker";
308
- export type EnableReverse = "never" | "always" | "button";
309
- export type ShowPlaceType = "never" | "always" | "if-needed";
310
- export type DispatcherTypeCC = {
311
- featuresListed: {
312
- features: Feature[] | undefined;
313
- };
314
- featuresMarked: {
315
- features: Feature[] | undefined;
316
- };
317
- optionsVisibilityChange: {
318
- optionsVisible: boolean;
319
- };
320
- pick: {
321
- feature: Feature | undefined;
322
- };
323
- queryChange: {
324
- query: string;
325
- };
326
- response: {
327
- url: string;
328
- featureCollection: FeatureCollection;
329
- };
330
- reverseToggle: {
331
- reverse: boolean;
332
- };
333
- select: {
334
- feature: Feature | undefined;
335
- };
336
- };
337
- export type DispatcherType = {
338
- [T in keyof DispatcherTypeCC as Lowercase<T>]: DispatcherTypeCC[T];
339
- };
340
- export type RedefineType<OriginalType, UpdatedType extends {
341
- [K in keyof OriginalType]: OriginalType[K];
342
- } & {
343
- [K in Exclude<keyof UpdatedType, keyof OriginalType>]: never;
344
- }> = UpdatedType;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes