@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.
Files changed (338) hide show
  1. package/CODE_OF_CONDUCT.md +46 -0
  2. package/CONTRIBUTING.md +72 -0
  3. package/README.md +115 -43
  4. package/SECURITY.md +16 -0
  5. package/dist/index.js +860 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.umd.js +263 -0
  8. package/dist/index.umd.js.map +1 -0
  9. package/dist/leaflet.public.js +1251 -0
  10. package/dist/leaflet.public.js.map +1 -0
  11. package/dist/leaflet.public.umd.js +276 -0
  12. package/dist/leaflet.public.umd.js.map +1 -0
  13. package/dist/maplibregl.js +1275 -0
  14. package/dist/maplibregl.js.map +1 -0
  15. package/dist/maplibregl.umd.js +276 -0
  16. package/dist/maplibregl.umd.js.map +1 -0
  17. package/dist/maptilersdk.js +1283 -0
  18. package/dist/maptilersdk.js.map +1 -0
  19. package/dist/maptilersdk.umd.js +276 -0
  20. package/dist/maptilersdk.umd.js.map +1 -0
  21. package/dist/src/components/clear-icon.d.ts +10 -0
  22. package/dist/src/components/fail-icon.d.ts +10 -0
  23. package/dist/src/components/loading-icon.d.ts +10 -0
  24. package/dist/src/components/marker.d.ts +10 -0
  25. package/dist/src/components/reverse-geocoding-icon.d.ts +10 -0
  26. package/dist/src/components/search-icon.d.ts +10 -0
  27. package/dist/src/controls/base-control.d.ts +44 -0
  28. package/dist/src/controls/leaflet-control.d.ts +27 -0
  29. package/dist/src/controls/leaflet-events.d.ts +42 -0
  30. package/dist/src/controls/leaflet-options.d.ts +84 -0
  31. package/dist/src/controls/maplibregl-control.d.ts +34 -0
  32. package/dist/src/controls/maplibregl-events.d.ts +44 -0
  33. package/dist/src/controls/maplibregl-options.d.ts +104 -0
  34. package/dist/src/controls/maptilersdk-control.d.ts +7 -0
  35. package/dist/src/controls/maptilersdk-events.d.ts +2 -0
  36. package/dist/src/controls/maptilersdk-options.d.ts +10 -0
  37. package/dist/src/controls/openlayers-control.d.ts +35 -0
  38. package/dist/src/controls/openlayers-events.d.ts +43 -0
  39. package/dist/src/controls/openlayers-options.d.ts +83 -0
  40. package/dist/src/geocoder/geocoder-events.d.ts +46 -0
  41. package/dist/src/geocoder/geocoder-feature-item.d.ts +22 -0
  42. package/{svelte/types.d.ts → dist/src/geocoder/geocoder-options.d.ts} +23 -143
  43. package/dist/src/geocoder/geocoder.d.ts +113 -0
  44. package/dist/src/index.d.ts +9 -0
  45. package/dist/src/leaflet.public.d.ts +7 -0
  46. package/dist/src/maplibregl.d.ts +7 -0
  47. package/dist/src/maptilersdk.d.ts +7 -0
  48. package/dist/src/openlayers.public.d.ts +7 -0
  49. package/dist/src/types.d.ts +46 -0
  50. package/dist/src/utils/geo-utils.d.ts +6 -0
  51. package/dist/src/utils/mask.d.ts +2 -0
  52. package/dist/src/utils/proximity.d.ts +2 -0
  53. package/package.json +84 -112
  54. package/MapLibreBasedGeocodingControl.d.ts +0 -3072
  55. package/geo-coordinates-parser.t.d.ts +0 -8
  56. package/geoUtils.d.ts +0 -3
  57. package/leaflet-controller.d.ts +0 -12
  58. package/leaflet-controller.js +0 -2475
  59. package/leaflet-controller.js.map +0 -1
  60. package/leaflet-controller.umd.js +0 -2
  61. package/leaflet-controller.umd.js.map +0 -1
  62. package/leaflet.d.ts +0 -131
  63. package/leaflet.js +0 -5082
  64. package/leaflet.js.map +0 -1
  65. package/leaflet.umd.js +0 -14
  66. package/leaflet.umd.js.map +0 -1
  67. package/maplibregl-controller.d.ts +0 -19
  68. package/maplibregl-controller.js +0 -2418
  69. package/maplibregl-controller.js.map +0 -1
  70. package/maplibregl-controller.umd.js +0 -2
  71. package/maplibregl-controller.umd.js.map +0 -1
  72. package/maplibregl.d.ts +0 -2509
  73. package/maplibregl.js +0 -5142
  74. package/maplibregl.js.map +0 -1
  75. package/maplibregl.umd.js +0 -14
  76. package/maplibregl.umd.js.map +0 -1
  77. package/maptilersdk.d.ts +0 -2504
  78. package/maptilersdk.js +0 -5152
  79. package/maptilersdk.js.map +0 -1
  80. package/maptilersdk.umd.js +0 -14
  81. package/maptilersdk.umd.js.map +0 -1
  82. package/mask.d.ts +0 -2
  83. package/openlayers-controller.d.ts +0 -15
  84. package/openlayers-controller.js +0 -2174
  85. package/openlayers-controller.js.map +0 -1
  86. package/openlayers-controller.umd.js +0 -2
  87. package/openlayers-controller.umd.js.map +0 -1
  88. package/openlayers.d.ts +0 -109
  89. package/openlayers.js +0 -5045
  90. package/openlayers.js.map +0 -1
  91. package/openlayers.umd.js +0 -14
  92. package/openlayers.umd.js.map +0 -1
  93. package/proximity.d.ts +0 -2
  94. package/react.d.ts +0 -45
  95. package/react.js +0 -2795
  96. package/react.js.map +0 -1
  97. package/react.umd.js +0 -14
  98. package/react.umd.js.map +0 -1
  99. package/style.css +0 -1
  100. package/svelte/ClearIcon.svelte +0 -12
  101. package/svelte/ClearIcon.svelte.d.ts +0 -25
  102. package/svelte/FailIcon.svelte +0 -12
  103. package/svelte/FailIcon.svelte.d.ts +0 -25
  104. package/svelte/FeatureItem.svelte +0 -246
  105. package/svelte/FeatureItem.svelte.d.ts +0 -26
  106. package/svelte/GeocodingControl.svelte +0 -921
  107. package/svelte/GeocodingControl.svelte.d.ts +0 -105
  108. package/svelte/LoadingIcon.svelte +0 -40
  109. package/svelte/LoadingIcon.svelte.d.ts +0 -25
  110. package/svelte/MapLibreBasedGeocodingControl.d.ts +0 -3072
  111. package/svelte/MapLibreBasedGeocodingControl.js +0 -210
  112. package/svelte/MarkerIcon.svelte +0 -71
  113. package/svelte/MarkerIcon.svelte.d.ts +0 -18
  114. package/svelte/ReverseGeocodingIcon.svelte +0 -12
  115. package/svelte/ReverseGeocodingIcon.svelte.d.ts +0 -25
  116. package/svelte/SearchIcon.svelte +0 -26
  117. package/svelte/SearchIcon.svelte.d.ts +0 -25
  118. package/svelte/geo-coordinates-parser.t.d.ts +0 -8
  119. package/svelte/geo-coordinates-parser.t.js +0 -1
  120. package/svelte/geoUtils.d.ts +0 -3
  121. package/svelte/geoUtils.js +0 -18
  122. package/svelte/info.json +0 -1
  123. package/svelte/leaflet-controller.d.ts +0 -12
  124. package/svelte/leaflet-controller.js +0 -274
  125. package/svelte/leaflet.d.ts +0 -131
  126. package/svelte/leaflet.js +0 -116
  127. package/svelte/maplibregl-controller.d.ts +0 -19
  128. package/svelte/maplibregl-controller.js +0 -279
  129. package/svelte/maplibregl.d.ts +0 -2509
  130. package/svelte/maplibregl.js +0 -17
  131. package/svelte/maptilersdk.d.ts +0 -2504
  132. package/svelte/maptilersdk.js +0 -32
  133. package/svelte/mask.d.ts +0 -2
  134. package/svelte/mask.js +0 -54
  135. package/svelte/openlayers-controller.d.ts +0 -15
  136. package/svelte/openlayers-controller.js +0 -283
  137. package/svelte/openlayers.d.ts +0 -109
  138. package/svelte/openlayers.js +0 -178
  139. package/svelte/proximity.d.ts +0 -2
  140. package/svelte/proximity.js +0 -60
  141. package/svelte/react.d.ts +0 -45
  142. package/svelte/react.js +0 -106
  143. package/svelte/types.js +0 -1
  144. package/svelte/vanilla.d.ts +0 -61
  145. package/svelte/vanilla.js +0 -101
  146. package/svelte/vite-env.d.ts +0 -2
  147. package/types.d.ts +0 -391
  148. package/vanilla.d.ts +0 -61
  149. package/vanilla.js +0 -2799
  150. package/vanilla.js.map +0 -1
  151. package/vanilla.umd.js +0 -14
  152. package/vanilla.umd.js.map +0 -1
  153. /package/{icons → dist/icons}/10pin.svg +0 -0
  154. /package/{icons → dist/icons}/9pin.svg +0 -0
  155. /package/{icons → dist/icons}/advertising_column.svg +0 -0
  156. /package/{icons → dist/icons}/aerodrome.svg +0 -0
  157. /package/{icons → dist/icons}/alcohol.svg +0 -0
  158. /package/{icons → dist/icons}/alpine_hut.svg +0 -0
  159. /package/{icons → dist/icons}/amusement_arcade.svg +0 -0
  160. /package/{icons → dist/icons}/amusement_park.svg +0 -0
  161. /package/{icons → dist/icons}/apartment.svg +0 -0
  162. /package/{icons → dist/icons}/archaeological_site.svg +0 -0
  163. /package/{icons → dist/icons}/area.svg +0 -0
  164. /package/{icons → dist/icons}/art.svg +0 -0
  165. /package/{icons → dist/icons}/arts_centre.svg +0 -0
  166. /package/{icons → dist/icons}/artwork.svg +0 -0
  167. /package/{icons → dist/icons}/audioguide.svg +0 -0
  168. /package/{icons → dist/icons}/bag.svg +0 -0
  169. /package/{icons → dist/icons}/beauty.svg +0 -0
  170. /package/{icons → dist/icons}/bed.svg +0 -0
  171. /package/{icons → dist/icons}/bell_tower.svg +0 -0
  172. /package/{icons → dist/icons}/beverages.svg +0 -0
  173. /package/{icons → dist/icons}/bicycle_repair_station.svg +0 -0
  174. /package/{icons → dist/icons}/biergarten.svg +0 -0
  175. /package/{icons → dist/icons}/bird_hide.svg +0 -0
  176. /package/{icons → dist/icons}/boat_rental.svg +0 -0
  177. /package/{icons → dist/icons}/bookmaker.svg +0 -0
  178. /package/{icons → dist/icons}/books.svg +0 -0
  179. /package/{icons → dist/icons}/bowl.svg +0 -0
  180. /package/{icons → dist/icons}/bowling_alley.svg +0 -0
  181. /package/{icons → dist/icons}/bunker.svg +0 -0
  182. /package/{icons → dist/icons}/bureau_de_change.svg +0 -0
  183. /package/{icons → dist/icons}/bus_station.svg +0 -0
  184. /package/{icons → dist/icons}/bust.svg +0 -0
  185. /package/{icons → dist/icons}/camping.svg +0 -0
  186. /package/{icons → dist/icons}/car_parts.svg +0 -0
  187. /package/{icons → dist/icons}/car_wash.svg +0 -0
  188. /package/{icons → dist/icons}/caravan_park.svg +0 -0
  189. /package/{icons → dist/icons}/carpet.svg +0 -0
  190. /package/{icons → dist/icons}/cattle_grid.svg +0 -0
  191. /package/{icons → dist/icons}/cave_entrance.svg +0 -0
  192. /package/{icons → dist/icons}/chalet.svg +0 -0
  193. /package/{icons → dist/icons}/charity.svg +0 -0
  194. /package/{icons → dist/icons}/chemist.svg +0 -0
  195. /package/{icons → dist/icons}/chimney.svg +0 -0
  196. /package/{icons → dist/icons}/church.svg +0 -0
  197. /package/{icons → dist/icons}/city_gate.svg +0 -0
  198. /package/{icons → dist/icons}/clinic.svg +0 -0
  199. /package/{icons → dist/icons}/clothes.svg +0 -0
  200. /package/{icons → dist/icons}/coffee.svg +0 -0
  201. /package/{icons → dist/icons}/community_centre.svg +0 -0
  202. /package/{icons → dist/icons}/computer.svg +0 -0
  203. /package/{icons → dist/icons}/consulate.svg +0 -0
  204. /package/{icons → dist/icons}/copyshop.svg +0 -0
  205. /package/{icons → dist/icons}/cosmetics.svg +0 -0
  206. /package/{icons → dist/icons}/courthouse.svg +0 -0
  207. /package/{icons → dist/icons}/crane.svg +0 -0
  208. /package/{icons → dist/icons}/dairy.svg +0 -0
  209. /package/{icons → dist/icons}/deli.svg +0 -0
  210. /package/{icons → dist/icons}/department_store.svg +0 -0
  211. /package/{icons → dist/icons}/diy.svg +0 -0
  212. /package/{icons → dist/icons}/electronics.svg +0 -0
  213. /package/{icons → dist/icons}/embankment.svg +0 -0
  214. /package/{icons → dist/icons}/embassy.svg +0 -0
  215. /package/{icons → dist/icons}/excrement_bags.svg +0 -0
  216. /package/{icons → dist/icons}/fabric.svg +0 -0
  217. /package/{icons → dist/icons}/farmyard.svg +0 -0
  218. /package/{icons → dist/icons}/ferry.svg +0 -0
  219. /package/{icons → dist/icons}/firepit.svg +0 -0
  220. /package/{icons → dist/icons}/firestation.svg +0 -0
  221. /package/{icons → dist/icons}/fishing.svg +0 -0
  222. /package/{icons → dist/icons}/fitness.svg +0 -0
  223. /package/{icons → dist/icons}/ford.svg +0 -0
  224. /package/{icons → dist/icons}/fort.svg +0 -0
  225. /package/{icons → dist/icons}/fortress.svg +0 -0
  226. /package/{icons → dist/icons}/full-height_turnstile.svg +0 -0
  227. /package/{icons → dist/icons}/generator_wind.svg +0 -0
  228. /package/{icons → dist/icons}/golf_pin.svg +0 -0
  229. /package/{icons → dist/icons}/greengrocer.svg +0 -0
  230. /package/{icons → dist/icons}/guest_house.svg +0 -0
  231. /package/{icons → dist/icons}/helipad.svg +0 -0
  232. /package/{icons → dist/icons}/hifi.svg +0 -0
  233. /package/{icons → dist/icons}/hostel.svg +0 -0
  234. /package/{icons → dist/icons}/hotel.svg +0 -0
  235. /package/{icons → dist/icons}/housenumber.svg +0 -0
  236. /package/{icons → dist/icons}/houseware.svg +0 -0
  237. /package/{icons → dist/icons}/hunting_stand.svg +0 -0
  238. /package/{icons → dist/icons}/interior_decoration.svg +0 -0
  239. /package/{icons → dist/icons}/internet_cafe.svg +0 -0
  240. /package/{icons → dist/icons}/kindergarten.svg +0 -0
  241. /package/{icons → dist/icons}/kissing_gate.svg +0 -0
  242. /package/{icons → dist/icons}/manor.svg +0 -0
  243. /package/{icons → dist/icons}/map.svg +0 -0
  244. /package/{icons → dist/icons}/marker_reverse.svg +0 -0
  245. /package/{icons → dist/icons}/marker_selected.svg +0 -0
  246. /package/{icons → dist/icons}/marker_unselected.svg +0 -0
  247. /package/{icons → dist/icons}/marketplace.svg +0 -0
  248. /package/{icons → dist/icons}/massage.svg +0 -0
  249. /package/{icons → dist/icons}/mast.svg +0 -0
  250. /package/{icons → dist/icons}/mast_communications.svg +0 -0
  251. /package/{icons → dist/icons}/mast_lighting.svg +0 -0
  252. /package/{icons → dist/icons}/medical_supply.svg +0 -0
  253. /package/{icons → dist/icons}/memorial.svg +0 -0
  254. /package/{icons → dist/icons}/miniature_golf.svg +0 -0
  255. /package/{icons → dist/icons}/motel.svg +0 -0
  256. /package/{icons → dist/icons}/mountain_range.svg +0 -0
  257. /package/{icons → dist/icons}/multifaith.svg +0 -0
  258. /package/{icons → dist/icons}/musical_instrument.svg +0 -0
  259. /package/{icons → dist/icons}/newsagent.svg +0 -0
  260. /package/{icons → dist/icons}/nightclub.svg +0 -0
  261. /package/{icons → dist/icons}/ocean.svg +0 -0
  262. /package/{icons → dist/icons}/office.svg +0 -0
  263. /package/{icons → dist/icons}/outdoor_seating.svg +0 -0
  264. /package/{icons → dist/icons}/palace.svg +0 -0
  265. /package/{icons → dist/icons}/parcel_locker.svg +0 -0
  266. /package/{icons → dist/icons}/parking_space.svg +0 -0
  267. /package/{icons → dist/icons}/parking_tickets.svg +0 -0
  268. /package/{icons → dist/icons}/pet.svg +0 -0
  269. /package/{icons → dist/icons}/photo.svg +0 -0
  270. /package/{icons → dist/icons}/picnic.svg +0 -0
  271. /package/{icons → dist/icons}/plaque.svg +0 -0
  272. /package/{icons → dist/icons}/poi.svg +0 -0
  273. /package/{icons → dist/icons}/post_box.svg +0 -0
  274. /package/{icons → dist/icons}/post_office.svg +0 -0
  275. /package/{icons → dist/icons}/postal_code.svg +0 -0
  276. /package/{icons → dist/icons}/pub.svg +0 -0
  277. /package/{icons → dist/icons}/public_bath.svg +0 -0
  278. /package/{icons → dist/icons}/public_bookcase.svg +0 -0
  279. /package/{icons → dist/icons}/public_building.svg +0 -0
  280. /package/{icons → dist/icons}/public_transport_tickets.svg +0 -0
  281. /package/{icons → dist/icons}/reverse.svg +0 -0
  282. /package/{icons → dist/icons}/river.svg +0 -0
  283. /package/{icons → dist/icons}/road.svg +0 -0
  284. /package/{icons → dist/icons}/saddle.svg +0 -0
  285. /package/{icons → dist/icons}/sauna.svg +0 -0
  286. /package/{icons → dist/icons}/sea.svg +0 -0
  287. /package/{icons → dist/icons}/second_hand.svg +0 -0
  288. /package/{icons → dist/icons}/shintoist.svg +0 -0
  289. /package/{icons → dist/icons}/shoe.svg +0 -0
  290. /package/{icons → dist/icons}/shower.svg +0 -0
  291. /package/{icons → dist/icons}/shrine.svg +0 -0
  292. /package/{icons → dist/icons}/sikhist.svg +0 -0
  293. /package/{icons → dist/icons}/slipway.svg +0 -0
  294. /package/{icons → dist/icons}/snowmobile.svg +0 -0
  295. /package/{icons → dist/icons}/social_facility.svg +0 -0
  296. /package/{icons → dist/icons}/sports.svg +0 -0
  297. /package/{icons → dist/icons}/sprite.json +0 -0
  298. /package/{icons → dist/icons}/sprite.png +0 -0
  299. /package/{icons → dist/icons}/sprite@2x.json +0 -0
  300. /package/{icons → dist/icons}/sprite@2x.png +0 -0
  301. /package/{icons → dist/icons}/stationery.svg +0 -0
  302. /package/{icons → dist/icons}/stile.svg +0 -0
  303. /package/{icons → dist/icons}/stone.svg +0 -0
  304. /package/{icons → dist/icons}/storage_tank.svg +0 -0
  305. /package/{icons → dist/icons}/stream.svg +0 -0
  306. /package/{icons → dist/icons}/street.svg +0 -0
  307. /package/{icons → dist/icons}/supermarket.svg +0 -0
  308. /package/{icons → dist/icons}/tea.svg +0 -0
  309. /package/{icons → dist/icons}/telescope_dish.svg +0 -0
  310. /package/{icons → dist/icons}/telescope_dome.svg +0 -0
  311. /package/{icons → dist/icons}/ticket.svg +0 -0
  312. /package/{icons → dist/icons}/tobacco.svg +0 -0
  313. /package/{icons → dist/icons}/tower_cantilever_communication.svg +0 -0
  314. /package/{icons → dist/icons}/tower_cooling.svg +0 -0
  315. /package/{icons → dist/icons}/tower_dish.svg +0 -0
  316. /package/{icons → dist/icons}/tower_dome.svg +0 -0
  317. /package/{icons → dist/icons}/tower_generic.svg +0 -0
  318. /package/{icons → dist/icons}/tower_lattice.svg +0 -0
  319. /package/{icons → dist/icons}/tower_lattice_communication.svg +0 -0
  320. /package/{icons → dist/icons}/tower_lattice_lighting.svg +0 -0
  321. /package/{icons → dist/icons}/tower_lighting.svg +0 -0
  322. /package/{icons → dist/icons}/townhall.svg +0 -0
  323. /package/{icons → dist/icons}/toys.svg +0 -0
  324. /package/{icons → dist/icons}/trade.svg +0 -0
  325. /package/{icons → dist/icons}/traffic_light.svg +0 -0
  326. /package/{icons → dist/icons}/train_station.svg +0 -0
  327. /package/{icons → dist/icons}/travel_agency.svg +0 -0
  328. /package/{icons → dist/icons}/tyres.svg +0 -0
  329. /package/{icons → dist/icons}/university.svg +0 -0
  330. /package/{icons → dist/icons}/variety_store.svg +0 -0
  331. /package/{icons → dist/icons}/vehicle_inspection.svg +0 -0
  332. /package/{icons → dist/icons}/vending_machine.svg +0 -0
  333. /package/{icons → dist/icons}/video.svg +0 -0
  334. /package/{icons → dist/icons}/video_games.svg +0 -0
  335. /package/{icons → dist/icons}/waste_disposal.svg +0 -0
  336. /package/{icons → dist/icons}/water_well.svg +0 -0
  337. /package/{icons → dist/icons}/waterfall.svg +0 -0
  338. /package/{icons → dist/icons}/wilderness_hut.svg +0 -0
