@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,210 +0,0 @@
1
- import GeocodingControlComponent from "./GeocodingControl.svelte";
2
- import { createMapLibreGlMapController, } from "./maplibregl-controller";
3
- export { createMapLibreGlMapController, } from "./maplibregl-controller";
4
- export function crateClasses(Evented, maplibreGl, getExtraProps) {
5
- // NOTE We can't use Maplibre `Event` - see https://github.com/maplibre/maplibre-gl-js/issues/5015
6
- class Event {
7
- type;
8
- target;
9
- constructor(target, type) {
10
- this.type = type;
11
- this.target = target;
12
- }
13
- }
14
- class SelectEvent extends Event {
15
- feature;
16
- constructor(target, details) {
17
- super(target, "select");
18
- Object.assign(this, details);
19
- }
20
- }
21
- class FeaturesListedEvent extends Event {
22
- features;
23
- constructor(target, features) {
24
- super(target, "featureslisted");
25
- this.features = features;
26
- }
27
- }
28
- class FeaturesMarkedEvent extends Event {
29
- features;
30
- constructor(target, features) {
31
- super(target, "featuresmarked");
32
- this.features = features;
33
- }
34
- }
35
- class OptionsVisibilityChangeEvent extends Event {
36
- optionsVisible;
37
- constructor(target, optionsVisible) {
38
- super(target, "optionsvisibilitychange");
39
- this.optionsVisible = optionsVisible;
40
- }
41
- }
42
- class PickEvent extends Event {
43
- feature;
44
- constructor(target, feature) {
45
- super(target, "pick");
46
- this.feature = feature;
47
- }
48
- }
49
- class QueryChangeEvent extends Event {
50
- query;
51
- constructor(target, query) {
52
- super(target, "querychange");
53
- this.query = query;
54
- }
55
- }
56
- class ResponseEvent extends Event {
57
- url;
58
- featureCollection;
59
- constructor(target, url, featureCollection) {
60
- super(target, "response");
61
- this.url = url;
62
- this.featureCollection = featureCollection;
63
- }
64
- }
65
- class ReverseToggleEvent extends Event {
66
- reverse;
67
- constructor(target, reverse) {
68
- super(target, "reversetoggle");
69
- this.reverse = reverse;
70
- }
71
- }
72
- class MapLibreBasedGeocodingControl extends Evented {
73
- #gc;
74
- #options;
75
- #container;
76
- constructor(options = {}) {
77
- super();
78
- this.#options = options;
79
- }
80
- onAddInt(map) {
81
- const div = document.createElement("div");
82
- div.className =
83
- "mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";
84
- const { marker, showResultMarkers, flyTo, fullGeometryStyle, ...restOptions } = this.#options;
85
- const flyToOptions = typeof flyTo === "boolean" ? {} : flyTo;
86
- const mapController = createMapLibreGlMapController(map, maplibreGl, marker, showResultMarkers, flyToOptions, flyToOptions, fullGeometryStyle);
87
- const props = {
88
- mapController,
89
- flyTo: flyTo === undefined ? true : !!flyTo,
90
- apiKey: "", // just to satisfy apiKey; TODO find a better solution
91
- ...getExtraProps?.(map, div),
92
- ...restOptions,
93
- };
94
- if (!props.apiKey) {
95
- console.warn("No MapTiler Cloud API key was provided, some or all geocoding requests may fail");
96
- }
97
- this.#gc = new GeocodingControlComponent({ target: div, props });
98
- this.#gc.$on("select", (event) => {
99
- this.fire(new SelectEvent(this, event.detail));
100
- });
101
- this.#gc.$on("pick", (event) => {
102
- this.fire(new PickEvent(this, event.detail.feature));
103
- });
104
- this.#gc.$on("featureslisted", (event) => {
105
- this.fire(new FeaturesListedEvent(this, event.detail.features));
106
- });
107
- this.#gc.$on("featuresmarked", (event) => {
108
- this.fire(new FeaturesMarkedEvent(this, event.detail.features));
109
- });
110
- this.#gc.$on("response", (event) => {
111
- this.fire(new ResponseEvent(this, event.detail.url, event.detail.featureCollection));
112
- });
113
- this.#gc.$on("optionsvisibilitychange", (event) => {
114
- this.fire(new OptionsVisibilityChangeEvent(this, event.detail.optionsVisible));
115
- });
116
- this.#gc.$on("reversetoggle", (event) => {
117
- this.fire(new ReverseToggleEvent(this, event.detail.reverse));
118
- });
119
- this.#gc.$on("querychange", (event) => {
120
- this.fire(new QueryChangeEvent(this, event.detail.query));
121
- });
122
- this.#container = div;
123
- return div;
124
- }
125
- on(type, listener) {
126
- return super.on(type, listener);
127
- }
128
- once(type, listener) {
129
- return super.once(type, listener);
130
- }
131
- off(type, listener) {
132
- return super.off(type, listener);
133
- }
134
- listens(type) {
135
- return super.listens(type);
136
- }
137
- /**
138
- * Update the control options.
139
- *
140
- * @param options options to update
141
- */
142
- setOptions(options) {
143
- Object.assign(this.#options, options);
144
- const { marker, showResultMarkers, flyTo, fullGeometryStyle, ...restOptions } = this.#options;
145
- this.#gc?.$set(restOptions);
146
- }
147
- /**
148
- * Set the content of search input box.
149
- *
150
- * @param value text to set
151
- * @param submit perform the search
152
- */
153
- setQuery(value, submit = true) {
154
- this.#gc?.setQuery(value, submit);
155
- }
156
- /**
157
- * Clear geocoding search results from the map.
158
- */
159
- clearMap() {
160
- this.#gc?.clearMap();
161
- }
162
- /**
163
- * Clear search result list.
164
- */
165
- clearList() {
166
- this.#gc?.clearList();
167
- }
168
- /**
169
- * Set reverse geocoding mode.
170
- *
171
- * @param reverseActive reverse geocoding active
172
- */
173
- setReverseMode(reverseActive) {
174
- this.#gc?.$set({ reverseActive });
175
- }
176
- /**
177
- * Focus the search input box.
178
- *
179
- * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
180
- */
181
- focus(options) {
182
- this.#gc?.focus(options);
183
- }
184
- /**
185
- * Blur the search input box.
186
- */
187
- blur() {
188
- this.#gc?.blur();
189
- }
190
- onRemove() {
191
- this.#gc?.$destroy();
192
- this.#gc = undefined;
193
- this.#container?.parentNode?.removeChild(this.#container);
194
- }
195
- }
196
- const events = {
197
- SelectEvent,
198
- FeaturesListedEvent,
199
- FeaturesMarkedEvent,
200
- OptionsVisibilityChangeEvent,
201
- PickEvent,
202
- QueryChangeEvent,
203
- ResponseEvent,
204
- ReverseToggleEvent,
205
- };
206
- return {
207
- MapLibreBasedGeocodingControl,
208
- events,
209
- };
210
- }
@@ -1,71 +0,0 @@
1
- <script>export let displayIn;
2
- </script>
3
-
4
- <svg
5
- width={displayIn === "list" ? 20 : undefined}
6
- viewBox="0 0 70 85"
7
- fill="none"
8
- class:in-map={displayIn !== "list"}
9
- class:list-icon={displayIn === "list"}
10
- >
11
- <path
12
- stroke-width="4"
13
- d="M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"
14
- />
15
- </svg>
16
-
17
- <style>
18
- svg {
19
- display: block;
20
- fill: #6b7c93;
21
- stroke: #6b7c93;
22
- }
23
-
24
- .list-icon {
25
- grid-row: 1/3;
26
- align-self: center;
27
- margin: 8px;
28
- }
29
-
30
- .in-map {
31
- height: 30px;
32
- }
33
-
34
- :global(.maplibregl-canvas-container .marker-selected) {
35
- z-index: 1;
36
- }
37
-
38
- :global(.maplibregl-canvas-container) svg path,
39
- :global(.leaflet-map-pane) svg path {
40
- fill: #3170fe;
41
- stroke: #3170fe;
42
- }
43
-
44
- :global(.marker-selected) svg path {
45
- fill: #98b7ff;
46
- stroke: #3170fe;
47
- }
48
-
49
- :global(.marker-reverse) svg path {
50
- fill: silver;
51
- stroke: gray;
52
- }
53
-
54
- :global(.marker-interactive) {
55
- cursor: pointer !important;
56
- }
57
-
58
- /* :global(.marker-fuzzy) svg path {
59
- fill: silver;
60
- stroke: gray;
61
- }
62
-
63
- :global(.marker-fuzzy.marker-selected) svg path {
64
- fill: #ddd;
65
- stroke: silver;
66
- } */
67
-
68
- :global(.maptiler-gc-popup > .maplibregl-popup-content) {
69
- padding: 2px 8px;
70
- }
71
- </style>
@@ -1,18 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- displayIn: "list" | "leaflet" | "maplibre";
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {};
10
- exports?: {} | undefined;
11
- bindings?: string | undefined;
12
- };
13
- export type MarkerIconProps = typeof __propDef.props;
14
- export type MarkerIconEvents = typeof __propDef.events;
15
- export type MarkerIconSlots = typeof __propDef.slots;
16
- export default class MarkerIcon extends SvelteComponent<MarkerIconProps, MarkerIconEvents, MarkerIconSlots> {
17
- }
18
- export {};
@@ -1,12 +0,0 @@
1
- <svg viewBox="0 0 60.006 21.412" width="14" height="20">
2
- <path
3
- d="M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"
4
- />
5
- </svg>
6
-
7
- <style>
8
- svg {
9
- display: block;
10
- fill: var(--color-icon-button);
11
- }
12
- </style>
@@ -1,25 +0,0 @@
1
- /** @typedef {typeof __propDef.props} ReverseGeocodingIconProps */
2
- /** @typedef {typeof __propDef.events} ReverseGeocodingIconEvents */
3
- /** @typedef {typeof __propDef.slots} ReverseGeocodingIconSlots */
4
- export default class ReverseGeocodingIcon extends SvelteComponent<{
5
- [x: string]: never;
6
- }, {
7
- [evt: string]: CustomEvent<any>;
8
- }, {}> {
9
- }
10
- export type ReverseGeocodingIconProps = typeof __propDef.props;
11
- export type ReverseGeocodingIconEvents = typeof __propDef.events;
12
- export type ReverseGeocodingIconSlots = typeof __propDef.slots;
13
- import { SvelteComponent } from "svelte";
14
- declare const __propDef: {
15
- props: {
16
- [x: string]: never;
17
- };
18
- events: {
19
- [evt: string]: CustomEvent<any>;
20
- };
21
- slots: {};
22
- exports?: undefined;
23
- bindings?: undefined;
24
- };
25
- export {};
@@ -1,26 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- width="13"
4
- height="13"
5
- viewBox="0 0 13 13"
6
- >
7
- <circle cx="4.789" cy="4.787" r="3.85" />
8
- <path d="M12.063 12.063 7.635 7.635" />
9
- </svg>
10
-
11
- <style>
12
- circle {
13
- stroke-width: 1.875;
14
- fill: none;
15
- }
16
-
17
- path {
18
- stroke-width: 1.875;
19
- stroke-linecap: round;
20
- }
21
-
22
- svg {
23
- display: block;
24
- stroke: var(--color-icon-button);
25
- }
26
- </style>
@@ -1,25 +0,0 @@
1
- /** @typedef {typeof __propDef.props} SearchIconProps */
2
- /** @typedef {typeof __propDef.events} SearchIconEvents */
3
- /** @typedef {typeof __propDef.slots} SearchIconSlots */
4
- export default class SearchIcon extends SvelteComponent<{
5
- [x: string]: never;
6
- }, {
7
- [evt: string]: CustomEvent<any>;
8
- }, {}> {
9
- }
10
- export type SearchIconProps = typeof __propDef.props;
11
- export type SearchIconEvents = typeof __propDef.events;
12
- export type SearchIconSlots = typeof __propDef.slots;
13
- import { SvelteComponent } from "svelte";
14
- declare const __propDef: {
15
- props: {
16
- [x: string]: never;
17
- };
18
- events: {
19
- [evt: string]: CustomEvent<any>;
20
- };
21
- slots: {};
22
- exports?: undefined;
23
- bindings?: undefined;
24
- };
25
- export {};
@@ -1,8 +0,0 @@
1
- declare module "geo-coordinates-parser" {
2
- function convert(input: string, decimalPlaces: number): {
3
- decimalLatitude: number;
4
- decimalLongitude: number;
5
- verbatimLatitude: string;
6
- verbatimLongitude: string;
7
- };
8
- }
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,3 +0,0 @@
1
- import type { BBox } from "./types";
2
- export declare function wrapNum(x: number, range: [number, number], includeMax: boolean): number;
3
- export declare function unwrapBbox(bbox0: BBox): BBox;
@@ -1,18 +0,0 @@
1
- // taken from Leaflet
2
- export function wrapNum(x, range, includeMax) {
3
- const max = range[1], min = range[0], d = max - min;
4
- return x === max && includeMax ? x : ((((x - min) % d) + d) % d) + min;
5
- }
6
- export function unwrapBbox(bbox0) {
7
- const bbox = [...bbox0];
8
- if (bbox[2] < bbox[0]) {
9
- if (Math.abs((bbox[0] + bbox[2] + 360) / 2) >
10
- Math.abs((bbox[0] - 360 + bbox[2]) / 2)) {
11
- bbox[0] -= 360;
12
- }
13
- else {
14
- bbox[2] += 360;
15
- }
16
- }
17
- return bbox;
18
- }
package/svelte/info.json DELETED
@@ -1 +0,0 @@
1
- {"name":"@maptiler/geocoding-control","version":"2.1.7"}
@@ -1,12 +0,0 @@
1
- import * as L from "leaflet";
2
- import type { BBox, Feature, MapEvent, Position } from "./types";
3
- export declare function createLeafletMapController(map: L.Map, marker?: boolean | null | L.MarkerOptions | ((map: L.Map, feature?: Feature) => L.Marker | undefined | null), showResultMarkers?: boolean | null | L.MarkerOptions | ((map: L.Map, feature: Feature) => L.Marker | undefined | null), flyToOptions?: L.ZoomPanOptions | null, flyToBounds?: L.FitBoundsOptions | null, fullGeometryStyle?: null | boolean | L.PathOptions | L.StyleFunction): {
4
- setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
5
- flyTo(center: Position, zoom?: number): void;
6
- fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
7
- indicateReverse(reverse: boolean): void;
8
- setReverseMarker(coordinates?: Position): void;
9
- setFeatures(markedFeatures: Feature[] | undefined, picked: Feature | undefined, showPolygonMarker: boolean): void;
10
- setSelectedMarker(index: number): void;
11
- getCenterAndZoom(): [number, number, number];
12
- };