@maptiler/geocoding-control 2.1.7 → 3.0.0-rc.2
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/CODE_OF_CONDUCT.md +46 -0
- package/CONTRIBUTING.md +72 -0
- package/README.md +115 -43
- package/SECURITY.md +16 -0
- package/dist/index.js +860 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +263 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/leaflet.public.js +1251 -0
- package/dist/leaflet.public.js.map +1 -0
- package/dist/leaflet.public.umd.js +276 -0
- package/dist/leaflet.public.umd.js.map +1 -0
- package/dist/maplibregl.js +1275 -0
- package/dist/maplibregl.js.map +1 -0
- package/dist/maplibregl.umd.js +276 -0
- package/dist/maplibregl.umd.js.map +1 -0
- package/dist/maptilersdk.js +1283 -0
- package/dist/maptilersdk.js.map +1 -0
- package/dist/maptilersdk.umd.js +276 -0
- package/dist/maptilersdk.umd.js.map +1 -0
- package/dist/src/components/clear-icon.d.ts +10 -0
- package/dist/src/components/fail-icon.d.ts +10 -0
- package/dist/src/components/loading-icon.d.ts +10 -0
- package/dist/src/components/marker.d.ts +10 -0
- package/dist/src/components/reverse-geocoding-icon.d.ts +10 -0
- package/dist/src/components/search-icon.d.ts +10 -0
- package/dist/src/controls/base-control.d.ts +44 -0
- package/dist/src/controls/leaflet-control.d.ts +27 -0
- package/dist/src/controls/leaflet-events.d.ts +42 -0
- package/dist/src/controls/leaflet-options.d.ts +84 -0
- package/dist/src/controls/maplibregl-control.d.ts +34 -0
- package/dist/src/controls/maplibregl-events.d.ts +44 -0
- package/dist/src/controls/maplibregl-options.d.ts +104 -0
- package/dist/src/controls/maptilersdk-control.d.ts +7 -0
- package/dist/src/controls/maptilersdk-events.d.ts +2 -0
- package/dist/src/controls/maptilersdk-options.d.ts +10 -0
- package/dist/src/controls/openlayers-control.d.ts +35 -0
- package/dist/src/controls/openlayers-events.d.ts +43 -0
- package/dist/src/controls/openlayers-options.d.ts +83 -0
- package/dist/src/geocoder/geocoder-events.d.ts +46 -0
- package/dist/src/geocoder/geocoder-feature-item.d.ts +22 -0
- package/{svelte/types.d.ts → dist/src/geocoder/geocoder-options.d.ts} +23 -143
- package/dist/src/geocoder/geocoder.d.ts +113 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/leaflet.public.d.ts +7 -0
- package/dist/src/maplibregl.d.ts +7 -0
- package/dist/src/maptilersdk.d.ts +7 -0
- package/dist/src/openlayers.public.d.ts +7 -0
- package/dist/src/types.d.ts +46 -0
- package/dist/src/utils/geo-utils.d.ts +6 -0
- package/dist/src/utils/mask.d.ts +2 -0
- package/dist/src/utils/proximity.d.ts +2 -0
- package/package.json +84 -112
- package/MapLibreBasedGeocodingControl.d.ts +0 -3072
- package/geo-coordinates-parser.t.d.ts +0 -8
- package/geoUtils.d.ts +0 -3
- package/leaflet-controller.d.ts +0 -12
- package/leaflet-controller.js +0 -2475
- package/leaflet-controller.js.map +0 -1
- package/leaflet-controller.umd.js +0 -2
- package/leaflet-controller.umd.js.map +0 -1
- package/leaflet.d.ts +0 -131
- package/leaflet.js +0 -5082
- package/leaflet.js.map +0 -1
- package/leaflet.umd.js +0 -14
- package/leaflet.umd.js.map +0 -1
- package/maplibregl-controller.d.ts +0 -19
- package/maplibregl-controller.js +0 -2418
- package/maplibregl-controller.js.map +0 -1
- package/maplibregl-controller.umd.js +0 -2
- package/maplibregl-controller.umd.js.map +0 -1
- package/maplibregl.d.ts +0 -2509
- package/maplibregl.js +0 -5142
- package/maplibregl.js.map +0 -1
- package/maplibregl.umd.js +0 -14
- package/maplibregl.umd.js.map +0 -1
- package/maptilersdk.d.ts +0 -2504
- package/maptilersdk.js +0 -5152
- package/maptilersdk.js.map +0 -1
- package/maptilersdk.umd.js +0 -14
- package/maptilersdk.umd.js.map +0 -1
- package/mask.d.ts +0 -2
- package/openlayers-controller.d.ts +0 -15
- package/openlayers-controller.js +0 -2174
- package/openlayers-controller.js.map +0 -1
- package/openlayers-controller.umd.js +0 -2
- package/openlayers-controller.umd.js.map +0 -1
- package/openlayers.d.ts +0 -109
- package/openlayers.js +0 -5045
- package/openlayers.js.map +0 -1
- package/openlayers.umd.js +0 -14
- package/openlayers.umd.js.map +0 -1
- package/proximity.d.ts +0 -2
- package/react.d.ts +0 -45
- package/react.js +0 -2795
- package/react.js.map +0 -1
- package/react.umd.js +0 -14
- package/react.umd.js.map +0 -1
- package/style.css +0 -1
- package/svelte/ClearIcon.svelte +0 -12
- package/svelte/ClearIcon.svelte.d.ts +0 -25
- package/svelte/FailIcon.svelte +0 -12
- package/svelte/FailIcon.svelte.d.ts +0 -25
- package/svelte/FeatureItem.svelte +0 -246
- package/svelte/FeatureItem.svelte.d.ts +0 -26
- package/svelte/GeocodingControl.svelte +0 -921
- package/svelte/GeocodingControl.svelte.d.ts +0 -105
- package/svelte/LoadingIcon.svelte +0 -40
- package/svelte/LoadingIcon.svelte.d.ts +0 -25
- package/svelte/MapLibreBasedGeocodingControl.d.ts +0 -3072
- package/svelte/MapLibreBasedGeocodingControl.js +0 -210
- package/svelte/MarkerIcon.svelte +0 -71
- package/svelte/MarkerIcon.svelte.d.ts +0 -18
- package/svelte/ReverseGeocodingIcon.svelte +0 -12
- package/svelte/ReverseGeocodingIcon.svelte.d.ts +0 -25
- package/svelte/SearchIcon.svelte +0 -26
- package/svelte/SearchIcon.svelte.d.ts +0 -25
- package/svelte/geo-coordinates-parser.t.d.ts +0 -8
- package/svelte/geo-coordinates-parser.t.js +0 -1
- package/svelte/geoUtils.d.ts +0 -3
- package/svelte/geoUtils.js +0 -18
- package/svelte/info.json +0 -1
- package/svelte/leaflet-controller.d.ts +0 -12
- package/svelte/leaflet-controller.js +0 -274
- package/svelte/leaflet.d.ts +0 -131
- package/svelte/leaflet.js +0 -116
- package/svelte/maplibregl-controller.d.ts +0 -19
- package/svelte/maplibregl-controller.js +0 -279
- package/svelte/maplibregl.d.ts +0 -2509
- package/svelte/maplibregl.js +0 -17
- package/svelte/maptilersdk.d.ts +0 -2504
- package/svelte/maptilersdk.js +0 -32
- package/svelte/mask.d.ts +0 -2
- package/svelte/mask.js +0 -54
- package/svelte/openlayers-controller.d.ts +0 -15
- package/svelte/openlayers-controller.js +0 -283
- package/svelte/openlayers.d.ts +0 -109
- package/svelte/openlayers.js +0 -178
- package/svelte/proximity.d.ts +0 -2
- package/svelte/proximity.js +0 -60
- package/svelte/react.d.ts +0 -45
- package/svelte/react.js +0 -106
- package/svelte/types.js +0 -1
- package/svelte/vanilla.d.ts +0 -61
- package/svelte/vanilla.js +0 -101
- package/svelte/vite-env.d.ts +0 -2
- package/types.d.ts +0 -391
- package/vanilla.d.ts +0 -61
- package/vanilla.js +0 -2799
- package/vanilla.js.map +0 -1
- package/vanilla.umd.js +0 -14
- package/vanilla.umd.js.map +0 -1
- /package/{icons → dist/icons}/10pin.svg +0 -0
- /package/{icons → dist/icons}/9pin.svg +0 -0
- /package/{icons → dist/icons}/advertising_column.svg +0 -0
- /package/{icons → dist/icons}/aerodrome.svg +0 -0
- /package/{icons → dist/icons}/alcohol.svg +0 -0
- /package/{icons → dist/icons}/alpine_hut.svg +0 -0
- /package/{icons → dist/icons}/amusement_arcade.svg +0 -0
- /package/{icons → dist/icons}/amusement_park.svg +0 -0
- /package/{icons → dist/icons}/apartment.svg +0 -0
- /package/{icons → dist/icons}/archaeological_site.svg +0 -0
- /package/{icons → dist/icons}/area.svg +0 -0
- /package/{icons → dist/icons}/art.svg +0 -0
- /package/{icons → dist/icons}/arts_centre.svg +0 -0
- /package/{icons → dist/icons}/artwork.svg +0 -0
- /package/{icons → dist/icons}/audioguide.svg +0 -0
- /package/{icons → dist/icons}/bag.svg +0 -0
- /package/{icons → dist/icons}/beauty.svg +0 -0
- /package/{icons → dist/icons}/bed.svg +0 -0
- /package/{icons → dist/icons}/bell_tower.svg +0 -0
- /package/{icons → dist/icons}/beverages.svg +0 -0
- /package/{icons → dist/icons}/bicycle_repair_station.svg +0 -0
- /package/{icons → dist/icons}/biergarten.svg +0 -0
- /package/{icons → dist/icons}/bird_hide.svg +0 -0
- /package/{icons → dist/icons}/boat_rental.svg +0 -0
- /package/{icons → dist/icons}/bookmaker.svg +0 -0
- /package/{icons → dist/icons}/books.svg +0 -0
- /package/{icons → dist/icons}/bowl.svg +0 -0
- /package/{icons → dist/icons}/bowling_alley.svg +0 -0
- /package/{icons → dist/icons}/bunker.svg +0 -0
- /package/{icons → dist/icons}/bureau_de_change.svg +0 -0
- /package/{icons → dist/icons}/bus_station.svg +0 -0
- /package/{icons → dist/icons}/bust.svg +0 -0
- /package/{icons → dist/icons}/camping.svg +0 -0
- /package/{icons → dist/icons}/car_parts.svg +0 -0
- /package/{icons → dist/icons}/car_wash.svg +0 -0
- /package/{icons → dist/icons}/caravan_park.svg +0 -0
- /package/{icons → dist/icons}/carpet.svg +0 -0
- /package/{icons → dist/icons}/cattle_grid.svg +0 -0
- /package/{icons → dist/icons}/cave_entrance.svg +0 -0
- /package/{icons → dist/icons}/chalet.svg +0 -0
- /package/{icons → dist/icons}/charity.svg +0 -0
- /package/{icons → dist/icons}/chemist.svg +0 -0
- /package/{icons → dist/icons}/chimney.svg +0 -0
- /package/{icons → dist/icons}/church.svg +0 -0
- /package/{icons → dist/icons}/city_gate.svg +0 -0
- /package/{icons → dist/icons}/clinic.svg +0 -0
- /package/{icons → dist/icons}/clothes.svg +0 -0
- /package/{icons → dist/icons}/coffee.svg +0 -0
- /package/{icons → dist/icons}/community_centre.svg +0 -0
- /package/{icons → dist/icons}/computer.svg +0 -0
- /package/{icons → dist/icons}/consulate.svg +0 -0
- /package/{icons → dist/icons}/copyshop.svg +0 -0
- /package/{icons → dist/icons}/cosmetics.svg +0 -0
- /package/{icons → dist/icons}/courthouse.svg +0 -0
- /package/{icons → dist/icons}/crane.svg +0 -0
- /package/{icons → dist/icons}/dairy.svg +0 -0
- /package/{icons → dist/icons}/deli.svg +0 -0
- /package/{icons → dist/icons}/department_store.svg +0 -0
- /package/{icons → dist/icons}/diy.svg +0 -0
- /package/{icons → dist/icons}/electronics.svg +0 -0
- /package/{icons → dist/icons}/embankment.svg +0 -0
- /package/{icons → dist/icons}/embassy.svg +0 -0
- /package/{icons → dist/icons}/excrement_bags.svg +0 -0
- /package/{icons → dist/icons}/fabric.svg +0 -0
- /package/{icons → dist/icons}/farmyard.svg +0 -0
- /package/{icons → dist/icons}/ferry.svg +0 -0
- /package/{icons → dist/icons}/firepit.svg +0 -0
- /package/{icons → dist/icons}/firestation.svg +0 -0
- /package/{icons → dist/icons}/fishing.svg +0 -0
- /package/{icons → dist/icons}/fitness.svg +0 -0
- /package/{icons → dist/icons}/ford.svg +0 -0
- /package/{icons → dist/icons}/fort.svg +0 -0
- /package/{icons → dist/icons}/fortress.svg +0 -0
- /package/{icons → dist/icons}/full-height_turnstile.svg +0 -0
- /package/{icons → dist/icons}/generator_wind.svg +0 -0
- /package/{icons → dist/icons}/golf_pin.svg +0 -0
- /package/{icons → dist/icons}/greengrocer.svg +0 -0
- /package/{icons → dist/icons}/guest_house.svg +0 -0
- /package/{icons → dist/icons}/helipad.svg +0 -0
- /package/{icons → dist/icons}/hifi.svg +0 -0
- /package/{icons → dist/icons}/hostel.svg +0 -0
- /package/{icons → dist/icons}/hotel.svg +0 -0
- /package/{icons → dist/icons}/housenumber.svg +0 -0
- /package/{icons → dist/icons}/houseware.svg +0 -0
- /package/{icons → dist/icons}/hunting_stand.svg +0 -0
- /package/{icons → dist/icons}/interior_decoration.svg +0 -0
- /package/{icons → dist/icons}/internet_cafe.svg +0 -0
- /package/{icons → dist/icons}/kindergarten.svg +0 -0
- /package/{icons → dist/icons}/kissing_gate.svg +0 -0
- /package/{icons → dist/icons}/manor.svg +0 -0
- /package/{icons → dist/icons}/map.svg +0 -0
- /package/{icons → dist/icons}/marker_reverse.svg +0 -0
- /package/{icons → dist/icons}/marker_selected.svg +0 -0
- /package/{icons → dist/icons}/marker_unselected.svg +0 -0
- /package/{icons → dist/icons}/marketplace.svg +0 -0
- /package/{icons → dist/icons}/massage.svg +0 -0
- /package/{icons → dist/icons}/mast.svg +0 -0
- /package/{icons → dist/icons}/mast_communications.svg +0 -0
- /package/{icons → dist/icons}/mast_lighting.svg +0 -0
- /package/{icons → dist/icons}/medical_supply.svg +0 -0
- /package/{icons → dist/icons}/memorial.svg +0 -0
- /package/{icons → dist/icons}/miniature_golf.svg +0 -0
- /package/{icons → dist/icons}/motel.svg +0 -0
- /package/{icons → dist/icons}/mountain_range.svg +0 -0
- /package/{icons → dist/icons}/multifaith.svg +0 -0
- /package/{icons → dist/icons}/musical_instrument.svg +0 -0
- /package/{icons → dist/icons}/newsagent.svg +0 -0
- /package/{icons → dist/icons}/nightclub.svg +0 -0
- /package/{icons → dist/icons}/ocean.svg +0 -0
- /package/{icons → dist/icons}/office.svg +0 -0
- /package/{icons → dist/icons}/outdoor_seating.svg +0 -0
- /package/{icons → dist/icons}/palace.svg +0 -0
- /package/{icons → dist/icons}/parcel_locker.svg +0 -0
- /package/{icons → dist/icons}/parking_space.svg +0 -0
- /package/{icons → dist/icons}/parking_tickets.svg +0 -0
- /package/{icons → dist/icons}/pet.svg +0 -0
- /package/{icons → dist/icons}/photo.svg +0 -0
- /package/{icons → dist/icons}/picnic.svg +0 -0
- /package/{icons → dist/icons}/plaque.svg +0 -0
- /package/{icons → dist/icons}/poi.svg +0 -0
- /package/{icons → dist/icons}/post_box.svg +0 -0
- /package/{icons → dist/icons}/post_office.svg +0 -0
- /package/{icons → dist/icons}/postal_code.svg +0 -0
- /package/{icons → dist/icons}/pub.svg +0 -0
- /package/{icons → dist/icons}/public_bath.svg +0 -0
- /package/{icons → dist/icons}/public_bookcase.svg +0 -0
- /package/{icons → dist/icons}/public_building.svg +0 -0
- /package/{icons → dist/icons}/public_transport_tickets.svg +0 -0
- /package/{icons → dist/icons}/reverse.svg +0 -0
- /package/{icons → dist/icons}/river.svg +0 -0
- /package/{icons → dist/icons}/road.svg +0 -0
- /package/{icons → dist/icons}/saddle.svg +0 -0
- /package/{icons → dist/icons}/sauna.svg +0 -0
- /package/{icons → dist/icons}/sea.svg +0 -0
- /package/{icons → dist/icons}/second_hand.svg +0 -0
- /package/{icons → dist/icons}/shintoist.svg +0 -0
- /package/{icons → dist/icons}/shoe.svg +0 -0
- /package/{icons → dist/icons}/shower.svg +0 -0
- /package/{icons → dist/icons}/shrine.svg +0 -0
- /package/{icons → dist/icons}/sikhist.svg +0 -0
- /package/{icons → dist/icons}/slipway.svg +0 -0
- /package/{icons → dist/icons}/snowmobile.svg +0 -0
- /package/{icons → dist/icons}/social_facility.svg +0 -0
- /package/{icons → dist/icons}/sports.svg +0 -0
- /package/{icons → dist/icons}/sprite.json +0 -0
- /package/{icons → dist/icons}/sprite.png +0 -0
- /package/{icons → dist/icons}/sprite@2x.json +0 -0
- /package/{icons → dist/icons}/sprite@2x.png +0 -0
- /package/{icons → dist/icons}/stationery.svg +0 -0
- /package/{icons → dist/icons}/stile.svg +0 -0
- /package/{icons → dist/icons}/stone.svg +0 -0
- /package/{icons → dist/icons}/storage_tank.svg +0 -0
- /package/{icons → dist/icons}/stream.svg +0 -0
- /package/{icons → dist/icons}/street.svg +0 -0
- /package/{icons → dist/icons}/supermarket.svg +0 -0
- /package/{icons → dist/icons}/tea.svg +0 -0
- /package/{icons → dist/icons}/telescope_dish.svg +0 -0
- /package/{icons → dist/icons}/telescope_dome.svg +0 -0
- /package/{icons → dist/icons}/ticket.svg +0 -0
- /package/{icons → dist/icons}/tobacco.svg +0 -0
- /package/{icons → dist/icons}/tower_cantilever_communication.svg +0 -0
- /package/{icons → dist/icons}/tower_cooling.svg +0 -0
- /package/{icons → dist/icons}/tower_dish.svg +0 -0
- /package/{icons → dist/icons}/tower_dome.svg +0 -0
- /package/{icons → dist/icons}/tower_generic.svg +0 -0
- /package/{icons → dist/icons}/tower_lattice.svg +0 -0
- /package/{icons → dist/icons}/tower_lattice_communication.svg +0 -0
- /package/{icons → dist/icons}/tower_lattice_lighting.svg +0 -0
- /package/{icons → dist/icons}/tower_lighting.svg +0 -0
- /package/{icons → dist/icons}/townhall.svg +0 -0
- /package/{icons → dist/icons}/toys.svg +0 -0
- /package/{icons → dist/icons}/trade.svg +0 -0
- /package/{icons → dist/icons}/traffic_light.svg +0 -0
- /package/{icons → dist/icons}/train_station.svg +0 -0
- /package/{icons → dist/icons}/travel_agency.svg +0 -0
- /package/{icons → dist/icons}/tyres.svg +0 -0
- /package/{icons → dist/icons}/university.svg +0 -0
- /package/{icons → dist/icons}/variety_store.svg +0 -0
- /package/{icons → dist/icons}/vehicle_inspection.svg +0 -0
- /package/{icons → dist/icons}/vending_machine.svg +0 -0
- /package/{icons → dist/icons}/video.svg +0 -0
- /package/{icons → dist/icons}/video_games.svg +0 -0
- /package/{icons → dist/icons}/waste_disposal.svg +0 -0
- /package/{icons → dist/icons}/water_well.svg +0 -0
- /package/{icons → dist/icons}/waterfall.svg +0 -0
- /package/{icons → dist/icons}/wilderness_hut.svg +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class MaptilerGeocodeClearIconElement extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult;
|
|
4
|
+
render(): import('lit-html').TemplateResult<2>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"maptiler-geocode-clear-icon": MaptilerGeocodeClearIconElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class MaptilerGeocodeFailIconElement extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult;
|
|
4
|
+
render(): import('lit-html').TemplateResult<2>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"maptiler-geocode-fail-icon": MaptilerGeocodeFailIconElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class MaptilerGeocodeLoadingIconElement extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult;
|
|
4
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"maptiler-geocode-loading-icon": MaptilerGeocodeLoadingIconElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class MaptilerGeocodeMarkerElement extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult;
|
|
4
|
+
render(): import('lit-html').TemplateResult<2>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"maptiler-geocode-marker": MaptilerGeocodeMarkerElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class MaptilerGeocodeReverseGeocodingIconElement extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult;
|
|
4
|
+
render(): import('lit-html').TemplateResult<2>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"maptiler-geocode-reverse-geocoding-icon": MaptilerGeocodeReverseGeocodingIconElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class MaptilerGeocodeSearchIconElement extends LitElement {
|
|
3
|
+
static styles: import('lit').CSSResult;
|
|
4
|
+
render(): import('lit-html').TemplateResult<2>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"maptiler-geocode-search-icon": MaptilerGeocodeSearchIconElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface GeocodingControlBase<Options extends object> {
|
|
2
|
+
/**
|
|
3
|
+
* Update the control options.
|
|
4
|
+
*
|
|
5
|
+
* @param options options to update
|
|
6
|
+
*/
|
|
7
|
+
setOptions(options: Options): void;
|
|
8
|
+
/**
|
|
9
|
+
* Set the content of search input box.
|
|
10
|
+
*
|
|
11
|
+
* @param value text to set
|
|
12
|
+
*/
|
|
13
|
+
setQuery(value: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Set the content of search input box and immediately submit it.
|
|
16
|
+
*
|
|
17
|
+
* @param value text to set and submit
|
|
18
|
+
*/
|
|
19
|
+
submitQuery(value: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* Clear geocoding search results from the map.
|
|
22
|
+
*/
|
|
23
|
+
clearMap(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Clear search result list.
|
|
26
|
+
*/
|
|
27
|
+
clearList(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Set reverse geocoding mode.
|
|
30
|
+
*
|
|
31
|
+
* @param reverseActive reverse geocoding active
|
|
32
|
+
*/
|
|
33
|
+
setReverseMode(reverseActive: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Focus the search input box.
|
|
36
|
+
*
|
|
37
|
+
* @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
|
|
38
|
+
*/
|
|
39
|
+
focus(options?: FocusOptions): void;
|
|
40
|
+
/**
|
|
41
|
+
* Blur the search input box.
|
|
42
|
+
*/
|
|
43
|
+
blur(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Control, ControlOptions, Evented, Map as LMap } from 'leaflet';
|
|
2
|
+
import { GeocodingControlBase } from './base-control';
|
|
3
|
+
import { LeafletGeocodingControlOptions } from './leaflet-options';
|
|
4
|
+
/** Base class for Control needs to extend both Control and Evented */
|
|
5
|
+
declare abstract class EventedControl<Options extends ControlOptions> extends Control {
|
|
6
|
+
options: Options;
|
|
7
|
+
}
|
|
8
|
+
interface EventedControl<Options extends ControlOptions> extends Control, Evented {
|
|
9
|
+
options: Options;
|
|
10
|
+
}
|
|
11
|
+
export declare class LeafletGeocodingControl extends EventedControl<LeafletGeocodingControlOptions> implements GeocodingControlBase<LeafletGeocodingControlOptions> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(options?: LeafletGeocodingControlOptions);
|
|
14
|
+
/** @internal Not to be called directly */
|
|
15
|
+
onAdd(map: LMap): HTMLElement;
|
|
16
|
+
/** @internal Not to be called directly */
|
|
17
|
+
onRemove(): void;
|
|
18
|
+
setOptions(options: LeafletGeocodingControlOptions): void;
|
|
19
|
+
setQuery(value: string): void;
|
|
20
|
+
submitQuery(value: string): void;
|
|
21
|
+
clearMap(): void;
|
|
22
|
+
clearList(): void;
|
|
23
|
+
setReverseMode(reverseActive: boolean): void;
|
|
24
|
+
focus(options?: FocusOptions): void;
|
|
25
|
+
blur(): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Marker } from 'leaflet';
|
|
2
|
+
import { Feature } from '../types';
|
|
3
|
+
import type * as Geocoder from "../geocoder/geocoder-events";
|
|
4
|
+
export type ReverseToggleEvent = Geocoder.ReverseToggleEvent["detail"];
|
|
5
|
+
export type QueryChangeEvent = Geocoder.QueryChangeEvent["detail"];
|
|
6
|
+
export type FeaturesListedEvent = Geocoder.FeaturesListedEvent["detail"];
|
|
7
|
+
export type RequestEvent = Geocoder.RequestEvent["detail"];
|
|
8
|
+
export type ResponseEvent = Geocoder.ResponseEvent["detail"];
|
|
9
|
+
export type SelectEvent = Geocoder.SelectEvent["detail"];
|
|
10
|
+
export type PickEvent = Geocoder.PickEvent["detail"];
|
|
11
|
+
export type MarkerClickEvent = {
|
|
12
|
+
feature: Feature;
|
|
13
|
+
marker: Marker;
|
|
14
|
+
};
|
|
15
|
+
export type MarkerMouseEnterEvent = {
|
|
16
|
+
feature: Feature;
|
|
17
|
+
marker: Marker;
|
|
18
|
+
};
|
|
19
|
+
export type MarkerMouseLeaveEvent = {
|
|
20
|
+
feature: Feature;
|
|
21
|
+
marker: Marker;
|
|
22
|
+
};
|
|
23
|
+
export type LeafletGeocodingControlEventNameMap = {
|
|
24
|
+
reversetoggle: ReverseToggleEvent;
|
|
25
|
+
querychange: QueryChangeEvent;
|
|
26
|
+
queryclear: never;
|
|
27
|
+
request: RequestEvent;
|
|
28
|
+
response: ResponseEvent;
|
|
29
|
+
select: SelectEvent;
|
|
30
|
+
pick: PickEvent;
|
|
31
|
+
featuresshow: never;
|
|
32
|
+
featureshide: never;
|
|
33
|
+
featureslisted: FeaturesListedEvent;
|
|
34
|
+
featuresclear: never;
|
|
35
|
+
focusin: never;
|
|
36
|
+
focusout: never;
|
|
37
|
+
markerclick: MarkerClickEvent;
|
|
38
|
+
markermouseenter: MarkerMouseEnterEvent;
|
|
39
|
+
markermouseleave: MarkerMouseLeaveEvent;
|
|
40
|
+
};
|
|
41
|
+
export type LeafletGeocodingControlEvent = LeafletGeocodingControlEventNameMap[keyof LeafletGeocodingControlEventNameMap];
|
|
42
|
+
export type LeafletGeocodingControlEventName = keyof LeafletGeocodingControlEventNameMap;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ControlOptions, Map as LMap, Marker, MarkerOptions, PathOptions, StyleFunction, ZoomPanOptions } from 'leaflet';
|
|
2
|
+
import { MaptilerGeocoderOptions } from '../geocoder/geocoder-options';
|
|
3
|
+
import { Feature, PickedResultStyle } from '../types';
|
|
4
|
+
export type LeafletGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "fetchFullGeometryOnPick"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Marker to be added to the map at the location of the user-selected result using a default set of Marker options.
|
|
7
|
+
*
|
|
8
|
+
* - If `true` or `undefined` then a default marker will be used.
|
|
9
|
+
* - If the value is a [MarkerOptions](https://leafletjs.com/reference.html#marker-option) then the marker will be constructed using these options.
|
|
10
|
+
* - If the value is a function then it can return instance of the [Marker](https://leafletjs.com/reference.html#marker).
|
|
11
|
+
* Function can accept `Feature` as a parameter which is `undefined` for the reverse location marker.
|
|
12
|
+
* - If `false` or `null` then no marker will be added to the map.
|
|
13
|
+
*
|
|
14
|
+
* Default value is `true`.
|
|
15
|
+
*/
|
|
16
|
+
marker?: null | boolean | MarkerOptions | ((map: LMap, feature?: Feature) => undefined | null | Marker);
|
|
17
|
+
/**
|
|
18
|
+
* Displays a marker on the selected feature from the result list. `marker` must be enabled in any way for this to display.
|
|
19
|
+
*
|
|
20
|
+
* Default: `true`.
|
|
21
|
+
*/
|
|
22
|
+
markerOnSelected?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Marker be added to the map at the location the geocoding results.
|
|
25
|
+
*
|
|
26
|
+
* - If `true` or `undefined` then a default marker will be used.
|
|
27
|
+
* - If the value is a [MarkerOptions](https://leafletjs.com/reference.html#marker-option) then the marker will be constructed using these options.
|
|
28
|
+
* - If the value is a function then it can return instance of the [Marker](https://leafletjs.com/reference.html#marker).
|
|
29
|
+
* In this case the default pop-up won't be added to the marker.
|
|
30
|
+
* Function can accept `Feature` as a parameter.
|
|
31
|
+
* - If `false` or `null` then no marker will be added to the map.
|
|
32
|
+
*
|
|
33
|
+
* Default value is `true`.
|
|
34
|
+
*/
|
|
35
|
+
showResultMarkers?: null | boolean | MarkerOptions | ((map: LMap, feature: Feature) => undefined | null | Marker);
|
|
36
|
+
/**
|
|
37
|
+
* Animation to picked feature on the map.
|
|
38
|
+
*
|
|
39
|
+
* - If `false` or `null` then animating the map to a selected result is disabled.
|
|
40
|
+
* - If `true` or `undefined` then animating the map will use the default animation parameters.
|
|
41
|
+
* - If the value is [ZoomPanOptions](https://leafletjs.com/reference.html#zoom/pan-options)
|
|
42
|
+
* then it will be passed as options to the map [flyTo](https://leafletjs.com/reference.html#map-flyto)
|
|
43
|
+
* or [fitBounds](https://leafletjs.com/reference.html#map-fitbounds) method providing control over the animation of the transition.
|
|
44
|
+
*
|
|
45
|
+
* Default value is `true`.
|
|
46
|
+
*/
|
|
47
|
+
flyTo?: null | boolean | ZoomPanOptions;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies if selected (not picked) feature should be also animated to on the map.
|
|
50
|
+
*
|
|
51
|
+
* Default: `false`.
|
|
52
|
+
*/
|
|
53
|
+
flyToSelected?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Style for full feature geometry GeoJSON.
|
|
56
|
+
*
|
|
57
|
+
* - If `false` or `null` then no full geometry is drawn.
|
|
58
|
+
* - If `true` or `undefined` then default-styled full geometry is drawn.
|
|
59
|
+
* - If an T then it must represent the style and will be used to style the full geometry.
|
|
60
|
+
*
|
|
61
|
+
* Default is the default style.
|
|
62
|
+
*/
|
|
63
|
+
fullGeometryStyle?: null | boolean | PathOptions | StyleFunction;
|
|
64
|
+
/**
|
|
65
|
+
* Style of the picked result on the map:
|
|
66
|
+
* - `"marker-only"`: Show only a marker at the center of the feature.
|
|
67
|
+
* - `"full-geometry"`: Display the full feature geometry.
|
|
68
|
+
* - `"full-geometry-including-polygon-center-marker"`: Display full geometry with a marker at the polygon center.
|
|
69
|
+
*
|
|
70
|
+
* Default: `"full-geometry"`.
|
|
71
|
+
*/
|
|
72
|
+
pickedResultStyle?: PickedResultStyle;
|
|
73
|
+
/**
|
|
74
|
+
* Specifies the zoom level to animate the map to for a geocoded result when no bounding box is present or when the result is a point.
|
|
75
|
+
* If a bounding box is present and not a point, the map will fit to the bounding box.
|
|
76
|
+
*
|
|
77
|
+
* Values are key-value pairs where the key is a `<type>` or `<type>.<category>` and the value is the zoom level.
|
|
78
|
+
*
|
|
79
|
+
* Default: `ZOOM_DEFAULTS`.
|
|
80
|
+
*/
|
|
81
|
+
zoom?: Record<string, number>;
|
|
82
|
+
} & ControlOptions;
|
|
83
|
+
export declare const ZOOM_DEFAULTS: Record<string, number>;
|
|
84
|
+
export declare const DEFAULT_GEOMETRY_STYLE: StyleFunction;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as maplibregl } from 'maplibre-gl';
|
|
2
|
+
import { GeocodingControlBase } from './base-control';
|
|
3
|
+
import { MaplibreglGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap } from './maplibregl-events';
|
|
4
|
+
import { MaplibreglGeocodingControlOptions } from './maplibregl-options';
|
|
5
|
+
declare const Evented: typeof maplibregl.Evented;
|
|
6
|
+
type Evented = maplibregl.Evented;
|
|
7
|
+
type IControl = maplibregl.IControl;
|
|
8
|
+
type MLMap = maplibregl.Map;
|
|
9
|
+
type Subscription = maplibregl.Subscription;
|
|
10
|
+
type EventHandlingMethod<Return> = <Type extends MaplibreglGeocodingControlEventName>(type: Type, listener: (event: MaplibreglGeocodingControlEventNameMap[Type]) => void) => Return;
|
|
11
|
+
interface EventOnceHandlingMethod<Return> {
|
|
12
|
+
<Type extends MaplibreglGeocodingControlEventName>(type: Type, listener: (event: MaplibreglGeocodingControlEventNameMap[Type]) => void): Return;
|
|
13
|
+
<Type extends MaplibreglGeocodingControlEventName>(type: Type, listener?: undefined): Promise<MaplibreglGeocodingControlEventNameMap[Type]>;
|
|
14
|
+
}
|
|
15
|
+
export declare class MaplibreglGeocodingControl extends Evented implements IControl, GeocodingControlBase<MaplibreglGeocodingControlOptions> {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(options?: MaplibreglGeocodingControlOptions);
|
|
18
|
+
/** @internal Not to be called directly */
|
|
19
|
+
onAdd(map: MLMap): HTMLElement;
|
|
20
|
+
/** @internal Not to be called directly */
|
|
21
|
+
onRemove(): void;
|
|
22
|
+
setOptions(options: MaplibreglGeocodingControlOptions): void;
|
|
23
|
+
setQuery(value: string): void;
|
|
24
|
+
submitQuery(value: string): void;
|
|
25
|
+
clearMap(): void;
|
|
26
|
+
clearList(): void;
|
|
27
|
+
setReverseMode(reverseActive: boolean): void;
|
|
28
|
+
focus(options?: FocusOptions): void;
|
|
29
|
+
blur(): void;
|
|
30
|
+
on: EventHandlingMethod<Subscription>;
|
|
31
|
+
off: EventHandlingMethod<this>;
|
|
32
|
+
once: EventOnceHandlingMethod<this>;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as maplibregl } from 'maplibre-gl';
|
|
2
|
+
import { Feature } from '../types';
|
|
3
|
+
type Marker = maplibregl.Marker;
|
|
4
|
+
import type * as Geocoder from "../geocoder/geocoder-events";
|
|
5
|
+
export type ReverseToggleEvent = Geocoder.ReverseToggleEvent["detail"];
|
|
6
|
+
export type QueryChangeEvent = Geocoder.QueryChangeEvent["detail"];
|
|
7
|
+
export type FeaturesListedEvent = Geocoder.FeaturesListedEvent["detail"];
|
|
8
|
+
export type RequestEvent = Geocoder.RequestEvent["detail"];
|
|
9
|
+
export type ResponseEvent = Geocoder.ResponseEvent["detail"];
|
|
10
|
+
export type SelectEvent = Geocoder.SelectEvent["detail"];
|
|
11
|
+
export type PickEvent = Geocoder.PickEvent["detail"];
|
|
12
|
+
export type MarkerClickEvent = {
|
|
13
|
+
feature: Feature;
|
|
14
|
+
marker: Marker;
|
|
15
|
+
};
|
|
16
|
+
export type MarkerMouseEnterEvent = {
|
|
17
|
+
feature: Feature;
|
|
18
|
+
marker: Marker;
|
|
19
|
+
};
|
|
20
|
+
export type MarkerMouseLeaveEvent = {
|
|
21
|
+
feature: Feature;
|
|
22
|
+
marker: Marker;
|
|
23
|
+
};
|
|
24
|
+
export type MaplibreglGeocodingControlEventNameMap = {
|
|
25
|
+
reversetoggle: ReverseToggleEvent;
|
|
26
|
+
querychange: QueryChangeEvent;
|
|
27
|
+
queryclear: never;
|
|
28
|
+
request: RequestEvent;
|
|
29
|
+
response: ResponseEvent;
|
|
30
|
+
select: SelectEvent;
|
|
31
|
+
pick: PickEvent;
|
|
32
|
+
featuresshow: never;
|
|
33
|
+
featureshide: never;
|
|
34
|
+
featureslisted: FeaturesListedEvent;
|
|
35
|
+
featuresclear: never;
|
|
36
|
+
focusin: never;
|
|
37
|
+
focusout: never;
|
|
38
|
+
markerclick: MarkerClickEvent;
|
|
39
|
+
markermouseenter: MarkerMouseEnterEvent;
|
|
40
|
+
markermouseleave: MarkerMouseLeaveEvent;
|
|
41
|
+
};
|
|
42
|
+
export type MaplibreglGeocodingControlEvent = MaplibreglGeocodingControlEventNameMap[keyof MaplibreglGeocodingControlEventNameMap];
|
|
43
|
+
export type MaplibreglGeocodingControlEventName = keyof MaplibreglGeocodingControlEventNameMap;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { default as maplibregl } from 'maplibre-gl';
|
|
2
|
+
import { MaptilerGeocoderOptions } from '../geocoder/geocoder-options';
|
|
3
|
+
import { Feature, PickedResultStyle } from '../types';
|
|
4
|
+
type FillLayerSpecification = maplibregl.FillLayerSpecification;
|
|
5
|
+
type FitBoundsOptions = maplibregl.FitBoundsOptions;
|
|
6
|
+
type FlyToOptions = maplibregl.FlyToOptions;
|
|
7
|
+
type LineLayerSpecification = maplibregl.LineLayerSpecification;
|
|
8
|
+
type Marker = maplibregl.Marker;
|
|
9
|
+
type MarkerOptions = maplibregl.MarkerOptions;
|
|
10
|
+
type MLMap = maplibregl.Map;
|
|
11
|
+
export type MaplibreglGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "apiKey" | "fetchFullGeometryOnPick"> & {
|
|
12
|
+
/**
|
|
13
|
+
* Maptiler API key. Optional if used with MapTiler SDK - if not specified, the control will use the same API key as the map uses.
|
|
14
|
+
*/
|
|
15
|
+
apiKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Marker to be added to the map at the location of the user-selected result using a default set of Marker options.
|
|
18
|
+
*
|
|
19
|
+
* - If `true` or `undefined` then a default marker will be used.
|
|
20
|
+
* - If the value is a [MarkerOptions](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MarkerOptions/) then the marker will be constructed using these options.
|
|
21
|
+
* - If the value is a function then it can return instance of the [Marker](https://maplibre.org/maplibre-gl-js/docs/API/classes/Marker/).
|
|
22
|
+
* Function can accept `Feature` as a parameter which is `undefined` for the reverse location marker.
|
|
23
|
+
* - If `false` or `null` then no marker will be added to the map.
|
|
24
|
+
*
|
|
25
|
+
* Default value is `true`.
|
|
26
|
+
*/
|
|
27
|
+
marker?: null | boolean | MarkerOptions | ((map: MLMap, feature?: Feature) => undefined | null | Marker);
|
|
28
|
+
/**
|
|
29
|
+
* Displays a marker on the selected feature from the result list. `marker` must be enabled in any way for this to display.
|
|
30
|
+
*
|
|
31
|
+
* Default: `true`.
|
|
32
|
+
*/
|
|
33
|
+
markerOnSelected?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Marker be added to the map at the location the geocoding results.
|
|
36
|
+
*
|
|
37
|
+
* - If `true` or `undefined` then a default marker will be used.
|
|
38
|
+
* - If the value is a [MarkerOptions](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MarkerOptions/) then the marker will be constructed using these options.
|
|
39
|
+
* - If the value is a function then it can return instance of the [Marker](https://maplibre.org/maplibre-gl-js/docs/API/classes/Marker/).
|
|
40
|
+
* In this case the default pop-up won't be added to the marker.
|
|
41
|
+
* Function can accept `Feature` as a parameter.
|
|
42
|
+
* - If `false` or `null` then no marker will be added to the map.
|
|
43
|
+
*
|
|
44
|
+
* Default value is `true`.
|
|
45
|
+
*/
|
|
46
|
+
showResultMarkers?: null | boolean | MarkerOptions | ((map: MLMap, feature: Feature) => undefined | null | Marker);
|
|
47
|
+
/**
|
|
48
|
+
* Animation to picked feature on the map.
|
|
49
|
+
*
|
|
50
|
+
* - If `false` or `null` then animating the map to a selected result is disabled.
|
|
51
|
+
* - If `true` or `undefined` then animating the map will use the default animation parameters.
|
|
52
|
+
* - If an [FlyToOptions](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/FlyToOptions/)
|
|
53
|
+
* ` & `[FitBoundsOptions](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/FitBoundsOptions/)
|
|
54
|
+
* then it will be passed as options to the map [flyTo](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#flyto)
|
|
55
|
+
* or [fitBounds](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#fitbounds) method providing control over the animation of the transition.
|
|
56
|
+
*
|
|
57
|
+
* Default value is `true`.
|
|
58
|
+
*/
|
|
59
|
+
flyTo?: null | boolean | (FlyToOptions & FitBoundsOptions);
|
|
60
|
+
/**
|
|
61
|
+
* Specifies if selected (not picked) feature should be also animated to on the map.
|
|
62
|
+
*
|
|
63
|
+
* Default: `false`.
|
|
64
|
+
*/
|
|
65
|
+
flyToSelected?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Style for full feature geometry GeoJSON.
|
|
68
|
+
*
|
|
69
|
+
* - If `false` or `null` then no full geometry is drawn.
|
|
70
|
+
* - If `true` or `undefined` then default-styled full geometry is drawn.
|
|
71
|
+
* - If an T then it must represent the style and will be used to style the full geometry.
|
|
72
|
+
*
|
|
73
|
+
* Default is the default style.
|
|
74
|
+
*/
|
|
75
|
+
fullGeometryStyle?: null | boolean | Partial<FullGeometryStyle>;
|
|
76
|
+
/**
|
|
77
|
+
* Style of the picked result on the map:
|
|
78
|
+
* - `"marker-only"`: Show only a marker at the center of the feature.
|
|
79
|
+
* - `"full-geometry"`: Display the full feature geometry.
|
|
80
|
+
* - `"full-geometry-including-polygon-center-marker"`: Display full geometry with a marker at the polygon center.
|
|
81
|
+
*
|
|
82
|
+
* Default: `"full-geometry"`.
|
|
83
|
+
*/
|
|
84
|
+
pickedResultStyle?: PickedResultStyle;
|
|
85
|
+
/**
|
|
86
|
+
* Specifies the zoom level to animate the map to for a geocoded result when no bounding box is present or when the result is a point.
|
|
87
|
+
* If a bounding box is present and not a point, the map will fit to the bounding box.
|
|
88
|
+
*
|
|
89
|
+
* Values are key-value pairs where the key is a `<type>` or `<type>.<category>` and the value is the zoom level.
|
|
90
|
+
*
|
|
91
|
+
* Default: `ZOOM_DEFAULTS`.
|
|
92
|
+
*/
|
|
93
|
+
zoom?: Record<string, number>;
|
|
94
|
+
};
|
|
95
|
+
export type FullGeometryStyle = {
|
|
96
|
+
fill: Pick<FillLayerSpecification, "layout" | "paint" | "filter">;
|
|
97
|
+
line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
|
|
98
|
+
};
|
|
99
|
+
export declare const ZOOM_DEFAULTS: Record<string, number>;
|
|
100
|
+
export declare const DEFAULT_GEOMETRY_STYLE: FullGeometryStyle;
|
|
101
|
+
export declare const RESULT_SOURCE = "mtlr-gc-full-geom";
|
|
102
|
+
export declare const RESULT_LAYER_FILL = "mtlr-gc-full-geom-fill";
|
|
103
|
+
export declare const RESULT_LAYER_LINE = "mtlr-gc-full-geom-line";
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GeocodingControlBase } from './base-control';
|
|
2
|
+
import { MaplibreglGeocodingControl } from './maplibregl-control';
|
|
3
|
+
import { MaptilerGeocodingControlOptions } from './maptilersdk-options';
|
|
4
|
+
export declare class MaptilerGeocodingControl extends MaplibreglGeocodingControl implements GeocodingControlBase<MaptilerGeocodingControlOptions> {
|
|
5
|
+
constructor(options?: MaptilerGeocodingControlOptions);
|
|
6
|
+
setOptions(options: MaptilerGeocodingControlOptions): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { FeaturesListedEvent, MaplibreglGeocodingControlEvent, MaplibreglGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent } from './maplibregl-events';
|
|
2
|
+
export type { FeaturesListedEvent, MaplibreglGeocodingControlEvent as MaptilerGeocodingControlEvent, MaplibreglGeocodingControlEventName as MaptilerGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap as MaptilerGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MaplibreglGeocodingControlOptions } from './maplibregl-options';
|
|
2
|
+
export type MaptilerGeocodingControlOptions = Omit<MaplibreglGeocodingControlOptions, "apiKey"> & {
|
|
3
|
+
/**
|
|
4
|
+
* Maptiler API key.
|
|
5
|
+
*
|
|
6
|
+
* Default: The same API key as the connected map uses.
|
|
7
|
+
*/
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
};
|
|
10
|
+
export { DEFAULT_GEOMETRY_STYLE, RESULT_LAYER_FILL, RESULT_LAYER_LINE, RESULT_SOURCE, ZOOM_DEFAULTS, type FullGeometryStyle } from './maplibregl-options';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Map as OLMap } from 'ol';
|
|
2
|
+
import { Types as ObjectEventTypes } from 'ol/ObjectEventType';
|
|
3
|
+
import { EventTypes } from 'ol/Observable';
|
|
4
|
+
import { Control } from 'ol/control';
|
|
5
|
+
import { EventsKey } from 'ol/events';
|
|
6
|
+
import { default as BaseEvent } from 'ol/events/Event';
|
|
7
|
+
import { GeocodingControlBase } from './base-control';
|
|
8
|
+
import { OpenLayersGeocodingControlEventName, OpenLayersGeocodingControlEventNameMap } from './openlayers-events';
|
|
9
|
+
import { OpenLayersGeocodingControlOptions } from './openlayers-options';
|
|
10
|
+
type TypedBaseEvent<Type extends OpenLayersGeocodingControlEventName> = BaseEvent & {
|
|
11
|
+
type: Type;
|
|
12
|
+
} & OpenLayersGeocodingControlEventNameMap[Type];
|
|
13
|
+
interface EventHandlingMethod {
|
|
14
|
+
(type: EventTypes | ObjectEventTypes, listener: (event: BaseEvent) => unknown): EventsKey;
|
|
15
|
+
<Type extends OpenLayersGeocodingControlEventName>(type: Type, listener: (event: TypedBaseEvent<Type>) => unknown): EventsKey;
|
|
16
|
+
(type: Array<EventTypes | ObjectEventTypes | OpenLayersGeocodingControlEventName>, listener: (event: BaseEvent) => unknown): EventsKey[];
|
|
17
|
+
}
|
|
18
|
+
export declare class OpenLayersGeocodingControl extends Control implements GeocodingControlBase<OpenLayersGeocodingControlOptions> {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(options?: OpenLayersGeocodingControlOptions);
|
|
21
|
+
/** @internal Not to be called directly */
|
|
22
|
+
setMap(map: OLMap | null): void;
|
|
23
|
+
setOptions(options: OpenLayersGeocodingControlOptions): void;
|
|
24
|
+
setQuery(value: string): void;
|
|
25
|
+
submitQuery(value: string): void;
|
|
26
|
+
clearMap(): void;
|
|
27
|
+
clearList(): void;
|
|
28
|
+
setReverseMode(reverseActive: boolean): void;
|
|
29
|
+
focus(options?: FocusOptions): void;
|
|
30
|
+
blur(): void;
|
|
31
|
+
on: EventHandlingMethod;
|
|
32
|
+
once: EventHandlingMethod;
|
|
33
|
+
un: EventHandlingMethod;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Feature as OlFeature } from 'ol';
|
|
2
|
+
import { Point as OlPoint } from 'ol/geom';
|
|
3
|
+
import { Feature } from '../types';
|
|
4
|
+
import type * as Geocoder from "../geocoder/geocoder-events";
|
|
5
|
+
export type ReverseToggleEvent = Geocoder.ReverseToggleEvent["detail"];
|
|
6
|
+
export type QueryChangeEvent = Geocoder.QueryChangeEvent["detail"];
|
|
7
|
+
export type FeaturesListedEvent = Geocoder.FeaturesListedEvent["detail"];
|
|
8
|
+
export type RequestEvent = Geocoder.RequestEvent["detail"];
|
|
9
|
+
export type ResponseEvent = Geocoder.ResponseEvent["detail"];
|
|
10
|
+
export type SelectEvent = Geocoder.SelectEvent["detail"];
|
|
11
|
+
export type PickEvent = Geocoder.PickEvent["detail"];
|
|
12
|
+
export type MarkerClickEvent = {
|
|
13
|
+
feature: Feature;
|
|
14
|
+
marker: OlFeature<OlPoint>;
|
|
15
|
+
};
|
|
16
|
+
export type MarkerMouseEnterEvent = {
|
|
17
|
+
feature: Feature;
|
|
18
|
+
marker: OlFeature<OlPoint>;
|
|
19
|
+
};
|
|
20
|
+
export type MarkerMouseLeaveEvent = {
|
|
21
|
+
feature: Feature;
|
|
22
|
+
marker: OlFeature<OlPoint>;
|
|
23
|
+
};
|
|
24
|
+
export type OpenLayersGeocodingControlEventNameMap = {
|
|
25
|
+
reversetoggle: ReverseToggleEvent;
|
|
26
|
+
querychange: QueryChangeEvent;
|
|
27
|
+
queryclear: never;
|
|
28
|
+
request: RequestEvent;
|
|
29
|
+
response: ResponseEvent;
|
|
30
|
+
select: SelectEvent;
|
|
31
|
+
pick: PickEvent;
|
|
32
|
+
featuresshow: never;
|
|
33
|
+
featureshide: never;
|
|
34
|
+
featureslisted: FeaturesListedEvent;
|
|
35
|
+
featuresclear: never;
|
|
36
|
+
focusin: never;
|
|
37
|
+
focusout: never;
|
|
38
|
+
markerclick: MarkerClickEvent;
|
|
39
|
+
markermouseenter: MarkerMouseEnterEvent;
|
|
40
|
+
markermouseleave: MarkerMouseLeaveEvent;
|
|
41
|
+
};
|
|
42
|
+
export type OpenLayersGeocodingControlEvent = OpenLayersGeocodingControlEventNameMap[keyof OpenLayersGeocodingControlEventNameMap];
|
|
43
|
+
export type OpenLayersGeocodingControlEventName = keyof OpenLayersGeocodingControlEventNameMap;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AnimationOptions, FitOptions } from 'ol/View';
|
|
2
|
+
import { Options } from 'ol/control/Control';
|
|
3
|
+
import { StyleFunction, StyleLike } from 'ol/style/Style';
|
|
4
|
+
import { FlatStyleLike } from 'ol/style/flat';
|
|
5
|
+
import { MaptilerGeocoderOptions } from '../geocoder/geocoder-options';
|
|
6
|
+
import { PickedResultStyle } from '../types';
|
|
7
|
+
export type OpenLayersGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "fetchFullGeometryOnPick"> & {
|
|
8
|
+
/**
|
|
9
|
+
* Marker to be added to the map at the location of the user-selected result.
|
|
10
|
+
*
|
|
11
|
+
* Default value is `true`.
|
|
12
|
+
*/
|
|
13
|
+
marker?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Displays a marker on the selected feature from the result list. `marker` must be also enabled for this to display.
|
|
16
|
+
*
|
|
17
|
+
* Default: `true`.
|
|
18
|
+
*/
|
|
19
|
+
markerOnSelected?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Marker be added to the map at the location the geocoding results.
|
|
22
|
+
*
|
|
23
|
+
* Default value is `true`.
|
|
24
|
+
*/
|
|
25
|
+
showResultMarkers?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Animation to picked feature on the map.
|
|
28
|
+
*
|
|
29
|
+
* - If `false` or `null` then animating the map to a selected result is disabled.
|
|
30
|
+
* - If `true` or `undefined` then animating the map will use the default animation parameters.
|
|
31
|
+
* - If the value is [AnimationOptions](https://openlayers.org/en/latest/apidoc/module-ol_View.html#~AnimationOptions)
|
|
32
|
+
* and [FitOptions](https://openlayers.org/en/latest/apidoc/module-ol_View.html#~FitOptions)
|
|
33
|
+
* then it will be passed as options to the map's view [animate](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#animate)
|
|
34
|
+
* or [fit](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit) method providing control over the animation of the transition.
|
|
35
|
+
*
|
|
36
|
+
* Default value is `true`.
|
|
37
|
+
*/
|
|
38
|
+
flyTo?: null | boolean | (AnimationOptions & FitOptions);
|
|
39
|
+
/**
|
|
40
|
+
* Specifies if selected (not picked) feature should be also animated to on the map.
|
|
41
|
+
*
|
|
42
|
+
* Default: `false`.
|
|
43
|
+
*/
|
|
44
|
+
flyToSelected?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Style for full feature geometry GeoJSON.
|
|
47
|
+
*
|
|
48
|
+
* - If `false` or `null` then no full geometry is drawn.
|
|
49
|
+
* - If `true` or `undefined` then default-styled full geometry is drawn.
|
|
50
|
+
* - If the value is [StyleLike](https://openlayers.org/en/latest/apidoc/module-ol_style_Style.html#~StyleLike)
|
|
51
|
+
* or [FlatStyleLike](https://openlayers.org/en/latest/apidoc/module-ol_style_flat.html#~FlatStyleLike)
|
|
52
|
+
* then it must represent the style and will be used to style the full geometry.
|
|
53
|
+
*
|
|
54
|
+
* Default is the default style.
|
|
55
|
+
*/
|
|
56
|
+
fullGeometryStyle?: null | boolean | StyleLike | FlatStyleLike;
|
|
57
|
+
/**
|
|
58
|
+
* Opens the Geocoder result list above the query input instead of below. Used when positioned near the bottom of a map.
|
|
59
|
+
*
|
|
60
|
+
* Default: `false`.
|
|
61
|
+
*/
|
|
62
|
+
openListOnTop?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Style of the picked result on the map:
|
|
65
|
+
* - `"marker-only"`: Show only a marker at the center of the feature.
|
|
66
|
+
* - `"full-geometry"`: Display the full feature geometry.
|
|
67
|
+
* - `"full-geometry-including-polygon-center-marker"`: Display full geometry with a marker at the polygon center.
|
|
68
|
+
*
|
|
69
|
+
* Default: `"full-geometry"`.
|
|
70
|
+
*/
|
|
71
|
+
pickedResultStyle?: PickedResultStyle;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies the zoom level to animate the map to for a geocoded result when no bounding box is present or when the result is a point.
|
|
74
|
+
* If a bounding box is present and not a point, the map will fit to the bounding box.
|
|
75
|
+
*
|
|
76
|
+
* Values are key-value pairs where the key is a `<type>` or `<type>.<category>` and the value is the zoom level.
|
|
77
|
+
*
|
|
78
|
+
* Default: `ZOOM_DEFAULTS`.
|
|
79
|
+
*/
|
|
80
|
+
zoom?: Record<string, number>;
|
|
81
|
+
} & Omit<Options, "element">;
|
|
82
|
+
export declare const ZOOM_DEFAULTS: Record<string, number>;
|
|
83
|
+
export declare const DEFAULT_GEOMETRY_STYLE: (options: OpenLayersGeocodingControlOptions) => StyleFunction;
|