Skip to content

Commit a7eecc6

Browse files
committed
added excludeTypes parameter
1 parent 00098a3 commit a7eecc6

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@maptiler/geocoding-control",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.",
55
"type": "module",
66
"author": {

src/GeocodingControl.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
7878
export let types: string[] | undefined = undefined;
7979
80+
export let excludeTypes = false;
81+
8082
export let zoom = 16;
8183
8284
export let maxZoom = 18;
@@ -362,6 +364,10 @@
362364
sp.set("types", types.join(","));
363365
}
364366
367+
if (excludeTypes) {
368+
sp.set("excludeTypes", String(excludeTypes));
369+
}
370+
365371
if (bbox) {
366372
sp.set("bbox", bbox.map((c) => c.toFixed(6)).join(","));
367373
}

src/react.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const propertyNames = [
5959
"showResultsWhileTyping",
6060
"adjustUrlQuery",
6161
"types",
62+
"excludeTypes",
6263
"zoom",
6364
"mapController",
6465
] as const satisfies readonly (keyof (ControlOptions & MapControllerProp))[];

src/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,14 @@ export type ControlOptions = {
276276
*/
277277
types?: string[];
278278

279+
280+
/**
281+
* If set to `true` then use all types except for those listed in `types`.
282+
*
283+
* @default false
284+
*/
285+
excludeTypes?: boolean;
286+
279287
/**
280288
* Geocoding API URL.
281289
*

0 commit comments

Comments
 (0)