@maptiler/geocoding-control 0.0.96-alpha.1 → 0.0.96
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/README.md +50 -1
- package/leaflet.js +1 -1
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -1
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +1 -1
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -1
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1 -1
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -1
- package/maptilersdk.umd.js.map +1 -1
- package/package.json +1 -1
- package/react.js +1 -1
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/vanilla.d.ts +1 -2
- package/vanilla.js +2 -2
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
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.96
|
|
42
|
+
"0.0.96" +
|
|
43
43
|
"/icons/";
|
|
44
44
|
export function focus() {
|
|
45
45
|
input.focus();
|
package/README.md
CHANGED
|
@@ -95,6 +95,55 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
95
95
|
- MapLibre GL JS: `sensible-browser file://$(pwd)/demo-maplibregl.html#key=YOUR_MAPTILER_API_KEY_HERE`
|
|
96
96
|
- Leaflet: `sensible-browser file://$(pwd)/demo-leaflet.html#key=YOUR_MAPTILER_API_KEY_HERE`
|
|
97
97
|
|
|
98
|
+
### Example for vanilla JS using UMD
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<script src="https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/vanilla.js"></script>
|
|
102
|
+
|
|
103
|
+
<link
|
|
104
|
+
href="https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/style.css"
|
|
105
|
+
rel="stylesheet"
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
<div id="container"></div>
|
|
109
|
+
|
|
110
|
+
<script>
|
|
111
|
+
const control = new maptilerGeocoder.GeocodingControl({
|
|
112
|
+
apiKey: "YOUR_MAPTILER_API_KEY_HERE",
|
|
113
|
+
target: document.getElementById("container"),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
control.addEventListener("pick", (evt) => {
|
|
117
|
+
console.log("Picked:", evt.detail);
|
|
118
|
+
});
|
|
119
|
+
</script>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
This example doesn't use the map. To use it, you can include and use particular map controller (see `createLeafletMapController` or `createMapLibreGlMapController`).
|
|
123
|
+
|
|
124
|
+
Note: replace `${version}` with the desired library version.
|
|
125
|
+
|
|
126
|
+
## UMD global variables
|
|
127
|
+
|
|
128
|
+
If you import script from CDN using `<script src="https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/${Script filename}"></script>` then it creates a global variable according to the following table:
|
|
129
|
+
|
|
130
|
+
| Script filename | UMD global variable name | Exports |
|
|
131
|
+
| ------------------------------ | --------------------------------------- | ------------------------------------------------------------------ |
|
|
132
|
+
| `leaflet.umd.js` | `leafletMaptilerGeocoder` | `class GeocodingControl`,`function createLeafletMapController` |
|
|
133
|
+
| `maplibregl.umd.js` | `maplibreglMaptilerGeocoder` | `class GeocodingControl`, `function createMapLibreGlMapController` |
|
|
134
|
+
| `maptilersdk.umd.js` | `maptilersdkMaptilerGeocoder` | `class GeocodingControl` |
|
|
135
|
+
| `react.umd.js` | `reactMaptilerGeocoder` | `class GeocodingControl` |
|
|
136
|
+
| `vanilla.umd.js` | `maptilerGeocoder` | `class GeocodingControl` |
|
|
137
|
+
| `leaflet-controller.umd.js` | `leafletMaptilerGeocodingController` | `function createLeafletMapController` |
|
|
138
|
+
| `maplibregl-controller.umd.js` | `maplibreglMaptilerGeocodingController` | `function createMapLibreGlMapController` |
|
|
139
|
+
|
|
140
|
+
The variable is an object with properties representing library-exported variables, for example `maplibreglMaptilerGeocoder.GeocodingControl`.
|
|
141
|
+
|
|
142
|
+
Notes:
|
|
143
|
+
|
|
144
|
+
- alternatively you can use different CDN, for example `https://www.unpkg.com/@maptiler/geocoding-control@${version}/maplibregl.umd.js`
|
|
145
|
+
- replace `${version}` with the desired library version and `${Script filename}` with the script filename from the table above.
|
|
146
|
+
|
|
98
147
|
## API Documentation
|
|
99
148
|
|
|
100
149
|
### Options
|
|
@@ -164,7 +213,7 @@ geocodingControl.addEventListener("optionsVisibilityChange", (e) => {
|
|
|
164
213
|
## POI icons and bundlers
|
|
165
214
|
|
|
166
215
|
POI icons are served from CDN per default.
|
|
167
|
-
If there is an requirement to serve them from a different location and the control is used in the application which is build with Web Application bundler (like Webpack
|
|
216
|
+
If there is an requirement to serve them from a different location and the control is used in the application which is build with Web Application bundler (like Webpack or Vite) then it is necessary to do some extra configuration.
|
|
168
217
|
Icons are bundled in the library and you can find them in `node_modules/@maptiler/geocoding-control/icons`.
|
|
169
218
|
Configure your bundler and/or provide `iconsBaseUrl` option for the icons to be properly resolved.
|
|
170
219
|
You can also copy icons from that directory to your _`public`_ directory.
|
package/leaflet.js
CHANGED
|
@@ -1420,7 +1420,7 @@ function Ea(r) {
|
|
|
1420
1420
|
return t[2] < t[0] && (t[2] += 360), t;
|
|
1421
1421
|
}
|
|
1422
1422
|
function hc(r, t, e) {
|
|
1423
|
-
let n, { $$slots: i = {}, $$scope: o } = t, { class: s = void 0 } = t, { apiKey: a } = t, { bbox: u = void 0 } = t, { clearButtonTitle: l = "clear" } = t, { clearOnBlur: c = !1 } = t, { collapsed: f = !1 } = t, { country: h = void 0 } = t, { debounceSearch: g = 200 } = t, { enableReverse: p = !1 } = t, { errorMessage: y = "Something went wrong…" } = t, { filter: d = () => !0 } = t, { flyTo: m = !0 } = t, { fuzzyMatch: _ = !0 } = t, { language: C = void 0 } = t, { limit: L = void 0 } = t, { mapController: N = void 0 } = t, { minLength: x = 2 } = t, { noResultsMessage: D = "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!" } = t, { placeholder: A = "Search" } = t, { proximity: w = void 0 } = t, { reverseActive: F = p === "always" } = t, { reverseButtonTitle: X = "toggle reverse geocoding" } = t, { searchValue: R = "" } = t, { showFullGeometry: Y = !0 } = t, { showPlaceType: T = "ifNeeded" } = t, { showResultsWhileTyping: W = !0 } = t, { trackProximity: ut = !0 } = t, { types: dt = void 0 } = t, { zoom: Ht = 16 } = t, { maxZoom: Jt = 18 } = t, { apiUrl: rr = "https://api.maptiler.com/geocoding" } = t, { fetchParameters: ze = {} } = t, { iconsBaseUrl: Fn = "https://cdn.maptiler.com/maptiler-geocoding-control/v0.0.96
|
|
1423
|
+
let n, { $$slots: i = {}, $$scope: o } = t, { class: s = void 0 } = t, { apiKey: a } = t, { bbox: u = void 0 } = t, { clearButtonTitle: l = "clear" } = t, { clearOnBlur: c = !1 } = t, { collapsed: f = !1 } = t, { country: h = void 0 } = t, { debounceSearch: g = 200 } = t, { enableReverse: p = !1 } = t, { errorMessage: y = "Something went wrong…" } = t, { filter: d = () => !0 } = t, { flyTo: m = !0 } = t, { fuzzyMatch: _ = !0 } = t, { language: C = void 0 } = t, { limit: L = void 0 } = t, { mapController: N = void 0 } = t, { minLength: x = 2 } = t, { noResultsMessage: D = "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!" } = t, { placeholder: A = "Search" } = t, { proximity: w = void 0 } = t, { reverseActive: F = p === "always" } = t, { reverseButtonTitle: X = "toggle reverse geocoding" } = t, { searchValue: R = "" } = t, { showFullGeometry: Y = !0 } = t, { showPlaceType: T = "ifNeeded" } = t, { showResultsWhileTyping: W = !0 } = t, { trackProximity: ut = !0 } = t, { types: dt = void 0 } = t, { zoom: Ht = 16 } = t, { maxZoom: Jt = 18 } = t, { apiUrl: rr = "https://api.maptiler.com/geocoding" } = t, { fetchParameters: ze = {} } = t, { iconsBaseUrl: Fn = "https://cdn.maptiler.com/maptiler-geocoding-control/v0.0.96/icons/" } = t;
|
|
1424
1424
|
function In() {
|
|
1425
1425
|
Bn.focus();
|
|
1426
1426
|
}
|