@maptiler/geocoding-control 0.0.32 → 0.0.37

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 CHANGED
@@ -19,7 +19,7 @@ import maplibregl from "maplibre-gl";
19
19
  import { GeocodingControl } from "@maptiler/geocoding-control/maplibre";
20
20
  import "@maptiler/geocoding-control/dist/style.css";
21
21
 
22
- const API_KEY = "your API key";
22
+ const API_KEY = "YOUR_MAPTILER_API_KEY_HERE";
23
23
 
24
24
  const map = new maplibregl.Map({
25
25
  container: "map", // id of HTML container element
@@ -99,14 +99,18 @@ Options:
99
99
  - `clearOnBlur`: `boolean` - If true, the geocoder control will clear its value when the input blurs. Default `false`.
100
100
  - `filter`: `(feature: Feature) => boolean` - A function which accepts a Feature in the Carmen GeoJSON format to filter out results from the Geocoding API response before they are included in the suggestions list. Return true to keep the item, false otherwise.
101
101
  - `class`: `string` - Class of the root element.
102
- - `enableReverse`: `boolean | string` - Set to `true` to enable reverse geocoding button with title _toggle reverse geocoding_ or set the button title directly. Default `false`.
102
+ - `enableReverse`: `boolean | "always""` - Set to `true` to enable reverse geocoding button with title. Set to `"always"` to reverse geocoding be always active. Default `false`.
103
+ - `reverseButtonTitle`: `string` - Reverse toggle button title. Default `"toggle reverse geocoding"`.
104
+ - `clearButtonTitle`: `string` - Clear button title. Default `"clear"`.
105
+ - `showFullGeometry`: `boolean` - Set to `true` to show full feature geometry of the chosen result. Otherwise only marker will be shown. Default `true`.
106
+ - `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.
103
107
 
104
108
  Methods:
105
109
 
106
110
  - `setQuery(value: string, submit = true): void` - set the query and optionally submit it
107
111
  - `focus(): void` - focus the query input box
108
112
  - `blur(): void` - blur the query input box
109
- - `setReverseMode(value: boolean): void` - set reverse mode
113
+ - `setReverseMode(value: boolean | "always"): void` - set reverse mode
110
114
 
111
115
  Events:
112
116
 
@@ -128,12 +132,12 @@ Component API matches API described above and options are exposed as component p
128
132
  <script lang="ts">
129
133
  import GeocodingControl from "@maptiler/geocoding-control/src/lib/GeocodingControl.svelte";
130
134
  import GeocodingControl from "@maptiler/geocoding-control/src/lib/GeocodingControl.svelte";
131
- import { createMaplibreMapController } from "@maptiler/geocoding-control/src/lib/maplibreMapController";
135
+ import { createMaplibreglMapController } from "@maptiler/geocoding-control/src/lib/maplibreglMapController";
132
136
  import type { MapController } from "@maptiler/geocoding-control/src/lib/types";
133
137
  import maplibregl from "maplibre-gl";
134
138
  import "maplibre-gl/dist/maplibre-gl.css";
135
139
 
136
- const apiKey = "your API key";
140
+ const apiKey = "YOUR_MAPTILER_API_KEY_HERE";
137
141
 
138
142
  let mapController: MapController;
139
143
 
@@ -146,7 +150,7 @@ Component API matches API described above and options are exposed as component p
146
150
  container,
147
151
  });
148
152
 
149
- const mapController = createMaplibreMapController(map, maplibregl);
153
+ const mapController = createMaplibreglMapController(map, maplibregl);
150
154
  }
151
155
  </script>
152
156