@maptiler/geocoding-control 0.0.44 → 0.0.52
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/README.md +18 -4
- package/dist/index.d.ts +0 -0
- package/dist/leaflet.js +3927 -3891
- package/dist/leaflet.umd.js +4 -24
- package/dist/lib/types.d.ts +44 -3
- package/dist/maplibregl.js +4002 -3968
- package/dist/maplibregl.umd.js +4 -24
- package/dist/style.css +1 -1
- package/package.json +15 -13
- package/src/lib/GeocodingControl.svelte +108 -43
- package/src/lib/MarkerIcon.svelte +25 -14
- package/src/lib/leafletMapController.ts +108 -51
- package/src/lib/maplibreglMapController.ts +104 -42
- package/src/lib/types.ts +41 -29
package/dist/lib/types.d.ts
CHANGED
|
@@ -6,18 +6,35 @@ export type Feature = GeoJSON.Feature & {
|
|
|
6
6
|
center: [number, number];
|
|
7
7
|
bbox: [number, number, number, number];
|
|
8
8
|
address?: string;
|
|
9
|
+
matching_text?: string;
|
|
9
10
|
};
|
|
10
11
|
export type FeatureCollection = {
|
|
11
12
|
type: "FeatureCollection";
|
|
12
13
|
features: Feature[];
|
|
13
14
|
};
|
|
15
|
+
export type MapEvent = {
|
|
16
|
+
type: "proximityChange";
|
|
17
|
+
proximity: [number, number] | undefined;
|
|
18
|
+
} | {
|
|
19
|
+
type: "mapClick";
|
|
20
|
+
coordinates: [number, number];
|
|
21
|
+
} | {
|
|
22
|
+
type: "markerClick";
|
|
23
|
+
id: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: "markerMouseEnter";
|
|
26
|
+
id: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: "markerMouseLeave";
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
14
31
|
export type MapController = {
|
|
15
|
-
|
|
16
|
-
setMapClickHandler(mapClickHandler: undefined | ((coordinates: [number, number]) => void)): void;
|
|
32
|
+
setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
|
|
17
33
|
flyTo(center: [number, number], zoom: number): void;
|
|
18
34
|
fitBounds(bbox: [number, number, number, number], padding: number): void;
|
|
19
35
|
indicateReverse(reverse: boolean): void;
|
|
20
36
|
setMarkers(features: Feature[] | undefined, picked: Feature | undefined): void;
|
|
37
|
+
setReverseMarker(coordinates?: [number, number]): void;
|
|
21
38
|
setSelectedMarker(index: number): void;
|
|
22
39
|
};
|
|
23
40
|
export type Proximity = [number, number] | undefined;
|
|
@@ -73,13 +90,19 @@ export type ControlOptions = {
|
|
|
73
90
|
* Search results will be limited to the bounding box.
|
|
74
91
|
*/
|
|
75
92
|
bbox?: [number, number, number, number];
|
|
93
|
+
/**
|
|
94
|
+
* Maximum number of results to show.
|
|
95
|
+
*
|
|
96
|
+
* @default 5
|
|
97
|
+
*/
|
|
98
|
+
limit?: number;
|
|
76
99
|
/**
|
|
77
100
|
* Specify the language to use for response text and query result weighting.
|
|
78
101
|
* 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.
|
|
79
102
|
* More than one value can also be specified, separated by commas.
|
|
80
103
|
* Defaults to the browser's language settings.
|
|
81
104
|
*/
|
|
82
|
-
language?: string;
|
|
105
|
+
language?: string | string[];
|
|
83
106
|
/**
|
|
84
107
|
* If `false`, indicates that search will only occur on enter key press.
|
|
85
108
|
* If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.
|
|
@@ -87,6 +110,12 @@ export type ControlOptions = {
|
|
|
87
110
|
* @default false
|
|
88
111
|
*/
|
|
89
112
|
showResultsWhileTyping?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Set to `false` to disable fuzzy search.
|
|
115
|
+
*
|
|
116
|
+
* @default true
|
|
117
|
+
*/
|
|
118
|
+
fuzzyMatch?: boolean;
|
|
90
119
|
/**
|
|
91
120
|
* On geocoded result what zoom level should the map animate to when a bbox isn't found in the response.
|
|
92
121
|
* If a bbox is found the map will fit to the bbox.
|
|
@@ -145,4 +174,16 @@ export type ControlOptions = {
|
|
|
145
174
|
* @default true
|
|
146
175
|
*/
|
|
147
176
|
showFullGeometry?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Limit search to specified country(ies).
|
|
179
|
+
*
|
|
180
|
+
* @default undefined use all countries
|
|
181
|
+
*/
|
|
182
|
+
country?: string | string[];
|
|
183
|
+
/**
|
|
184
|
+
* Filter of feature types to return.
|
|
185
|
+
*
|
|
186
|
+
* @default undefined all available feature types are returned
|
|
187
|
+
*/
|
|
188
|
+
types?: string[];
|
|
148
189
|
};
|