@maptiler/geocoding-control 0.0.92 → 0.0.93
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 +5 -1
- package/README.md +11 -1
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +3 -1
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -1
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +3 -1
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -1
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +3 -1
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -1
- package/maptilersdk.umd.js.map +1 -1
- package/package.json +12 -12
- package/react.js +3 -1
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/types.d.ts +1 -1
package/GeocodingControl.svelte
CHANGED
|
@@ -39,7 +39,11 @@ export let zoom = 16;
|
|
|
39
39
|
export let maxZoom = 18;
|
|
40
40
|
export let apiUrl = import.meta.env.VITE_API_URL;
|
|
41
41
|
export let fetchParameters = {};
|
|
42
|
-
export let iconsBaseUrl =
|
|
42
|
+
export let iconsBaseUrl = import.meta.env.VITE_FLAVOUR
|
|
43
|
+
? "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
|
|
44
|
+
import.meta.env.VITE_LIB_VERSION +
|
|
45
|
+
"/icons/"
|
|
46
|
+
: "icons/";
|
|
43
47
|
export function focus() {
|
|
44
48
|
input.focus();
|
|
45
49
|
}
|
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
|
|
|
130
130
|
- `types`: `string[]` - Filter of feature types to return. Default `undefined` (all available feature types are returned).
|
|
131
131
|
- `apiUrl`: `string` - Geocoding API URL. Default MapTiler Geocoding API URL.
|
|
132
132
|
- `fetchParameters`: `RequestInit` - Extra fetch parameters. Default `undefined`.
|
|
133
|
-
- `iconsBaseUrl`: `string` - Base URL for POI icons. Default `"icons/"
|
|
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
134
|
|
|
135
135
|
### Methods
|
|
136
136
|
|
|
@@ -161,6 +161,16 @@ geocodingControl.addEventListener("optionsVisibilityChange", (e) => {
|
|
|
161
161
|
});
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
+
## POI icons and bundlers
|
|
165
|
+
|
|
166
|
+
(Skip if the component is used within Svelte webapp.)
|
|
167
|
+
|
|
168
|
+
POI icons are served from CDN per default.
|
|
169
|
+
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, Vite) then it is necessary to do some extra cponfiguration.
|
|
170
|
+
Icons are bundled in the library and you can find them in `node_modules/@maptiler/geocoding-control/icons`.
|
|
171
|
+
Configure your bundler and/or provide `iconsBaseUrl` option for the icons to be properly resolved.
|
|
172
|
+
You can also copy icons from that directory to your _`public`_ directory.
|
|
173
|
+
|
|
164
174
|
## React component
|
|
165
175
|
|
|
166
176
|
In addition to using the component as MapLibre GL JS or Leaflet Control it is also possible to use it stand-alone in React projects with or without MapLibre GL JS or Leaflet integration.
|