@maptiler/geocoding-control 2.1.0-rc1 → 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.
- package/leaflet-controller.js +1942 -1523
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +1 -22
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +2800 -2368
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -22
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.js +1918 -1498
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +1 -22
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +2858 -2425
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -22
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2863 -2428
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -22
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.js +1686 -1264
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +1 -22
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +2785 -2353
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +1 -22
- package/openlayers.umd.js.map +1 -1
- package/package.json +19 -19
- package/react.js +800 -784
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/{MapLibreBasedGeocodingControl.d.ts → src/MapLibreBasedGeocodingControl.d.ts} +35 -69
- package/{maplibregl.d.ts → src/maplibregl.d.ts} +34 -68
- package/{maptilersdk.d.ts → src/maptilersdk.d.ts} +34 -68
- package/src/types.d.ts +391 -0
- package/svelte/GeocodingControl.svelte +55 -14
- package/svelte/GeocodingControl.svelte.d.ts +5 -2
- package/svelte/MapLibreBasedGeocodingControl.d.ts +35 -69
- package/svelte/maplibregl.d.ts +34 -68
- package/svelte/maptilersdk.d.ts +34 -68
- package/svelte/maptilersdk.js +2 -0
- package/svelte/react.js +3 -0
- package/svelte/types.d.ts +175 -127
- package/vanilla.js +870 -857
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/types.d.ts +0 -343
- /package/{geo-coordinates-parser.t.d.ts → src/geo-coordinates-parser.t.d.ts} +0 -0
- /package/{geoUtils.d.ts → src/geoUtils.d.ts} +0 -0
- /package/{leaflet-controller.d.ts → src/leaflet-controller.d.ts} +0 -0
- /package/{leaflet.d.ts → src/leaflet.d.ts} +0 -0
- /package/{maplibregl-controller.d.ts → src/maplibregl-controller.d.ts} +0 -0
- /package/{mask.d.ts → src/mask.d.ts} +0 -0
- /package/{openlayers-controller.d.ts → src/openlayers-controller.d.ts} +0 -0
- /package/{openlayers.d.ts → src/openlayers.d.ts} +0 -0
- /package/{proximity.d.ts → src/proximity.d.ts} +0 -0
- /package/{react.d.ts → src/react.d.ts} +0 -0
- /package/{vanilla.d.ts → src/vanilla.d.ts} +0 -0
package/svelte/types.d.ts
CHANGED
|
@@ -62,246 +62,289 @@ export type ProximityRule = {
|
|
|
62
62
|
} & PositionOptions));
|
|
63
63
|
export type ControlOptions = {
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Callback function to adjust URL search parameters.
|
|
66
|
+
*
|
|
67
|
+
* Default: Empty function.
|
|
68
|
+
*
|
|
69
|
+
* @deprecated Use `adjustUrl` instead.
|
|
66
70
|
*/
|
|
67
|
-
|
|
71
|
+
adjustUrlQuery?: (sp: URLSearchParams) => void;
|
|
68
72
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
73
|
+
* Callback function to adjust the geocoding URL before fetching.
|
|
74
|
+
*
|
|
75
|
+
* @param url [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) parameter that can be modified.
|
|
71
76
|
*
|
|
72
|
-
* Default
|
|
77
|
+
* Default: Empty function.
|
|
73
78
|
*/
|
|
74
|
-
|
|
79
|
+
adjustUrl?: (url: URL) => void;
|
|
75
80
|
/**
|
|
76
|
-
*
|
|
77
|
-
* Set to `null` to disable the proximity.
|
|
78
|
-
*
|
|
79
|
-
* Default value is `[{ type: "server-geolocation" }]`.
|
|
81
|
+
* MapTiler API key.
|
|
80
82
|
*/
|
|
81
|
-
|
|
83
|
+
apiKey: string;
|
|
82
84
|
/**
|
|
83
|
-
*
|
|
85
|
+
* Geocoding API URL.
|
|
84
86
|
*
|
|
85
|
-
* Default
|
|
87
|
+
* Default: MapTiler Geocoding API URL.
|
|
86
88
|
*/
|
|
87
|
-
|
|
89
|
+
apiUrl?: string;
|
|
88
90
|
/**
|
|
89
|
-
*
|
|
91
|
+
* Bounding box in the format `[minX, minY, maxX, maxY]` to limit search results.
|
|
90
92
|
*
|
|
91
|
-
* Default
|
|
93
|
+
* Default: `undefined`.
|
|
92
94
|
*/
|
|
93
|
-
|
|
95
|
+
bbox?: BBox;
|
|
94
96
|
/**
|
|
95
|
-
*
|
|
97
|
+
* CSS class for the root element.
|
|
96
98
|
*
|
|
97
|
-
* Default
|
|
99
|
+
* Default: `undefined`.
|
|
98
100
|
*/
|
|
99
|
-
|
|
101
|
+
class?: string;
|
|
100
102
|
/**
|
|
101
|
-
*
|
|
103
|
+
* Title of the clear button.
|
|
102
104
|
*
|
|
103
|
-
* Default
|
|
105
|
+
* Default: `"clear"`.
|
|
104
106
|
*/
|
|
105
|
-
|
|
107
|
+
clearButtonTitle?: string;
|
|
106
108
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
+
* Clears the result list after picking an item.
|
|
110
|
+
* Prevents redisplaying the list when the input box is focused.
|
|
109
111
|
*
|
|
110
|
-
* Default
|
|
112
|
+
* Default: `false`.
|
|
111
113
|
*/
|
|
112
|
-
|
|
114
|
+
clearListOnPick?: boolean;
|
|
113
115
|
/**
|
|
114
|
-
*
|
|
116
|
+
* Clears the input value when it loses focus.
|
|
115
117
|
*
|
|
116
|
-
* Default
|
|
118
|
+
* Default: `false`.
|
|
117
119
|
*/
|
|
118
|
-
|
|
120
|
+
clearOnBlur?: boolean;
|
|
119
121
|
/**
|
|
120
|
-
*
|
|
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.
|
|
122
|
+
* Collapses the geocoder control until hovered or focused.
|
|
124
123
|
*
|
|
125
|
-
* Default
|
|
124
|
+
* Default: `false`.
|
|
126
125
|
*/
|
|
127
|
-
|
|
126
|
+
collapsed?: boolean;
|
|
128
127
|
/**
|
|
129
|
-
*
|
|
130
|
-
* If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.
|
|
128
|
+
* Limits search to the specified country or countries.
|
|
131
129
|
*
|
|
132
|
-
* Default
|
|
130
|
+
* Default: `undefined` (all countries).
|
|
133
131
|
*/
|
|
134
|
-
|
|
132
|
+
country?: string | string[];
|
|
135
133
|
/**
|
|
136
|
-
*
|
|
134
|
+
* Time delay (in milliseconds) before querying the server after typing in the input box.
|
|
135
|
+
* Useful for reducing the number of API calls.
|
|
137
136
|
*
|
|
138
|
-
* Default
|
|
137
|
+
* Default: `200`.
|
|
139
138
|
*/
|
|
140
|
-
|
|
139
|
+
debounceSearch?: number;
|
|
141
140
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
141
|
+
* Enables reverse geocoding:
|
|
142
|
+
* - `"button"`: Enables reverse geocoding button.
|
|
143
|
+
* - `"always"`: Reverse geocoding is always active.
|
|
144
144
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* Default value is `GeocodingControl.ZOOM_DEFAULTS`.
|
|
145
|
+
* Default: `"never"`.
|
|
148
146
|
*/
|
|
149
|
-
|
|
147
|
+
enableReverse?: EnableReverse;
|
|
150
148
|
/**
|
|
151
|
-
*
|
|
149
|
+
* Custom error message.
|
|
152
150
|
*
|
|
153
|
-
* Default
|
|
151
|
+
* Default: `"Something went wrong…"`.
|
|
154
152
|
*/
|
|
155
|
-
|
|
153
|
+
errorMessage?: string;
|
|
156
154
|
/**
|
|
157
|
-
*
|
|
155
|
+
* Includes all available types except those listed in the `types` option.
|
|
156
|
+
*
|
|
157
|
+
* See `reverseGeocodingExcludeTypes` for reverse geocoding exclusion.
|
|
158
158
|
*
|
|
159
|
-
* Default
|
|
159
|
+
* Default: `false`.
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
excludeTypes?: boolean;
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
163
|
+
* Uses the `limit` option value for reverse geocoding even if the `types` option has multiple elements.
|
|
164
|
+
* Works only if enabled on the server.
|
|
164
165
|
*
|
|
165
|
-
* Default
|
|
166
|
+
* Default: `false`.
|
|
166
167
|
*/
|
|
167
|
-
|
|
168
|
+
exhaustiveReverseGeocoding?: boolean;
|
|
168
169
|
/**
|
|
169
|
-
*
|
|
170
|
+
* Additional parameters for fetch requests.
|
|
170
171
|
*
|
|
171
|
-
* Default
|
|
172
|
+
* Default: `undefined`.
|
|
172
173
|
*/
|
|
173
|
-
|
|
174
|
+
fetchParameters?: RequestInit;
|
|
174
175
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
176
|
+
* Callback function to filter results from the Geocoding API response.
|
|
177
|
+
* The function should return `true` to keep an item, or `false` to exclude it.
|
|
177
178
|
*
|
|
178
|
-
* Default
|
|
179
|
+
* Default: A function that always returns `true`.
|
|
179
180
|
*/
|
|
180
181
|
filter?: (feature: Feature) => boolean;
|
|
181
182
|
/**
|
|
182
|
-
*
|
|
183
|
+
* Animates the map to the selected feature from the result list.
|
|
183
184
|
*
|
|
184
|
-
* Default
|
|
185
|
+
* Default: `false`.
|
|
185
186
|
*/
|
|
186
|
-
|
|
187
|
+
flyToSelected?: boolean;
|
|
187
188
|
/**
|
|
188
|
-
*
|
|
189
|
+
* Enables fuzzy search.
|
|
189
190
|
*
|
|
190
|
-
* Default
|
|
191
|
+
* Default: `true`.
|
|
191
192
|
*/
|
|
192
|
-
|
|
193
|
+
fuzzyMatch?: boolean;
|
|
193
194
|
/**
|
|
194
|
-
*
|
|
195
|
+
* Base URL for POI icons.
|
|
195
196
|
*
|
|
196
|
-
* Default
|
|
197
|
+
* Default:
|
|
198
|
+
* - `"icons/"` for Svelte apps.
|
|
199
|
+
* - `"https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/icons/"` for others.
|
|
197
200
|
*/
|
|
198
|
-
|
|
201
|
+
iconsBaseUrl?: string;
|
|
199
202
|
/**
|
|
200
|
-
*
|
|
203
|
+
* Keeps the result list open even if the control is unfocused.
|
|
201
204
|
*
|
|
202
|
-
* Default
|
|
205
|
+
* Default: `false`.
|
|
203
206
|
*/
|
|
204
|
-
|
|
207
|
+
keepListOpen?: boolean;
|
|
205
208
|
/**
|
|
206
|
-
*
|
|
209
|
+
* Language for response text and query weighting.
|
|
210
|
+
* Accepts IETF language tags.
|
|
211
|
+
* Set to `null` or an empty string to disable language-specific searching.
|
|
207
212
|
*
|
|
208
|
-
* Default
|
|
213
|
+
* Default: `undefined` (uses the browser's language settings).
|
|
209
214
|
*/
|
|
210
|
-
|
|
215
|
+
language?: string | string[] | null;
|
|
211
216
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
217
|
+
* Maximum number of results to display.
|
|
218
|
+
*
|
|
219
|
+
* See `reverseGeocodingLimit` for reverse geocoding limits.
|
|
214
220
|
*
|
|
215
|
-
* Default
|
|
221
|
+
* Default: `5`.
|
|
216
222
|
*/
|
|
217
|
-
|
|
223
|
+
limit?: number;
|
|
218
224
|
/**
|
|
219
|
-
*
|
|
225
|
+
* Displays a marker on the selected feature from the result list.
|
|
220
226
|
*
|
|
221
|
-
*
|
|
222
|
-
|
|
223
|
-
|
|
227
|
+
* Default: `true`.
|
|
228
|
+
*/
|
|
229
|
+
markerOnSelected?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Minimum number of characters required to start a search.
|
|
224
232
|
*
|
|
225
|
-
* Default
|
|
233
|
+
* Default: `2`.
|
|
226
234
|
*/
|
|
227
|
-
|
|
235
|
+
minLength?: number;
|
|
228
236
|
/**
|
|
229
|
-
*
|
|
237
|
+
* Custom message for when no results are found.
|
|
230
238
|
*
|
|
231
|
-
* Default
|
|
239
|
+
* Default:
|
|
240
|
+
* ```
|
|
241
|
+
* "Oops! Looks like you're trying to predict something that's not quite right.
|
|
242
|
+
* We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term.
|
|
243
|
+
* Keep on typing - we'll do our best to get you where you need to go!"
|
|
244
|
+
* ```
|
|
232
245
|
*/
|
|
233
|
-
|
|
246
|
+
noResultsMessage?: string;
|
|
234
247
|
/**
|
|
235
|
-
*
|
|
248
|
+
* Style of the picked result on the map:
|
|
249
|
+
* - `"marker-only"`: Show only a marker at the center of the feature.
|
|
250
|
+
* - `"full-geometry"`: Display the full feature geometry.
|
|
251
|
+
* - `"full-geometry-including-polygon-center-marker"`: Display full geometry with a marker at the polygon center.
|
|
236
252
|
*
|
|
237
|
-
* Default
|
|
253
|
+
* Default: `"full-geometry"`.
|
|
238
254
|
*/
|
|
239
|
-
|
|
255
|
+
pickedResultStyle?: PickedResultStyle;
|
|
240
256
|
/**
|
|
241
|
-
*
|
|
242
|
-
* Will work only if enabled on the server.
|
|
257
|
+
* Custom placeholder for the input box.
|
|
243
258
|
*
|
|
244
|
-
* Default
|
|
259
|
+
* Default: `"Search"`.
|
|
245
260
|
*/
|
|
246
|
-
|
|
261
|
+
placeholder?: string;
|
|
247
262
|
/**
|
|
248
|
-
*
|
|
263
|
+
* Prioritizes search results closer to a proximity point.
|
|
264
|
+
* The first matching rule in the array is used.
|
|
265
|
+
* Set to `null` to disable proximity.
|
|
249
266
|
*
|
|
250
|
-
* Default
|
|
267
|
+
* Default: `[ { type: "server-geolocation" } ]`.
|
|
251
268
|
*/
|
|
252
|
-
|
|
269
|
+
proximity?: ProximityRule[] | null;
|
|
253
270
|
/**
|
|
254
|
-
*
|
|
271
|
+
* Activates reverse geocoding.
|
|
255
272
|
*
|
|
256
|
-
* Default
|
|
273
|
+
* Default: `false`.
|
|
257
274
|
*/
|
|
258
|
-
|
|
275
|
+
reverseActive?: boolean;
|
|
259
276
|
/**
|
|
260
|
-
*
|
|
277
|
+
* Title of the reverse geocoding toggle button.
|
|
261
278
|
*
|
|
262
|
-
* Default
|
|
279
|
+
* Default: `"toggle reverse geocoding"`.
|
|
263
280
|
*/
|
|
264
|
-
|
|
281
|
+
reverseButtonTitle?: string;
|
|
265
282
|
/**
|
|
266
|
-
*
|
|
283
|
+
* Excludes types for reverse geocoding.
|
|
267
284
|
*
|
|
268
|
-
* Default
|
|
285
|
+
* Default: Same as `excludeTypes`.
|
|
269
286
|
*/
|
|
270
|
-
|
|
287
|
+
reverseGeocodingExcludeTypes?: boolean;
|
|
271
288
|
/**
|
|
272
|
-
*
|
|
289
|
+
* Limits results for reverse geocoding.
|
|
290
|
+
* Applied only if value is 1 or effective types contain a single value.
|
|
273
291
|
*
|
|
274
|
-
*
|
|
292
|
+
* See also `reverseGeocodingTypes` option.
|
|
275
293
|
*
|
|
276
|
-
*
|
|
294
|
+
* Default: The value of the `limit` option if set. If effective types contain a single value, the default is `1`. In all other cases, this option is not used.
|
|
277
295
|
*/
|
|
278
|
-
|
|
296
|
+
reverseGeocodingLimit?: number;
|
|
279
297
|
/**
|
|
280
|
-
*
|
|
298
|
+
* Specifies types for reverse geocoding.
|
|
299
|
+
*
|
|
300
|
+
* If effective types are multiple values, the `limit`/`reverseGeocodingLimit` option is ignored.
|
|
281
301
|
*
|
|
282
|
-
*
|
|
302
|
+
* See also `reverseGeocodingLimit` option.
|
|
283
303
|
*
|
|
284
|
-
* Default
|
|
304
|
+
* Default: Same as `types`.
|
|
285
305
|
*/
|
|
286
|
-
|
|
306
|
+
reverseGeocodingTypes?: TypeRule[];
|
|
287
307
|
/**
|
|
288
|
-
* Automatically
|
|
308
|
+
* Automatically selects the first feature in the result list.
|
|
289
309
|
*
|
|
290
|
-
* Default
|
|
310
|
+
* Default: `true`.
|
|
291
311
|
*/
|
|
292
312
|
selectFirst?: boolean;
|
|
293
313
|
/**
|
|
294
|
-
*
|
|
314
|
+
* Indicates when to show place/POI types in the dropdown:
|
|
315
|
+
* - `"never"`: Hide the type.
|
|
316
|
+
* - `"always"`: Always show the type.
|
|
317
|
+
* - `"if-needed"`: Show the type only if it cannot be determined from the icon.
|
|
295
318
|
*
|
|
296
|
-
* Default
|
|
319
|
+
* Default: `"if-needed"`.
|
|
297
320
|
*/
|
|
298
|
-
|
|
321
|
+
showPlaceType?: ShowPlaceType;
|
|
299
322
|
/**
|
|
300
|
-
*
|
|
323
|
+
* Displays results while typing:
|
|
324
|
+
* - `false`: Search occurs only on pressing the Enter key.
|
|
325
|
+
* - `true`: Search begins when the input meets the `minLength` requirement.
|
|
301
326
|
*
|
|
302
|
-
* Default
|
|
327
|
+
* Default: `false`.
|
|
303
328
|
*/
|
|
304
|
-
|
|
329
|
+
showResultsWhileTyping?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Types to query, either as an array or `[minZoom, maxZoom, type]` format.
|
|
332
|
+
* `minZoom` is inclusive, `maxZoom` is exclusive, and either can be `null` or `undefined` for unbounded values.
|
|
333
|
+
*
|
|
334
|
+
* See `reverseGeocodingTypes` option for reverse geocoding types.
|
|
335
|
+
*
|
|
336
|
+
* Default: `undefined` (uses server default feature types).
|
|
337
|
+
*/
|
|
338
|
+
types?: TypeRule[];
|
|
339
|
+
/**
|
|
340
|
+
* Specifies the zoom level to animate the map to for a geocoded result when no bounding box is present or when the result is a point.
|
|
341
|
+
* If a bounding box is present and not a point, the map will fit to the bounding box.
|
|
342
|
+
*
|
|
343
|
+
* Values are key-value pairs where the key is a `<type>` or `<type>.<category>` and the value is the zoom level.
|
|
344
|
+
*
|
|
345
|
+
* Default: `GeocodingControl.ZOOM_DEFAULTS`.
|
|
346
|
+
*/
|
|
347
|
+
zoom?: Record<string, number>;
|
|
305
348
|
};
|
|
306
349
|
export type PickedResultStyle = "marker-only" | "full-geometry" | "full-geometry-including-polygon-center-marker";
|
|
307
350
|
export type EnableReverse = "never" | "always" | "button";
|
|
@@ -341,3 +384,8 @@ export type RedefineType<OriginalType, UpdatedType extends {
|
|
|
341
384
|
} & {
|
|
342
385
|
[K in Exclude<keyof UpdatedType, keyof OriginalType>]: never;
|
|
343
386
|
}> = UpdatedType;
|
|
387
|
+
export type TypeRule = string | [
|
|
388
|
+
minZoom: number | null | undefined,
|
|
389
|
+
maxZoom: number | null | undefined,
|
|
390
|
+
type: string
|
|
391
|
+
];
|