@@ -1,921 +0,0 @@
1
- <script>import { createEventDispatcher, onDestroy } from "svelte";
2
- import { default as ClearIcon } from "./ClearIcon.svelte";
3
- import { default as FailIcon } from "./FailIcon.svelte";
4
- import { default as FeatureItem } from "./FeatureItem.svelte";
5
- import { default as LoadingIcon } from "./LoadingIcon.svelte";
6
- import MarkerIcon from "./MarkerIcon.svelte";
7
- import { default as ReverseGeocodingIcon } from "./ReverseGeocodingIcon.svelte";
8
- import { default as SearchIcon } from "./SearchIcon.svelte";
9
- import { unwrapBbox, wrapNum } from "./geoUtils";
10
- import { getProximity } from "./proximity";
11
- import { convert } from "geo-coordinates-parser";
12
- export const ZOOM_DEFAULTS = {
13
- continental_marine: 4,
14
- country: 4,
15
- major_landform: 8,
16
- region: 5,
17
- subregion: 6,
18
- county: 7,
19
- joint_municipality: 8,
20
- joint_submunicipality: 9,
21
- municipality: 10,
22
- municipal_district: 11,
23
- locality: 12,
24
- neighbourhood: 13,
25
- place: 14,
26
- postal_code: 14,
27
- road: 16,
28
- poi: 17,
29
- address: 18,
30
- "poi.peak": 15,
31
- "poi.shop": 18,
32
- "poi.cafe": 18,
33
- "poi.restaurant": 18,
34
- "poi.aerodrome": 13,
35
- // TODO add many more
36
- };
37
- let className = undefined;
38
- export { className as class };
39
- export let apiKey = undefined;
40
- export let bbox = undefined;
41
- export let clearButtonTitle = "clear";
42
- export let clearOnBlur = false;
43
- export let clearListOnPick = false;
44
- export let keepListOpen = false;
45
- export let collapsed = false;
46
- export let country = undefined;
47
- export let debounceSearch = 200;
48
- export let enableReverse = "never";
49
- export let errorMessage = "Something went wrong…";
50
- export let filter = () => true;
51
- export let flyTo = true;
52
- export let fuzzyMatch = true;
53
- export let language = undefined;
54
- export let limit = undefined;
55
- const COPY_LIMIT = +41415112612;
56
- export let reverseGeocodingLimit = COPY_LIMIT;
57
- export let mapController = undefined;
58
- export let minLength = 2;
59
- export let noResultsMessage = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!";
60
- export let placeholder = "Search";
61
- export let proximity = [
62
- { type: "server-geolocation" },
63
- ];
64
- export let reverseActive = enableReverse === "always";
65
- export let reverseButtonTitle = "toggle reverse geocoding";
66
- export let searchValue = "";
67
- export let pickedResultStyle = "full-geometry";
68
- export let showPlaceType = "if-needed";
69
- export let showResultsWhileTyping = true;
70
- export let selectFirst = true;
71
- export let flyToSelected = false;
72
- export let markerOnSelected = true;
73
- export let types = undefined;
74
- const COPY_TYPES = [];
75
- export let reverseGeocodingTypes = COPY_TYPES;
76
- export let exhaustiveReverseGeocoding = false;
77
- export let excludeTypes = false;
78
- const COPY_EXCLUDE_TYPES = undefined;
79
- export let reverseGeocodingExcludeTypes = COPY_EXCLUDE_TYPES;
80
- export let zoom = ZOOM_DEFAULTS;
81
- export let apiUrl = "https://api.maptiler.com/geocoding";
82
- export let fetchParameters = {};
83
- export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
84
- "2.1.7" +
85
- "/icons/";
86
- /**
87
- * @deprecated use `adjustUrl`
88
- */
89
- export let adjustUrlQuery = () => { };
90
- /**
91
- * Adjust geocoding URL before the fetch.
92
- */
93
- export let adjustUrl = () => { };
94
- /**
95
- * Focus the search input box.
96
- *
97
- * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
98
- */
99
- export function focus(options) {
100
- input.focus(options);
101
- }
102
- /**
103
- * Blur the search input box.
104
- */
105
- export function blur() {
106
- input.blur();
107
- }
108
- /**
109
- * Set the content of search input box.
110
- *
111
- * @param value text to set
112
- * @param submit perform the search
113
- */
114
- export function setQuery(value, submit = true, reverse = false) {
115
- searchValue = value;
116
- if (submit) {
117
- selectedItemIndex = -1;
118
- handleSubmit();
119
- }
120
- else {
121
- handleInput(undefined, !reverse, reverse);
122
- setTimeout(() => {
123
- input.focus();
124
- input.select();
125
- });
126
- }
127
- }
128
- /**
129
- * Clear search result list.
130
- */
131
- export function clearList() {
132
- listFeatures = undefined;
133
- picked = undefined;
134
- selectedItemIndex = -1;
135
- }
136
- /**
137
- * Clear geocoding search results from the map.
138
- */
139
- export function clearMap() {
140
- markedFeatures = [];
141
- picked = undefined;
142
- }
143
- let listFeatures;
144
- let markedFeatures;
145
- let picked;
146
- let lastSearchUrl = "";
147
- let input;
148
- let selectedItemIndex = -1;
149
- let error;
150
- let cachedFeatures = [];
151
- let abortController;
152
- let searchTimeoutRef;
153
- let focusedDelayed;
154
- let prevIdToFly;
155
- let focused = false;
156
- const missingIconsCache = new Set();
157
- const dispatch = createEventDispatcher();
158
- $: reverseActive = enableReverse === "always";
159
- $: if (pickedResultStyle !== "marker-only" &&
160
- picked &&
161
- !picked.address &&
162
- picked.geometry.type === "Point" &&
163
- picked.place_type[0] !== "reverse") {
164
- search(picked.id, { byId: true }).catch((err) => (error = err));
165
- }
166
- $: {
167
- if (mapController && picked && picked.id !== prevIdToFly && flyTo) {
168
- goToPicked();
169
- if (clearListOnPick) {
170
- listFeatures = undefined;
171
- }
172
- markedFeatures = undefined;
173
- selectedItemIndex = -1;
174
- }
175
- prevIdToFly = picked?.id;
176
- }
177
- $: if (mapController && selected && flyTo && flyToSelected) {
178
- mapController.flyTo(selected.center, computeZoom(selected));
179
- }
180
- $: showPolygonMarker =
181
- pickedResultStyle === "full-geometry-including-polygon-center-marker";
182
- // if markerOnSelected was dynamically changed to false
183
- $: if (!markerOnSelected) {
184
- mapController?.setFeatures(undefined, undefined, showPolygonMarker);
185
- }
186
- $: if (mapController && markerOnSelected && !markedFeatures) {
187
- mapController.setFeatures(selected ? [selected] : undefined, picked, showPolygonMarker);
188
- mapController.setSelectedMarker(selected ? 0 : -1);
189
- }
190
- $: if (markedFeatures !== listFeatures) {
191
- markedFeatures = undefined;
192
- }
193
- $: if (mapController) {
194
- mapController.setFeatures(markedFeatures, picked, showPolygonMarker);
195
- }
196
- $: if (searchValue.length < minLength) {
197
- listFeatures = undefined;
198
- error = undefined;
199
- markedFeatures = listFeatures;
200
- }
201
- // highlight selected marker
202
- $: if (markedFeatures && mapController) {
203
- mapController.setSelectedMarker(selectedItemIndex);
204
- }
205
- // close dropdown in the next cycle so that the selected item event has the chance to fire
206
- $: setTimeout(() => {
207
- focusedDelayed = focused;
208
- if (clearOnBlur && !focusedDelayed) {
209
- searchValue = "";
210
- }
211
- });
212
- $: if (selectFirst &&
213
- listFeatures?.length &&
214
- selectedItemIndex == -1 &&
215
- !picked) {
216
- selectedItemIndex = 0;
217
- }
218
- $: selected = listFeatures?.[selectedItemIndex];
219
- $: if (mapController) {
220
- const coords = isQueryReverse(searchValue);
221
- mapController.setReverseMarker(coords ? [coords.decimalLongitude, coords.decimalLatitude] : undefined);
222
- }
223
- $: dispatch("select", { feature: selected });
224
- $: dispatch("pick", { feature: picked });
225
- $: optionsVisible =
226
- !!listFeatures?.length && (focusedDelayed || keepListOpen);
227
- $: dispatch("optionsvisibilitychange", { optionsVisible });
228
- $: dispatch("featureslisted", { features: listFeatures });
229
- $: dispatch("featuresmarked", { features: markedFeatures });
230
- $: dispatch("reversetoggle", { reverse: reverseActive });
231
- $: dispatch("querychange", { query: searchValue });
232
- $: if (mapController) {
233
- mapController.indicateReverse(reverseActive);
234
- }
235
- $: if (mapController) {
236
- mapController.setEventHandler((e) => {
237
- switch (e.type) {
238
- case "mapClick":
239
- if (reverseActive) {
240
- handleReverse(e.coordinates);
241
- }
242
- break;
243
- case "markerClick":
244
- {
245
- const feature = listFeatures?.find((feature) => feature.id === e.id);
246
- if (feature) {
247
- pick(feature);
248
- }
249
- }
250
- break;
251
- case "markerMouseEnter":
252
- if (markedFeatures) {
253
- selectedItemIndex = !focusedDelayed
254
- ? -1
255
- : (listFeatures?.findIndex((feature) => feature.id === e.id) ??
256
- -1);
257
- }
258
- break;
259
- case "markerMouseLeave":
260
- if (markedFeatures) {
261
- selectedItemIndex = -1;
262
- }
263
- break;
264
- }
265
- });
266
- }
267
- onDestroy(() => {
268
- if (mapController) {
269
- mapController.setEventHandler(undefined);
270
- mapController.indicateReverse(false);
271
- mapController.setSelectedMarker(-1);
272
- mapController.setFeatures(undefined, undefined, false);
273
- }
274
- });
275
- function handleSubmit(event) {
276
- focused = false;
277
- if (searchTimeoutRef) {
278
- clearTimeout(searchTimeoutRef);
279
- searchTimeoutRef = undefined;
280
- }
281
- if (selectedItemIndex > -1 && listFeatures) {
282
- picked = listFeatures[selectedItemIndex];
283
- searchValue =
284
- picked.place_type[0] === "reverse"
285
- ? picked.place_name
286
- : picked.place_name.replace(/,.*/, "");
287
- error = undefined;
288
- markedFeatures = undefined;
289
- selectedItemIndex = -1;
290
- }
291
- else if (searchValue) {
292
- const zoomTo = event || !isQueryReverse(searchValue);
293
- search(searchValue, { exact: true })
294
- .then(() => {
295
- markedFeatures = listFeatures;
296
- picked = undefined;
297
- if (zoomTo) {
298
- zoomToResults();
299
- }
300
- })
301
- .catch((err) => (error = err));
302
- }
303
- }
304
- function isQueryReverse(searchValue) {
305
- try {
306
- return convert(searchValue, 6);
307
- }
308
- catch {
309
- return false;
310
- }
311
- }
312
- async function search(searchValue, { byId = false, exact = false, } = {}) {
313
- error = undefined;
314
- abortController?.abort();
315
- const ac = new AbortController();
316
- abortController = ac;
317
- try {
318
- const isReverse = isQueryReverse(searchValue);
319
- const urlObj = new URL(apiUrl +
320
- "/" +
321
- encodeURIComponent(isReverse
322
- ? isReverse.decimalLongitude + "," + isReverse.decimalLatitude
323
- : searchValue) +
324
- ".json");
325
- const sp = urlObj.searchParams;
326
- if (language !== undefined) {
327
- sp.set("language", Array.isArray(language) ? language.join(",") : (language ?? ""));
328
- }
329
- const [zoom] = mapController?.getCenterAndZoom() ?? [];
330
- let effTypes = (!isReverse || reverseGeocodingTypes === COPY_TYPES
331
- ? types
332
- : reverseGeocodingTypes)
333
- ?.map((typeRule) => typeof typeRule === "string"
334
- ? typeRule
335
- : zoom === undefined ||
336
- ((typeRule[0] ?? 0) <= zoom && zoom < (typeRule[1] ?? Infinity))
337
- ? typeRule[2]
338
- : undefined)
339
- .filter((type) => type !== undefined);
340
- if (effTypes) {
341
- effTypes = [...new Set(effTypes)];
342
- sp.set("types", effTypes.join(","));
343
- }
344
- const effExcludeTypes = !isReverse || reverseGeocodingExcludeTypes === COPY_EXCLUDE_TYPES
345
- ? excludeTypes
346
- : reverseGeocodingExcludeTypes;
347
- if (effExcludeTypes) {
348
- sp.set("excludeTypes", String(effExcludeTypes));
349
- }
350
- if (bbox) {
351
- sp.set("bbox", bbox.map((c) => c.toFixed(6)).join(","));
352
- }
353
- if (country) {
354
- sp.set("country", Array.isArray(country) ? country.join(",") : country);
355
- }
356
- if (!byId && !isReverse) {
357
- const coords = await getProximity(mapController, proximity, ac);
358
- if (coords) {
359
- sp.set("proximity", coords);
360
- }
361
- if (exact || !showResultsWhileTyping) {
362
- sp.set("autocomplete", "false");
363
- }
364
- sp.set("fuzzyMatch", String(fuzzyMatch));
365
- }
366
- const effReverseGeocodingLimit = reverseGeocodingLimit === COPY_LIMIT ? limit : reverseGeocodingLimit;
367
- if (effReverseGeocodingLimit !== undefined &&
368
- effReverseGeocodingLimit > 1 &&
369
- effTypes?.length !== 1) {
370
- console.warn("For reverse geocoding when limit > 1 then types must contain single value.");
371
- }
372
- if (isReverse) {
373
- if (effReverseGeocodingLimit === 1 ||
374
- (effReverseGeocodingLimit !== undefined &&
375
- (exhaustiveReverseGeocoding || effTypes?.length === 1))) {
376
- sp.set("limit", String(effReverseGeocodingLimit));
377
- }
378
- }
379
- else if (limit !== undefined) {
380
- sp.set("limit", String(limit));
381
- }
382
- if (apiKey) {
383
- sp.set("key", apiKey);
384
- }
385
- adjustUrlQuery(sp);
386
- adjustUrl(urlObj);
387
- const noTypes = urlObj.searchParams.get("types") === "" &&
388
- urlObj.searchParams.get("excludeTypes") !== "true";
389
- const url = urlObj.toString();
390
- if (url === lastSearchUrl) {
391
- if (byId) {
392
- if (clearListOnPick) {
393
- listFeatures = undefined;
394
- }
395
- picked = cachedFeatures[0];
396
- }
397
- else {
398
- listFeatures = cachedFeatures;
399
- if (listFeatures[selectedItemIndex]?.id !== selected?.id) {
400
- selectedItemIndex = -1;
401
- }
402
- }
403
- return;
404
- }
405
- lastSearchUrl = url;
406
- let featureCollection;
407
- if (noTypes) {
408
- featureCollection = { type: "FeatureCollection", features: [] };
409
- }
410
- else {
411
- const res = await fetch(url, {
412
- signal: ac.signal,
413
- ...fetchParameters,
414
- });
415
- if (!res.ok) {
416
- throw new Error(await res.text());
417
- }
418
- featureCollection = await res.json();
419
- }
420
- dispatch("response", { url, featureCollection });
421
- if (byId) {
422
- if (clearListOnPick) {
423
- listFeatures = undefined;
424
- }
425
- picked = featureCollection.features[0];
426
- cachedFeatures = [picked];
427
- }
428
- else {
429
- listFeatures = featureCollection.features.filter(filter);
430
- if (isReverse) {
431
- listFeatures.unshift({
432
- type: "Feature",
433
- properties: {},
434
- id: "reverse_" +
435
- isReverse.decimalLongitude +
436
- "_" +
437
- isReverse.decimalLatitude,
438
- text: isReverse.decimalLatitude + ", " + isReverse.decimalLongitude,
439
- place_name: isReverse.decimalLatitude + ", " + isReverse.decimalLongitude,
440
- place_type: ["reverse"],
441
- center: [isReverse.decimalLongitude, isReverse.decimalLatitude],
442
- bbox: [
443
- isReverse.decimalLongitude,
444
- isReverse.decimalLatitude,
445
- isReverse.decimalLongitude,
446
- isReverse.decimalLatitude,
447
- ],
448
- geometry: {
449
- type: "Point",
450
- coordinates: [
451
- isReverse.decimalLongitude,
452
- isReverse.decimalLatitude,
453
- ],
454
- },
455
- });
456
- }
457
- cachedFeatures = listFeatures;
458
- if (listFeatures[selectedItemIndex]?.id !== selected?.id) {
459
- selectedItemIndex = -1;
460
- }
461
- if (isReverse) {
462
- input.focus();
463
- }
464
- }
465
- }
466
- catch (e) {
467
- if (e &&
468
- typeof e === "object" &&
469
- "name" in e &&
470
- e.name === "AbortError") {
471
- return;
472
- }
473
- throw e;
474
- }
475
- finally {
476
- if (ac === abortController) {
477
- abortController = undefined;
478
- }
479
- }
480
- }
481
- function zoomToResults() {
482
- if (!markedFeatures?.length || !flyTo) {
483
- return;
484
- }
485
- const bbox = [180, 90, -180, -90];
486
- const fuzzyOnly = !markedFeatures.some((feature) => !feature.matching_text);
487
- let allZoom;
488
- for (const feature of markedFeatures) {
489
- const featZoom = computeZoom(feature);
490
- allZoom =
491
- allZoom === undefined
492
- ? featZoom
493
- : featZoom === undefined
494
- ? allZoom
495
- : Math.max(allZoom, featZoom);
496
- if (fuzzyOnly || !feature.matching_text) {
497
- for (const i of [0, 1, 2, 3]) {
498
- bbox[i] = Math[i < 2 ? "min" : "max"](bbox[i], feature.bbox?.[i] ?? feature.center[i % 2]);
499
- }
500
- }
501
- }
502
- if (mapController && markedFeatures.length > 0) {
503
- if (picked && bbox[0] === bbox[2] && bbox[1] === bbox[3]) {
504
- mapController.flyTo(picked.center, computeZoom(picked));
505
- }
506
- else {
507
- mapController.fitBounds(unwrapBbox(bbox), 50, allZoom);
508
- }
509
- }
510
- }
511
- function goToPicked() {
512
- if (!picked || !mapController) {
513
- return;
514
- }
515
- if (!picked.bbox ||
516
- (picked.bbox[0] === picked.bbox[2] && picked.bbox[1] === picked.bbox[3])) {
517
- mapController.flyTo(picked.center, computeZoom(picked));
518
- }
519
- else {
520
- mapController.fitBounds(unwrapBbox(picked.bbox), 50, computeZoom(picked));
521
- }
522
- }
523
- function computeZoom(feature) {
524
- if (!feature.bbox ||
525
- (feature.bbox[0] !== feature.bbox[2] &&
526
- feature.bbox[1] !== feature.bbox[3])) {
527
- return undefined;
528
- }
529
- const index = feature.id.replace(/\..*/, "");
530
- return ((Array.isArray(feature.properties?.categories)
531
- ? feature.properties.categories.reduce((a, category) => {
532
- const b = zoom[index + "." + category];
533
- return a === undefined ? b : b === undefined ? a : Math.max(a, b);
534
- }, undefined)
535
- : undefined) ?? zoom[index]);
536
- }
537
- function handleReverse(coordinates) {
538
- reverseActive = enableReverse === "always";
539
- listFeatures = undefined;
540
- picked = undefined;
541
- selectedItemIndex = -1;
542
- setQuery(coordinates[1].toFixed(6) +
543
- ", " +
544
- wrapNum(coordinates[0], [-180, 180], true).toFixed(6), false, true);
545
- }
546
- function handleKeyDown(e) {
547
- if (!listFeatures) {
548
- return;
549
- }
550
- let dir = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0;
551
- if (!dir) {
552
- return;
553
- }
554
- input.focus();
555
- focused = true;
556
- e.preventDefault();
557
- if (picked && selectedItemIndex === -1) {
558
- selectedItemIndex = listFeatures.findIndex((listFeature) => listFeature.id === picked?.id);
559
- }
560
- if (selectedItemIndex === (picked || selectFirst ? 0 : -1) && dir === -1) {
561
- selectedItemIndex = listFeatures.length;
562
- }
563
- selectedItemIndex += dir;
564
- if (selectedItemIndex >= listFeatures.length) {
565
- selectedItemIndex = -1;
566
- }
567
- if (selectedItemIndex < 0 && (picked || selectFirst)) {
568
- selectedItemIndex = 0;
569
- }
570
- }
571
- function handleInput(_, debounce = true, reverse = false) {
572
- error = undefined;
573
- picked = undefined;
574
- focused = true;
575
- if (showResultsWhileTyping || reverse) {
576
- if (searchTimeoutRef) {
577
- clearTimeout(searchTimeoutRef);
578
- }
579
- if (searchValue.length < minLength) {
580
- return;
581
- }
582
- const sv = searchValue;
583
- searchTimeoutRef = window.setTimeout(() => {
584
- search(sv).catch((err) => (error = err));
585
- }, debounce ? debounceSearch : 0);
586
- }
587
- else {
588
- listFeatures = undefined;
589
- error = undefined;
590
- }
591
- }
592
- function pick(feature) {
593
- if (picked && picked?.id === feature?.id) {
594
- goToPicked();
595
- }
596
- else {
597
- picked = feature;
598
- searchValue = feature.place_name;
599
- }
600
- }
601
- function handleMouseEnter(index) {
602
- selectedItemIndex = index;
603
- }
604
- function handleMouseLeave() {
605
- if (!selectFirst || picked) {
606
- selectedItemIndex = -1;
607
- }
608
- // re-focus on picked
609
- if (flyToSelected) {
610
- goToPicked();
611
- }
612
- }
613
- </script>
614
-
615
- {#if false}
616
- <!-- This workaround is just to use marker styles. Bug in svlete/vite? Investigate. -->
617
- <MarkerIcon displayIn="list" />
618
- {/if}
619
-
620
- <form
621
- on:submit|preventDefault={handleSubmit}
622
- class:can-collapse={collapsed && searchValue === ""}
623
- class={className}
624
- >
625
- <div class="input-group">
626
- <button class="search-button" type="button" on:click={() => input.focus()}>
627
- <SearchIcon />
628
- </button>
629
-
630
- <input
631
- bind:this={input}
632
- bind:value={searchValue}
633
- on:focus={() => (focused = true)}
634
- on:blur={() => (focused = false)}
635
- on:click={() => (focused = true)}
636
- on:keydown={handleKeyDown}
637
- on:input={handleInput}
638
- on:change={() => (picked = undefined)}
639
- {placeholder}
640
- aria-label={placeholder}
641
- />
642
-
643
- <div class="clear-button-container" class:displayable={searchValue !== ""}>
644
- {#if !abortController}
645
- <button
646
- type="button"
647
- on:click={() => {
648
- searchValue = "";
649
- picked = undefined;
650
- input.focus();
651
- }}
652
- title={clearButtonTitle}
653
- >
654
- <ClearIcon />
655
- </button>
656
- {/if}
657
-
658
- {#if abortController}
659
- <LoadingIcon />
660
- {/if}
661
- </div>
662
-
663
- {#if enableReverse === "button"}
664
- <button
665
- type="button"
666
- class:active={reverseActive}
667
- title={reverseButtonTitle}
668
- on:click={() => (reverseActive = !reverseActive)}
669
- >
670
- <ReverseGeocodingIcon />
671
- </button>
672
- {/if}
673
-
674
- <slot />
675
- </div>
676
-
677
- {#if error}
678
- <div class="error">
679
- <FailIcon />
680
-
681
- <div>{errorMessage}</div>
682
-
683
- <button on:click={() => (error = undefined)}>
684
- <ClearIcon />
685
- </button>
686
- </div>
687
- {:else if !focusedDelayed && !keepListOpen}
688
- {""}
689
- {:else if listFeatures?.length === 0}
690
- <div class="no-results">
691
- <FailIcon />
692
-
693
- <div>{noResultsMessage}</div>
694
- </div>
695
- {:else if listFeatures?.length && (focusedDelayed || keepListOpen)}
696
- <ul
697
- class="options"
698
- on:mouseleave={handleMouseLeave}
699
- on:blur={() => undefined}
700
- on:keydown={handleKeyDown}
701
- role="listbox"
702
- >
703
- {#each listFeatures as feature, i (feature.id + (feature.address ? "," + feature.address : ""))}
704
- <FeatureItem
705
- {feature}
706
- {showPlaceType}
707
- style={selectedItemIndex === i
708
- ? "selected"
709
- : picked?.id === feature.id
710
- ? "picked"
711
- : "default"}
712
- on:mouseenter={() => handleMouseEnter(i)}
713
- on:select={() => pick(feature)}
714
- {missingIconsCache}
715
- {iconsBaseUrl}
716
- />
717
- {/each}
718
- </ul>
719
- {/if}
720
- </form>
721
-
722
- <style>form {
723
- font-family: "Open Sans", "Ubuntu", "Helvetica Neue", Arial, Helvetica, sans-serif;
724
- position: relative;
725
- background-color: #fff;
726
- z-index: 10;
727
- border-radius: 4px;
728
- margin: 0;
729
- transition: max-width 0.25s;
730
- box-shadow: 0px 2px 5px rgba(51, 51, 89, 0.15);
731
- --color-text: #444952;
732
- --color-icon-button: #444952;
733
- }
734
- form, form *, form *:after, form *:before {
735
- box-sizing: border-box;
736
- }
737
- form.can-collapse {
738
- max-width: 29px;
739
- }
740
- form.can-collapse input::placeholder {
741
- transition: opacity 0.25s;
742
- opacity: 0;
743
- }
744
- form, form:focus-within, form:hover {
745
- width: 270px;
746
- max-width: 270px;
747
- }
748
- form input::placeholder, form:focus-within input::placeholder, form:hover input::placeholder {
749
- opacity: 1;
750
- }
751
-
752
- input {
753
- font: inherit;
754
- font-size: 14px;
755
- flex-grow: 1;
756
- min-height: 29px;
757
- background-color: transparent;
758
- color: #444952;
759
- white-space: nowrap;
760
- overflow: hidden;
761
- border: 0;
762
- margin: 0;
763
- padding: 0;
764
- }
765
- input:focus {
766
- color: #444952;
767
- outline: 0;
768
- outline: none;
769
- box-shadow: none;
770
- }
771
-
772
- ul,
773
- div.error,
774
- div.no-results {
775
- background-color: #fff;
776
- border-radius: 4px;
777
- left: 0;
778
- list-style: none;
779
- margin: 0;
780
- padding: 0;
781
- position: absolute;
782
- width: 100%;
783
- top: calc(100% + 6px);
784
- overflow: hidden;
785
- }
786
-
787
- ul {
788
- font-size: 14px;
789
- line-height: 16px;
790
- box-shadow: 0px 5px 10px rgba(51, 51, 89, 0.15);
791
- }
792
-
793
- div.error,
794
- div.no-results {
795
- font: inherit;
796
- line-height: 18px;
797
- font-size: 12px;
798
- display: flex;
799
- gap: 16px;
800
- }
801
-
802
- div.error {
803
- padding: 16px;
804
- font-weight: 600;
805
- color: #e25041;
806
- background-color: #fbeae8;
807
- }
808
- div.error div {
809
- flex-grow: 1;
810
- }
811
- div.error :global(svg) {
812
- flex-shrink: 0;
813
- width: 20px;
814
- height: 20px;
815
- }
816
- div.error button {
817
- flex-shrink: 0;
818
- }
819
- div.error button > :global(svg) {
820
- width: 13px;
821
- fill: #e25041;
822
- }
823
- div.error button:hover :global(svg), div.error button:active :global(svg) {
824
- fill: #444952;
825
- }
826
-
827
- div.no-results {
828
- padding: 14px 24px 14px 16px;
829
- font-weight: 400;
830
- color: #6b7c93;
831
- box-shadow: 0px 5px 10px rgba(51, 51, 89, 0.15);
832
- }
833
- div.no-results :global(svg) {
834
- margin-top: 4px;
835
- flex-shrink: 0;
836
- width: 20px;
837
- height: 20px;
838
- width: 30px;
839
- height: 30px;
840
- }
841
-
842
- :global(.leaflet-bottom) ul.options,
843
- :global(.maplibregl-ctrl-bottom-left) ul.options,
844
- :global(.maplibregl-ctrl-bottom-right) ul.options {
845
- top: auto;
846
- bottom: calc(100% + 6px);
847
- }
848
-
849
- button {
850
- padding: 0;
851
- margin: 0;
852
- border: 0;
853
- background-color: transparent;
854
- height: auto;
855
- width: auto;
856
- }
857
- button:hover {
858
- background-color: transparent;
859
- }
860
-
861
- button:hover :global(svg),
862
- button:active :global(svg) {
863
- fill: #2b8bfb;
864
- }
865
-
866
- .input-group {
867
- display: flex;
868
- align-items: stretch;
869
- gap: 7px;
870
- padding-inline: 8px;
871
- border-radius: 4px;
872
- overflow: hidden;
873
- }
874
- .input-group:focus-within {
875
- outline: #2b8bfb solid 2px;
876
- }
877
-
878
- .search-button {
879
- flex-shrink: 0;
880
- }
881
-
882
- :global(.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg) {
883
- width: 12px !important;
884
- transform: translate(0.5px, 0);
885
- }
886
-
887
- .clear-button-container {
888
- display: flex;
889
- display: none;
890
- position: relative;
891
- align-items: stretch;
892
- }
893
- .clear-button-container.displayable {
894
- display: flex;
895
- flex-shrink: 0;
896
- }
897
-
898
- :global(.maplibregl-ctrl-geocoder) {
899
- position: relative;
900
- z-index: 3;
901
- }
902
-
903
- :global(.maptiler-ctrl):not(:empty) {
904
- box-shadow: none;
905
- }
906
- :global(.maptiler-ctrl) .input-group {
907
- padding-inline: 8px;
908
- border: white solid 2px;
909
- }
910
- :global(.maptiler-ctrl) .input-group:focus-within {
911
- border: #2b8bfb solid 2px;
912
- outline: 0;
913
- outline: none;
914
- }
915
- :global(.maptiler-ctrl) form.can-collapse {
916
- max-width: 33px;
917
- }
918
- :global(.maptiler-ctrl) form, :global(.maptiler-ctrl) form:focus-within, :global(.maptiler-ctrl) form:hover {
919
- width: 270px;
920
- max-width: 270px;
921
- }</style>