@maptiler/geocoding-control 0.0.95 → 0.0.96-alpha.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/GeocodingControl.svelte +1 -1
- package/MapLibreBasedGeocodingControl.d.ts +1 -1
- package/README.md +5 -5
- package/leaflet.d.ts +0 -1
- package/leaflet.js +357 -361
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +4 -4
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +2 -2
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +2 -2
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2 -2
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +2 -2
- package/maptilersdk.umd.js.map +1 -1
- package/package.json +7 -2
- package/react.d.ts +3 -4
- package/react.js +2 -1
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/types.d.ts +6 -0
- package/vanilla.d.ts +16 -0
- package/vanilla.js +1759 -0
- package/vanilla.js.map +1 -0
- package/vanilla.umd.js +2 -0
- package/vanilla.umd.js.map +1 -0
package/GeocodingControl.svelte
CHANGED
|
@@ -39,7 +39,7 @@ export let maxZoom = 18;
|
|
|
39
39
|
export let apiUrl = "https://api.maptiler.com/geocoding";
|
|
40
40
|
export let fetchParameters = {};
|
|
41
41
|
export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
|
|
42
|
-
"0.0.
|
|
42
|
+
"0.0.96-alpha.1" +
|
|
43
43
|
"/icons/";
|
|
44
44
|
export function focus() {
|
|
45
45
|
input.focus();
|
|
@@ -42,7 +42,7 @@ export type MapLibreBaseControlOptions = Omit<ControlOptions, "apiKey"> & {
|
|
|
42
42
|
export type Props<T> = T extends SvelteComponent<infer P, any, any> ? P : never;
|
|
43
43
|
export declare abstract class MapLibreBasedGeocodingControl<T extends MapLibreBaseControlOptions> extends EventTarget implements IControl {
|
|
44
44
|
#private;
|
|
45
|
-
constructor(options
|
|
45
|
+
constructor(options?: T);
|
|
46
46
|
abstract getExtraProps(map: Map, div: HTMLElement): Partial<Props<GeocodingControlComponent>>;
|
|
47
47
|
onAdd(map: Map): HTMLDivElement;
|
|
48
48
|
abstract getMapLibreGl(): typeof maplibregl;
|
package/README.md
CHANGED
|
@@ -101,6 +101,9 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
101
101
|
|
|
102
102
|
- `apiKey`<sup>\*</sup>: `string` - Maptiler API key. Not needed if used with MapTiler SDK.
|
|
103
103
|
- `maplibregl`: `MapLibreGL` - A MapLibre GL JS instance to use when creating [Markers](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker). Used if `options.marker` is `true` with MapLibre GL JS library. If not provided it will be autodetected. Not needed if used with MapTiler SDK.
|
|
104
|
+
- `apiUrl`: `string` - Geocoding API URL. Default MapTiler Geocoding API URL.
|
|
105
|
+
- `fetchParameters`: `RequestInit` - Extra fetch parameters. Default `undefined`.
|
|
106
|
+
- `iconsBaseUrl`: `string` - Base URL for POI icons. Default `"icons/"` for Svelte apps, otherwise <code>`https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/icons/`</code>.
|
|
104
107
|
- `debounceSearch`: `number` - Sets the amount of time, in milliseconds, to wait before querying the server when a user types into the Geocoder input box. This parameter may be useful for reducing the total number of API calls made for a single query. Default `200`.
|
|
105
108
|
- `proximity`: `[number, number]` - A proximity argument: this is a geographical point given as an object with latitude and longitude properties. Search results closer to this point will be given higher priority.
|
|
106
109
|
- `placeholder`: `string` - Override the default placeholder attribute value. Default `"Search"`.
|
|
@@ -110,7 +113,7 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
110
113
|
- `minLength`: `number` - Minimum number of characters to enter for results to show. Default `2`.
|
|
111
114
|
- `bbox`: `[number, number, number, number]` - A bounding box argument: this is a bounding box given as an array in the format [minX, minY, maxX, maxY]. Search results will be limited to the bounding box.
|
|
112
115
|
- `language`: `string | string[]` - Specify the language(s) to use for response text and query result weighting. 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. More than one value can also be specified, separated by commas. Set to empty string or empty array for forcing no language preference. If this parameter is not provided at all the browser's language settings will be used.
|
|
113
|
-
- `showResultsWhileTyping`: `boolean` - If `false`, indicates that search will only occur on enter key press. If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option. Default `
|
|
116
|
+
- `showResultsWhileTyping`: `boolean` - If `false`, indicates that search will only occur on enter key press. If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option. Default `true`.
|
|
114
117
|
- `marker`: `boolean | MarkerOptions` - If `true`, a [MapLibre GL JS Marker](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker) / [Leaflet Marker](https://leafletjs.com/reference.html#marker) will be added to the map at the location of the user-selected result using a default set of Marker options. If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.maplibregl` also be set. Default `true`.
|
|
115
118
|
- `showResultMarkers`: `boolean | MarkerOptions` - If `true`, [MapLibre GL JS Marker](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker) / [Leaflet Marker](https://leafletjs.com/reference.html#marker) will be added to the map at the location the top results for the query. If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.maplibregl` also be set. Default `true`.
|
|
116
119
|
- `zoom`: `number` - On geocoded result what zoom level should the map animate to when a bbox isn't found in the response. If a bbox is found the map will fit to the bbox. Default `16`.
|
|
@@ -121,6 +124,7 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
121
124
|
- `class`: `string` - Class of the root element.
|
|
122
125
|
- `enableReverse`: `boolean | "always""` - Set to `true` to enable reverse geocoding button with title. Set to `"always"` to reverse geocoding be always active. Default `false`.
|
|
123
126
|
- `reverseButtonTitle`: `string` - Reverse toggle button title. Default `"toggle reverse geocoding"`.
|
|
127
|
+
- `reverseActive`: `boolean` - Set to `true` to programatically toggle reverse mode. Useful only if `enableReverse` is `true`.
|
|
124
128
|
- `clearButtonTitle`: `string` - Clear button title. Default `"clear"`.
|
|
125
129
|
- `showFullGeometry`: `boolean` - Set to `true` to show full feature geometry of the chosen result. Otherwise only marker will be shown. Default `true`.
|
|
126
130
|
- `fullGeometryStyle`: `{ fill: Pick<FillLayerSpecification, "layout" | "paint" | "filter">; line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">; } | (L.PathOptions | L.StyleFunction)` - style of the full feature geometry. See Mapplibre GL JS or Leaflet documentation.
|
|
@@ -128,16 +132,12 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
128
132
|
- `limit`: `number` - Maximum number of results to show. Default `5`.
|
|
129
133
|
- `country`: `string | string[]` - Limit search to specified country(ies). Default `undefined` (use all countries). Specify as [alpha-2 ISO 3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) lowercase code.
|
|
130
134
|
- `types`: `string[]` - Filter of feature types to return. Default `undefined` (all available feature types are returned).
|
|
131
|
-
- `apiUrl`: `string` - Geocoding API URL. Default MapTiler Geocoding API URL.
|
|
132
|
-
- `fetchParameters`: `RequestInit` - Extra fetch parameters. Default `undefined`.
|
|
133
|
-
- `iconsBaseUrl`: `string` - Base URL for POI icons. Default `"icons/"` for Svelte apps, otherwise <code>`https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/icons/`</code>.
|
|
134
135
|
|
|
135
136
|
### Methods
|
|
136
137
|
|
|
137
138
|
- `setQuery(value: string, submit = true): void` - set the query and optionally submit it
|
|
138
139
|
- `focus(): void` - focus the query input box
|
|
139
140
|
- `blur(): void` - blur the query input box
|
|
140
|
-
- `setReverseMode(value: boolean | "always"): void` - set reverse mode
|
|
141
141
|
- `setOptions(options: Partial<Options>): void` - change one or more options of existing control
|
|
142
142
|
|
|
143
143
|
### Events
|
package/leaflet.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ export declare class GeocodingControl extends L.Control {
|
|
|
37
37
|
onAdd(map: L.Map): HTMLDivElement;
|
|
38
38
|
setOptions(options: LeafletControlOptions): void;
|
|
39
39
|
setQuery(value: string, submit?: boolean): void;
|
|
40
|
-
setReverseMode(value: boolean): void;
|
|
41
40
|
focus(): void;
|
|
42
41
|
blur(): void;
|
|
43
42
|
onRemove(): void;
|