@maptiler/geocoding-control 0.0.42 → 0.0.43
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/dist/leaflet.js +9 -9
- package/dist/leaflet.umd.js +3 -3
- package/dist/lib/LeafletGeocodingControl.d.ts +1 -1
- package/dist/lib/MaplibreglGeocodingControl.d.ts +4 -4
- package/dist/lib/types.d.ts +5 -5
- package/dist/maplibregl.js +120 -124
- package/dist/maplibregl.umd.js +5 -5
- package/package.json +6 -6
- package/src/lib/MaplibreglGeocodingControl.ts +10 -13
- package/src/lib/leafletMapController.ts +0 -4
- package/src/lib/maplibreglMapController.ts +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as L from "leaflet";
|
|
2
2
|
export { createLeafletMapController } from "./leafletMapController";
|
|
3
3
|
import type { ControlOptions } from "./types";
|
|
4
|
-
|
|
4
|
+
type LeafletControlOptions = ControlOptions & L.ControlOptions & {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, a [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.
|
|
7
7
|
* If the value is an object, the marker will be constructed using these options.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Map, IControl, MarkerOptions, FlyToOptions, FitBoundsOptions, FillLayerSpecification, LineLayerSpecification } from "maplibre-gl";
|
|
2
2
|
import type maplibregl from "maplibre-gl";
|
|
3
3
|
import type { ControlOptions } from "./types";
|
|
4
4
|
export { createMaplibreglMapController } from "./maplibreglMapController";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type MapLibreGL = typeof maplibregl;
|
|
6
|
+
type MapLibreControlOptions = ControlOptions & {
|
|
7
7
|
/**
|
|
8
8
|
* A Maplibre GL instance to use when creating [Markers](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker).
|
|
9
9
|
* Required if `options.marker` is `true`.
|
|
@@ -43,7 +43,7 @@ declare type MapLibreControlOptions = ControlOptions & {
|
|
|
43
43
|
line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
export declare class GeocodingControl extends
|
|
46
|
+
export declare class GeocodingControl extends EventTarget implements IControl {
|
|
47
47
|
#private;
|
|
48
48
|
constructor(options: MapLibreControlOptions);
|
|
49
49
|
onAdd(map: Map): HTMLDivElement;
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Feature = GeoJSON.Feature & {
|
|
2
2
|
id: string;
|
|
3
3
|
text: string;
|
|
4
4
|
place_name: string;
|
|
@@ -7,11 +7,11 @@ export declare type Feature = GeoJSON.Feature & {
|
|
|
7
7
|
bbox: [number, number, number, number];
|
|
8
8
|
address?: string;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type FeatureCollection = {
|
|
11
11
|
type: "FeatureCollection";
|
|
12
12
|
features: Feature[];
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type MapController = {
|
|
15
15
|
setProximityChangeHandler(proximityChangeHandler: undefined | ((proximity: [number, number] | undefined) => void)): void;
|
|
16
16
|
setMapClickHandler(mapClickHandler: undefined | ((coordinates: [number, number]) => void)): void;
|
|
17
17
|
flyTo(center: [number, number], zoom: number): void;
|
|
@@ -20,8 +20,8 @@ export declare type MapController = {
|
|
|
20
20
|
setMarkers(features: Feature[] | undefined, picked: Feature | undefined): void;
|
|
21
21
|
setSelectedMarker(index: number): void;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type Proximity = [number, number] | undefined;
|
|
24
|
+
export type ControlOptions = {
|
|
25
25
|
/**
|
|
26
26
|
* Maptiler API key
|
|
27
27
|
*/
|