@maptiler/geocoding-control 1.3.3 → 1.4.1

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 (204) hide show
  1. package/README.md +3 -4
  2. package/icons/airport.svg +6 -0
  3. package/icons/animal_shelter.svg +4 -0
  4. package/icons/art_gallery.svg +4 -0
  5. package/icons/atm.svg +5 -1
  6. package/icons/barrier.svg +4 -0
  7. package/icons/baseball.svg +4 -0
  8. package/icons/basketball.svg +4 -0
  9. package/icons/bbq.svg +4 -1
  10. package/icons/beach.svg +4 -0
  11. package/icons/beer.svg +4 -1
  12. package/icons/bench.svg +4 -1
  13. package/icons/bicycle.svg +4 -1
  14. package/icons/bicycle_parking.svg +5 -1
  15. package/icons/bicycle_rental.svg +5 -1
  16. package/icons/billiards.svg +4 -0
  17. package/icons/board.svg +4 -1
  18. package/icons/bollard.svg +4 -0
  19. package/icons/bowling.svg +4 -1
  20. package/icons/building.svg +4 -0
  21. package/icons/bulldozer.svg +4 -0
  22. package/icons/bus_guided.svg +4 -0
  23. package/icons/bus_trolley.svg +4 -0
  24. package/icons/butcher.svg +4 -1
  25. package/icons/camper_trailer.svg +4 -0
  26. package/icons/campfire.svg +4 -0
  27. package/icons/caution.svg +4 -0
  28. package/icons/cemetery.svg +3 -11
  29. package/icons/charging_station.svg +4 -1
  30. package/icons/christian.svg +5 -0
  31. package/icons/circle-dot.svg +4 -0
  32. package/icons/circle-stroke.svg +4 -0
  33. package/icons/circle.svg +4 -0
  34. package/icons/city.svg +4 -0
  35. package/icons/communications_tower.svg +4 -1
  36. package/icons/confectionery.svg +4 -1
  37. package/icons/construction.svg +4 -0
  38. package/icons/cricket.svg +4 -0
  39. package/icons/cross.svg +4 -1
  40. package/icons/cycle_barrier.svg +4 -0
  41. package/icons/dam.svg +4 -0
  42. package/icons/danger.svg +4 -0
  43. package/icons/diamond.svg +4 -0
  44. package/icons/diamond_stroked.svg +4 -0
  45. package/icons/dot.svg +4 -0
  46. package/icons/drinking_water.svg +4 -1
  47. package/icons/emergency_phone.svg +4 -1
  48. package/icons/entrance.svg +4 -0
  49. package/icons/farm.svg +3 -8
  50. package/icons/fence.svg +4 -0
  51. package/icons/florist.svg +4 -1
  52. package/icons/furniture.svg +4 -1
  53. package/icons/gaming.svg +4 -0
  54. package/icons/garden.svg +4 -0
  55. package/icons/garden_centre.svg +4 -1
  56. package/icons/gate.svg +4 -1
  57. package/icons/globe.svg +4 -0
  58. package/icons/golf_green.svg +4 -0
  59. package/icons/gondola.svg +4 -0
  60. package/icons/guidepost.svg +4 -1
  61. package/icons/hardware.svg +3 -3
  62. package/icons/heart.svg +4 -0
  63. package/icons/heliport.svg +4 -0
  64. package/icons/highway_rest_area.svg +4 -0
  65. package/icons/home.svg +4 -0
  66. package/icons/hot_spring.svg +4 -1
  67. package/icons/hut.svg +4 -0
  68. package/icons/industry.svg +4 -0
  69. package/icons/karaoke.svg +4 -0
  70. package/icons/lift_gate.svg +4 -0
  71. package/icons/light_rail.svg +4 -0
  72. package/icons/lighthouse.svg +4 -1
  73. package/icons/marker.svg +4 -0
  74. package/icons/marker_stroked.svg +4 -0
  75. package/icons/monorail.svg +4 -0
  76. package/icons/motorcycle.svg +4 -1
  77. package/icons/motorcycle_parking.svg +4 -1
  78. package/icons/motorcycle_rental.svg +4 -0
  79. package/icons/motorcycle_repair.svg +4 -0
  80. package/icons/natural.svg +4 -0
  81. package/icons/noodle.svg +4 -0
  82. package/icons/obelisk.svg +4 -1
  83. package/icons/observation_tower.svg +4 -1
  84. package/icons/oneway.svg +4 -0
  85. package/icons/optician.svg +4 -1
  86. package/icons/park.svg +4 -1
  87. package/icons/parking_paid.svg +4 -0
  88. package/icons/pin.svg +4 -0
  89. package/icons/pipe.svg +4 -0
  90. package/icons/pizza.svg +4 -0
  91. package/icons/place_of_worship.svg +4 -1
  92. package/icons/playground.svg +3 -3
  93. package/icons/racetrack.svg +4 -0
  94. package/icons/radiation.svg +4 -0
  95. package/icons/railway.svg +4 -0
  96. package/icons/ranger_station.svg +4 -0
  97. package/icons/recycling.svg +4 -1
  98. package/icons/road_accident.svg +4 -0
  99. package/icons/roadblock.svg +4 -0
  100. package/icons/rocket.svg +4 -0
  101. package/icons/school_bus.svg +4 -0
  102. package/icons/sculpture.svg +4 -0
  103. package/icons/seafood.svg +4 -1
  104. package/icons/shelter.svg +4 -1
  105. package/icons/shoes.svg +4 -1
  106. package/icons/sikh.svg +4 -0
  107. package/icons/snow.svg +4 -0
  108. package/icons/soccer.svg +4 -1
  109. package/icons/spring.svg +4 -1
  110. package/icons/square.svg +4 -0
  111. package/icons/square_stroked.svg +4 -0
  112. package/icons/star.svg +4 -0
  113. package/icons/star_stroked.svg +4 -0
  114. package/icons/statue.svg +4 -1
  115. package/icons/subway.svg +4 -0
  116. package/icons/sushi.svg +4 -0
  117. package/icons/swimming.svg +5 -0
  118. package/icons/swimming_pool.svg +8 -0
  119. package/icons/tako.svg +4 -0
  120. package/icons/taxi.svg +4 -1
  121. package/icons/teahouse.svg +4 -0
  122. package/icons/terminal.svg +4 -1
  123. package/icons/theme_park.svg +4 -0
  124. package/icons/town.svg +4 -0
  125. package/icons/town_hall.svg +4 -1
  126. package/icons/townhall.svg +4 -1
  127. package/icons/tram_stop.svg +4 -0
  128. package/icons/transit.svg +4 -0
  129. package/icons/triangle.svg +4 -0
  130. package/icons/triangle_stroked.svg +4 -0
  131. package/icons/truck.svg +4 -0
  132. package/icons/tunnel.svg +4 -0
  133. package/icons/veterinary.svg +4 -1
  134. package/icons/viewpoint.svg +4 -1
  135. package/icons/village.svg +4 -0
  136. package/icons/volleyball.svg +4 -0
  137. package/icons/warehouse.svg +4 -0
  138. package/icons/water.svg +3 -5
  139. package/icons/water_park.svg +6 -1
  140. package/icons/water_tower.svg +4 -1
  141. package/icons/watermill.svg +4 -0
  142. package/icons/wetland.svg +4 -0
  143. package/icons/wine.svg +4 -0
  144. package/leaflet-controller.d.ts +2 -2
  145. package/leaflet-controller.js +1427 -9922
  146. package/leaflet-controller.js.map +1 -1
  147. package/leaflet-controller.umd.js +3 -9
  148. package/leaflet-controller.umd.js.map +1 -1
  149. package/leaflet.js +2708 -11166
  150. package/leaflet.js.map +1 -1
  151. package/leaflet.umd.js +3 -9
  152. package/leaflet.umd.js.map +1 -1
  153. package/maplibregl-controller.d.ts +2 -2
  154. package/maplibregl-controller.js +1268 -9849
  155. package/maplibregl-controller.js.map +1 -1
  156. package/maplibregl-controller.umd.js +3 -9
  157. package/maplibregl-controller.umd.js.map +1 -1
  158. package/maplibregl.js +2550 -11094
  159. package/maplibregl.js.map +1 -1
  160. package/maplibregl.umd.js +3 -9
  161. package/maplibregl.umd.js.map +1 -1
  162. package/maptilersdk.js +2558 -11102
  163. package/maptilersdk.js.map +1 -1
  164. package/maptilersdk.umd.js +3 -9
  165. package/maptilersdk.umd.js.map +1 -1
  166. package/mask.d.ts +1 -1
  167. package/openlayers-controller.js +1191 -9762
  168. package/openlayers-controller.js.map +1 -1
  169. package/openlayers-controller.umd.js +3 -9
  170. package/openlayers-controller.umd.js.map +1 -1
  171. package/openlayers.js +2689 -11223
  172. package/openlayers.js.map +1 -1
  173. package/openlayers.umd.js +3 -9
  174. package/openlayers.umd.js.map +1 -1
  175. package/package.json +26 -24
  176. package/react.js +996 -955
  177. package/react.js.map +1 -1
  178. package/react.umd.js +1 -1
  179. package/react.umd.js.map +1 -1
  180. package/style.css +1 -1
  181. package/svelte/FeatureItem.svelte +6 -5
  182. package/svelte/GeocodingControl.svelte +68 -12
  183. package/svelte/GeocodingControl.svelte.d.ts +4 -2
  184. package/svelte/geoUtils.js +7 -1
  185. package/svelte/leaflet-controller.d.ts +2 -2
  186. package/svelte/leaflet-controller.js +48 -2
  187. package/svelte/maplibregl-controller.d.ts +2 -2
  188. package/svelte/maplibregl-controller.js +5 -2
  189. package/svelte/mask.d.ts +1 -1
  190. package/svelte/mask.js +32 -29
  191. package/svelte/openlayers-controller.js +13 -14
  192. package/svelte/types.d.ts +15 -9
  193. package/types.d.ts +15 -9
  194. package/vanilla.js +1016 -975
  195. package/vanilla.js.map +1 -1
  196. package/vanilla.umd.js +1 -1
  197. package/vanilla.umd.js.map +1 -1
  198. package/icons/beach_resort.svg +0 -1
  199. package/icons/drinking-water.svg +0 -1
  200. package/icons/emergency-phone.svg +0 -1
  201. package/icons/rental_bicycle.svg +0 -1
  202. package/icons/rental_car.svg +0 -1
  203. /package/icons/{camp_site.svg → campsite.svg} +0 -0
  204. /package/icons/{toll_booth.svg → toll.svg} +0 -0
package/style.css CHANGED
@@ -1 +1 @@
1
- svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}circle.svelte-1aq105l{stroke-width:1.875;fill:none}path.svelte-1aq105l{stroke-width:1.875;stroke-linecap:round}svg.svelte-1aq105l{display:block;stroke:var(--color-icon-button)}form.svelte-zh3kmv.svelte-zh3kmv{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text:#444952;--color-icon-button:#444952}form.svelte-zh3kmv.svelte-zh3kmv,form.svelte-zh3kmv .svelte-zh3kmv,form.svelte-zh3kmv .svelte-zh3kmv:after,form.svelte-zh3kmv .svelte-zh3kmv:before{box-sizing:border-box}form.can-collapse.svelte-zh3kmv.svelte-zh3kmv{max-width:29px}form.svelte-zh3kmv.svelte-zh3kmv,form.svelte-zh3kmv.svelte-zh3kmv:focus-within,form.svelte-zh3kmv.svelte-zh3kmv:hover{width:270px;max-width:270px}input.svelte-zh3kmv.svelte-zh3kmv{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input.svelte-zh3kmv.svelte-zh3kmv:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-zh3kmv.svelte-zh3kmv,div.error.svelte-zh3kmv.svelte-zh3kmv,div.no-results.svelte-zh3kmv.svelte-zh3kmv{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul.svelte-zh3kmv.svelte-zh3kmv{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-zh3kmv.svelte-zh3kmv,div.no-results.svelte-zh3kmv.svelte-zh3kmv{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-zh3kmv.svelte-zh3kmv{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-zh3kmv div.svelte-zh3kmv{flex-grow:1}div.error.svelte-zh3kmv svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-zh3kmv button.svelte-zh3kmv{flex-shrink:0}div.error.svelte-zh3kmv button.svelte-zh3kmv>svg{width:13px;fill:#e25041}div.error.svelte-zh3kmv button.svelte-zh3kmv:hover svg,div.error.svelte-zh3kmv button.svelte-zh3kmv:active svg{fill:#444952}div.no-results.svelte-zh3kmv.svelte-zh3kmv{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-zh3kmv svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.maplibregl-ctrl-bottom-left ul.svelte-zh3kmv.svelte-zh3kmv,.maplibregl-ctrl-bottom-right ul.svelte-zh3kmv.svelte-zh3kmv{top:auto;bottom:100%}button.svelte-zh3kmv.svelte-zh3kmv{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-zh3kmv.svelte-zh3kmv:hover{background-color:transparent}button.svelte-zh3kmv:hover svg,button.svelte-zh3kmv:active svg{fill:#2b8bfb}.input-group.svelte-zh3kmv.svelte-zh3kmv{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-zh3kmv.svelte-zh3kmv:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-zh3kmv.svelte-zh3kmv{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-zh3kmv.svelte-zh3kmv{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-zh3kmv.svelte-zh3kmv{display:flex;flex-shrink:0}.maplibregl-ctrl-geocoder{position:relative;z-index:3}.maptiler-ctrl:not(:empty){box-shadow:none}.maptiler-ctrl .input-group.svelte-zh3kmv.svelte-zh3kmv{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-zh3kmv.svelte-zh3kmv:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-zh3kmv.svelte-zh3kmv{max-width:33px}.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv,.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv:focus-within,.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv:hover{width:270px;max-width:270px}
1
+ svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}circle.svelte-1aq105l{stroke-width:1.875;fill:none}path.svelte-1aq105l{stroke-width:1.875;stroke-linecap:round}svg.svelte-1aq105l{display:block;stroke:var(--color-icon-button)}form.svelte-qnu791.svelte-qnu791{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text:#444952;--color-icon-button:#444952}form.svelte-qnu791.svelte-qnu791,form.svelte-qnu791 .svelte-qnu791,form.svelte-qnu791 .svelte-qnu791:after,form.svelte-qnu791 .svelte-qnu791:before{box-sizing:border-box}form.can-collapse.svelte-qnu791.svelte-qnu791{max-width:29px}form.can-collapse.svelte-qnu791 input.svelte-qnu791::placeholder{transition:opacity .25s;opacity:0}form.svelte-qnu791.svelte-qnu791,form.svelte-qnu791.svelte-qnu791:focus-within,form.svelte-qnu791.svelte-qnu791:hover{width:270px;max-width:270px}form.svelte-qnu791 input.svelte-qnu791::placeholder,form.svelte-qnu791:focus-within input.svelte-qnu791::placeholder,form.svelte-qnu791:hover input.svelte-qnu791::placeholder{opacity:1}input.svelte-qnu791.svelte-qnu791{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input.svelte-qnu791.svelte-qnu791:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-qnu791.svelte-qnu791,div.error.svelte-qnu791.svelte-qnu791,div.no-results.svelte-qnu791.svelte-qnu791{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul.svelte-qnu791.svelte-qnu791{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-qnu791.svelte-qnu791,div.no-results.svelte-qnu791.svelte-qnu791{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-qnu791.svelte-qnu791{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-qnu791 div.svelte-qnu791{flex-grow:1}div.error.svelte-qnu791 svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-qnu791 button.svelte-qnu791{flex-shrink:0}div.error.svelte-qnu791 button.svelte-qnu791>svg{width:13px;fill:#e25041}div.error.svelte-qnu791 button.svelte-qnu791:hover svg,div.error.svelte-qnu791 button.svelte-qnu791:active svg{fill:#444952}div.no-results.svelte-qnu791.svelte-qnu791{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-qnu791 svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.maplibregl-ctrl-bottom-left ul.svelte-qnu791.svelte-qnu791,.maplibregl-ctrl-bottom-right ul.svelte-qnu791.svelte-qnu791{top:auto;bottom:100%}button.svelte-qnu791.svelte-qnu791{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-qnu791.svelte-qnu791:hover{background-color:transparent}button.svelte-qnu791:hover svg,button.svelte-qnu791:active svg{fill:#2b8bfb}.input-group.svelte-qnu791.svelte-qnu791{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-qnu791.svelte-qnu791:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-qnu791.svelte-qnu791{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-qnu791.svelte-qnu791{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-qnu791.svelte-qnu791{display:flex;flex-shrink:0}.maplibregl-ctrl-geocoder{position:relative;z-index:3}.maptiler-ctrl:not(:empty){box-shadow:none}.maptiler-ctrl .input-group.svelte-qnu791.svelte-qnu791{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-qnu791.svelte-qnu791:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-qnu791.svelte-qnu791{max-width:33px}.maptiler-ctrl form.svelte-qnu791.svelte-qnu791,.maptiler-ctrl form.svelte-qnu791.svelte-qnu791:focus-within,.maptiler-ctrl form.svelte-qnu791.svelte-qnu791:hover{width:270px;max-width:270px}
@@ -20,9 +20,10 @@ $: {
20
20
  : undefined;
21
21
  } while (index > -1 && (!imageUrl || missingIconsCache.has(imageUrl)));
22
22
  }
23
- $: placeType = feature.id.startsWith("poi.")
24
- ? feature.properties?.categories?.join(", ")
25
- : (feature.properties?.place_type_name?.[0] ?? feature.place_type[0]);
23
+ $: placeType =
24
+ feature.properties?.categories?.join(", ") ??
25
+ feature.properties?.place_type_name?.[0] ??
26
+ feature.place_type[0];
26
27
  function handleImgError() {
27
28
  if (imageUrl) {
28
29
  missingIconsCache.add(imageUrl);
@@ -37,7 +38,7 @@ function handleImgError() {
37
38
  <img src={imageUrl} alt={category} on:error={() => handleImgError()} />
38
39
  {:else if feature.address}
39
40
  <img src={iconsBaseUrl + "housenumber.svg"} alt={placeType} />
40
- {:else if feature.properties?.kind === "road" || feature.properties?.kind === "road_relation"}
41
+ {:else if feature.id.startsWith("road.")}
41
42
  <img src={iconsBaseUrl + "road.svg"} alt={placeType} />
42
43
  {:else if feature.id.startsWith("address.")}
43
44
  <img src={iconsBaseUrl + "street.svg"} alt={placeType} />
@@ -57,7 +58,7 @@ function handleImgError() {
57
58
  {isReverse ? feature.place_name : feature.place_name.replace(/,.*/, "")}
58
59
  </span>
59
60
 
60
- {#if showPlaceType === "always" || (showPlaceType && !feature.address && feature.properties?.kind !== "road" && feature.properties?.kind !== "road_relation" && !feature.id.startsWith("address.") && !feature.id.startsWith("postal_code.") && (!feature.id.startsWith("poi.") || !imageUrl) && !isReverse)}
61
+ {#if showPlaceType === "always" || (showPlaceType && !feature.address && !feature.id.startsWith("road.") && !feature.id.startsWith("address.") && !feature.id.startsWith("postal_code.") && (!feature.id.startsWith("poi.") || !imageUrl) && !isReverse)}
61
62
  <span class="secondary">
62
63
  {placeType}
63
64
  </span>
@@ -9,6 +9,31 @@ import { default as SearchIcon } from "./SearchIcon.svelte";
9
9
  import { unwrapBbox, wrapNum } from "./geoUtils";
10
10
  import { getProximity } from "./proximity";
11
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
+ };
12
37
  let className = undefined;
13
38
  export { className as class };
14
39
  export let apiKey;
@@ -43,12 +68,12 @@ export let flyToSelected = false;
43
68
  export let markerOnSelected = true;
44
69
  export let types = undefined;
45
70
  export let excludeTypes = false;
46
- export let zoom = 16;
47
- export let maxZoom = 18;
71
+ export let zoom = ZOOM_DEFAULTS;
72
+ export let maxZoom = undefined;
48
73
  export let apiUrl = "https://api.maptiler.com/geocoding";
49
74
  export let fetchParameters = {};
50
75
  export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
51
- "1.3.3" +
76
+ "1.4.1" +
52
77
  "/icons/";
53
78
  export let adjustUrlQuery = () => { };
54
79
  export function focus() {
@@ -109,12 +134,10 @@ $: {
109
134
  if (mapController && picked && picked.id !== prevIdToFly && flyTo) {
110
135
  if (!picked.bbox ||
111
136
  (picked.bbox[0] === picked.bbox[2] && picked.bbox[1] === picked.bbox[3])) {
112
- mapController.flyTo(picked.center, picked.id.startsWith("poi.") || picked.id.startsWith("address.")
113
- ? maxZoom
114
- : zoom);
137
+ mapController.flyTo(picked.center, computeZoom(picked));
115
138
  }
116
139
  else {
117
- mapController.fitBounds(unwrapBbox(picked.bbox), 50, maxZoom);
140
+ mapController.fitBounds(unwrapBbox(picked.bbox), 50, computeZoom(picked));
118
141
  }
119
142
  listFeatures = undefined;
120
143
  markedFeatures = undefined;
@@ -123,9 +146,7 @@ $: {
123
146
  prevIdToFly = picked?.id;
124
147
  }
125
148
  $: if (mapController && selected && flyTo && flyToSelected) {
126
- mapController.flyTo(selected.center, selected.id.startsWith("poi.") || selected.id.startsWith("address.")
127
- ? maxZoom
128
- : zoom);
149
+ mapController.flyTo(selected.center, computeZoom(selected));
129
150
  }
130
151
  // if markerOnSelected was dynamically changed to false
131
152
  $: if (!markerOnSelected) {
@@ -384,7 +405,16 @@ function zoomToResults() {
384
405
  }
385
406
  const bbox = [180, 90, -180, -90];
386
407
  const fuzzyOnly = !markedFeatures.some((feature) => !feature.matching_text);
408
+ let allZoom;
387
409
  for (const feature of markedFeatures) {
410
+ const featZoom = computeZoom(feature);
411
+ allZoom =
412
+ maxZoom ??
413
+ (allZoom === undefined
414
+ ? featZoom
415
+ : featZoom === undefined
416
+ ? allZoom
417
+ : Math.max(allZoom, featZoom));
388
418
  if (fuzzyOnly || !feature.matching_text) {
389
419
  for (const i of [0, 1, 2, 3]) {
390
420
  bbox[i] = Math[i < 2 ? "min" : "max"](bbox[i], feature.bbox?.[i] ?? feature.center[i % 2]);
@@ -393,13 +423,32 @@ function zoomToResults() {
393
423
  }
394
424
  if (mapController && markedFeatures.length > 0) {
395
425
  if (picked && bbox[0] === bbox[2] && bbox[1] === bbox[3]) {
396
- mapController.flyTo(picked.center, zoom);
426
+ mapController.flyTo(picked.center, computeZoom(picked));
397
427
  }
398
428
  else {
399
- mapController.fitBounds(unwrapBbox(bbox), 50, maxZoom);
429
+ mapController.fitBounds(unwrapBbox(bbox), 50, allZoom);
400
430
  }
401
431
  }
402
432
  }
433
+ function computeZoom(feature) {
434
+ if (!feature.bbox ||
435
+ (feature.bbox[0] !== feature.bbox[2] &&
436
+ feature.bbox[1] !== feature.bbox[3])) {
437
+ return undefined;
438
+ }
439
+ if (typeof zoom === "number") {
440
+ return feature.id.startsWith("poi.") || feature.id.startsWith("address.")
441
+ ? maxZoom
442
+ : zoom;
443
+ }
444
+ const index = feature.id.replace(/\..*/, "");
445
+ return ((Array.isArray(feature.properties?.categories)
446
+ ? feature.properties.categories.reduce((a, category) => {
447
+ const b = zoom[index + "." + category];
448
+ return a === undefined ? b : b === undefined ? a : Math.max(a, b);
449
+ }, undefined)
450
+ : undefined) ?? zoom[index]);
451
+ }
403
452
  function handleReverse(coordinates) {
404
453
  reverseActive = enableReverse === "always";
405
454
  listFeatures = undefined;
@@ -572,10 +621,17 @@ form, form *, form *:after, form *:before {
572
621
  form.can-collapse {
573
622
  max-width: 29px;
574
623
  }
624
+ form.can-collapse input::placeholder {
625
+ transition: opacity 0.25s;
626
+ opacity: 0;
627
+ }
575
628
  form, form:focus-within, form:hover {
576
629
  width: 270px;
577
630
  max-width: 270px;
578
631
  }
632
+ form input::placeholder, form:focus-within input::placeholder, form:hover input::placeholder {
633
+ opacity: 1;
634
+ }
579
635
 
580
636
  input {
581
637
  font: inherit;
@@ -2,6 +2,7 @@ import { SvelteComponent } from "svelte";
2
2
  import type { BBox, Feature, FeatureCollection, MapController, ProximityRule } from "./types";
3
3
  declare const __propDef: {
4
4
  props: {
5
+ ZOOM_DEFAULTS?: Record<string, number>;
5
6
  class?: string | undefined;
6
7
  apiKey: string;
7
8
  bbox?: BBox | undefined;
@@ -33,8 +34,8 @@ declare const __propDef: {
33
34
  markerOnSelected?: boolean;
34
35
  types?: string[] | undefined;
35
36
  excludeTypes?: boolean;
36
- zoom?: number;
37
- maxZoom?: number;
37
+ zoom?: number | Record<string, number>;
38
+ maxZoom?: number | undefined;
38
39
  apiUrl?: string;
39
40
  fetchParameters?: RequestInit;
40
41
  iconsBaseUrl?: string;
@@ -70,6 +71,7 @@ export type GeocodingControlProps = typeof __propDef.props;
70
71
  export type GeocodingControlEvents = typeof __propDef.events;
71
72
  export type GeocodingControlSlots = typeof __propDef.slots;
72
73
  export default class GeocodingControl extends SvelteComponent<GeocodingControlProps, GeocodingControlEvents, GeocodingControlSlots> {
74
+ get ZOOM_DEFAULTS(): Record<string, number>;
73
75
  get focus(): () => void;
74
76
  get blur(): () => void;
75
77
  get setQuery(): (value: string, submit?: boolean, reverse?: boolean) => void;
@@ -6,7 +6,13 @@ export function wrapNum(x, range, includeMax) {
6
6
  export function unwrapBbox(bbox0) {
7
7
  const bbox = [...bbox0];
8
8
  if (bbox[2] < bbox[0]) {
9
- bbox[2] += 360;
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
+ }
10
16
  }
11
17
  return bbox;
12
18
  }
@@ -2,8 +2,8 @@ import * as L from "leaflet";
2
2
  import type { BBox, Feature, MapEvent, Position } from "./types";
3
3
  export declare function createLeafletMapController(map: L.Map, marker?: boolean | L.MarkerOptions, showResultMarkers?: boolean | L.MarkerOptions, flyToOptions?: L.ZoomPanOptions, flyToBounds?: L.FitBoundsOptions, fullGeometryStyle?: L.PathOptions | L.StyleFunction): {
4
4
  setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
5
- flyTo(center: Position, zoom: number): void;
6
- fitBounds(bbox: BBox, padding: number, maxZoom: number): void;
5
+ flyTo(center: Position, zoom?: number): void;
6
+ fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
7
7
  indicateReverse(reverse: boolean): void;
8
8
  setReverseMarker(coordinates?: Position): void;
9
9
  setMarkers(markedFeatures: Feature[] | undefined, picked: Feature | undefined): void;
@@ -1,6 +1,9 @@
1
+ import bbox from "@turf/bbox";
2
+ import clone from "@turf/clone";
1
3
  import { feature, featureCollection } from "@turf/helpers";
2
4
  import union from "@turf/union";
3
5
  import * as L from "leaflet";
6
+ import { unwrapBbox } from "./geoUtils";
4
7
  import MarkerIcon from "./MarkerIcon.svelte";
5
8
  import { setMask } from "./mask";
6
9
  export function createLeafletMapController(map, marker = true, showResultMarkers = true, flyToOptions = {}, flyToBounds = {}, fullGeometryStyle = (feature) => {
@@ -65,7 +68,12 @@ export function createLeafletMapController(map, marker = true, showResultMarkers
65
68
  map.flyToBounds([
66
69
  [bbox[1], bbox[0]],
67
70
  [bbox[3], bbox[2]],
68
- ], { padding: [padding, padding], duration: 2, maxZoom, ...flyToBounds });
71
+ ], {
72
+ padding: [padding, padding],
73
+ duration: 2,
74
+ ...(maxZoom ? { maxZoom } : {}),
75
+ ...flyToBounds,
76
+ });
69
77
  },
70
78
  indicateReverse(reverse) {
71
79
  map.getContainer().style.cursor = reverse ? "crosshair" : "";
@@ -138,7 +146,24 @@ export function createLeafletMapController(map, marker = true, showResultMarkers
138
146
  }
139
147
  else if (picked.geometry.type === "Polygon" ||
140
148
  picked.geometry.type === "MultiPolygon") {
141
- setMask(picked, setData);
149
+ setMask(picked, (fc) => {
150
+ if (!fc) {
151
+ return;
152
+ }
153
+ // leaflet doesn't repeat features every 360 degrees along longitude
154
+ // so we clone it manually to the direction(s)
155
+ // which could be displayed when auto-zoomed on the feature
156
+ const features = [...fc.features];
157
+ const bb = unwrapBbox(bbox(picked));
158
+ const span = bb[2] - bb[0];
159
+ if (bb[0] - span / 4 < -180) {
160
+ features.push(...shiftPolyCollection(fc, -360).features);
161
+ }
162
+ if (bb[2] + span / 4 > 180) {
163
+ features.push(...shiftPolyCollection(fc, 360).features);
164
+ }
165
+ setData(featureCollection(features));
166
+ });
142
167
  }
143
168
  else if (picked.geometry.type === "LineString" ||
144
169
  picked.geometry.type === "MultiLineString") {
@@ -200,3 +225,24 @@ export function createLeafletMapController(map, marker = true, showResultMarkers
200
225
  },
201
226
  };
202
227
  }
228
+ function shiftPolyCollection(featureCollection, distance) {
229
+ const cloned = clone(featureCollection);
230
+ for (const feature of cloned.features) {
231
+ if (feature.geometry.type == "MultiPolygon") {
232
+ for (const poly of feature.geometry.coordinates) {
233
+ shiftPolyCoords(poly, distance);
234
+ }
235
+ }
236
+ else {
237
+ shiftPolyCoords(feature.geometry.coordinates, distance);
238
+ }
239
+ }
240
+ return cloned;
241
+ }
242
+ function shiftPolyCoords(coordinates, distance) {
243
+ for (const ring of coordinates) {
244
+ for (const position of ring) {
245
+ position[0] += distance;
246
+ }
247
+ }
248
+ }
@@ -8,8 +8,8 @@ export declare function createMapLibreGlMapController(map: Map, maplibregl?: Map
8
8
  line?: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
9
9
  }): {
10
10
  setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
11
- flyTo(center: Position, zoom: number): void;
12
- fitBounds(bbox: BBox, padding: number, maxZoom: number): void;
11
+ flyTo(center: Position, zoom?: number): void;
12
+ fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
13
13
  indicateReverse(reverse: boolean): void;
14
14
  setReverseMarker(coordinates?: Position): void;
15
15
  setMarkers(markedFeatures: Feature[] | undefined, picked: Feature | undefined): void;
@@ -89,6 +89,9 @@ export function createMapLibreGlMapController(map, maplibregl, marker = true, sh
89
89
  }
90
90
  function setData(data) {
91
91
  savedData = data;
92
+ if (!data) {
93
+ return;
94
+ }
92
95
  map.getSource("full-geom")?.setData(data);
93
96
  }
94
97
  return {
@@ -103,13 +106,13 @@ export function createMapLibreGlMapController(map, maplibregl, marker = true, sh
103
106
  }
104
107
  },
105
108
  flyTo(center, zoom) {
106
- map.flyTo({ center, zoom, ...flyToOptions });
109
+ map.flyTo({ center, ...(zoom ? { zoom } : {}), ...flyToOptions });
107
110
  },
108
111
  fitBounds(bbox, padding, maxZoom) {
109
112
  map.fitBounds([
110
113
  [bbox[0], bbox[1]],
111
114
  [bbox[2], bbox[3]],
112
- ], { padding, maxZoom, ...fitBoundsOptions });
115
+ ], { padding, ...(maxZoom ? { maxZoom } : {}), ...fitBoundsOptions });
113
116
  },
114
117
  indicateReverse(reverse) {
115
118
  map.getCanvasContainer().style.cursor = reverse ? "crosshair" : "";
package/svelte/mask.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import type { Feature, FeatureCollection, MultiPolygon, Polygon } from "geojson";
2
- export declare function setMask(picked: Feature<Polygon | MultiPolygon>, setData: (data: FeatureCollection<Polygon | MultiPolygon>) => void): void;
2
+ export declare function setMask(picked: Feature<Polygon | MultiPolygon>, setData: (data?: FeatureCollection<Polygon | MultiPolygon>) => void): void;
package/svelte/mask.js CHANGED
@@ -1,19 +1,9 @@
1
- import buffer from "@turf/buffer";
1
+ import bbox from "@turf/bbox";
2
2
  import difference from "@turf/difference";
3
+ import flatten from "@turf/flatten";
3
4
  import { featureCollection, polygon } from "@turf/helpers";
4
- // see https://maplibre.org/maplibre-gl-js-docs/example/line-across-180th-meridian/
5
- function fixRing(ring) {
6
- let prev = undefined;
7
- for (const c of ring) {
8
- if (prev && c[0] - prev[0] >= 180) {
9
- c[0] -= 360;
10
- }
11
- else if (prev && c[0] - prev[0] < -180) {
12
- c[0] += 360;
13
- }
14
- prev = c;
15
- }
16
- }
5
+ import union from "@turf/union";
6
+ import { unwrapBbox } from "./geoUtils";
17
7
  export function setMask(picked, setData) {
18
8
  const diff = difference(featureCollection([
19
9
  polygon([
@@ -30,22 +20,35 @@ export function setMask(picked, setData) {
30
20
  if (!diff) {
31
21
  return;
32
22
  }
33
- diff.properties = { isMask: "y" };
34
- const fixed = buffer(picked, 0);
35
- if (!fixed) {
36
- return;
37
- }
38
- if (fixed.geometry.type === "Polygon") {
39
- for (const ring of fixed.geometry.coordinates) {
40
- fixRing(ring);
41
- }
42
- }
43
- else {
44
- for (const poly of fixed.geometry.coordinates) {
45
- for (const ring of poly) {
46
- fixRing(ring);
23
+ diff.properties = { isMask: true };
24
+ const bb = unwrapBbox(bbox(picked));
25
+ // bigger features (continents, oceans) have bigger tolerance
26
+ // because of the used source data simplification
27
+ const tolerance = (bb[2] - bb[0]) / 360 / 1_000;
28
+ const leaksLeft = bb[0] < -180;
29
+ const leaksRight = bb[2] > 180;
30
+ const flattened = flatten(picked);
31
+ if (flattened.features.length > 1 && (leaksLeft || leaksRight)) {
32
+ for (const poly of flattened.features) {
33
+ const bb = unwrapBbox(bbox(poly));
34
+ if (leaksRight && bb[0] < -180 + tolerance) {
35
+ for (const ring of poly.geometry.coordinates) {
36
+ for (const position of ring) {
37
+ position[0] += 360 - tolerance;
38
+ }
39
+ }
40
+ }
41
+ if (leaksLeft && bb[2] > 180 - tolerance) {
42
+ for (const ring of poly.geometry.coordinates) {
43
+ for (const position of ring) {
44
+ position[0] -= 360 - tolerance;
45
+ }
46
+ }
47
47
  }
48
48
  }
49
49
  }
50
- setData(featureCollection([fixed, diff]));
50
+ setData(featureCollection([
51
+ flattened.features.length < 2 ? picked : (union(flattened) ?? picked),
52
+ diff,
53
+ ]));
51
54
  }
@@ -1,5 +1,5 @@
1
- import { Feature } from "ol";
2
- import { GeometryCollection as OlGeometryCollection, LineString as OlLineString, MultiLineString as OlMultiLineString, MultiPolygon as OlMultiPolygon, Polygon as OlPolygon, Point, } from "ol/geom";
1
+ import { Feature as OlFeature } from "ol";
2
+ import { GeometryCollection as OlGeometryCollection, LineString as OlLineString, MultiLineString as OlMultiLineString, MultiPolygon as OlMultiPolygon, Point as OlPoint, Polygon as OlPolygon, } from "ol/geom";
3
3
  import VectorLayer from "ol/layer/Vector";
4
4
  import { fromLonLat, getUserProjection, toLonLat, transformExtent, } from "ol/proj";
5
5
  import VectorSource from "ol/source/Vector";
@@ -133,7 +133,7 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
133
133
  flyTo(center, zoom) {
134
134
  map.getView().animate({
135
135
  center: fromLonLat(center, getProjection()),
136
- zoom,
136
+ ...(zoom ? { zoom } : {}),
137
137
  duration: 2000,
138
138
  ...flyToOptions,
139
139
  });
@@ -141,7 +141,7 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
141
141
  fitBounds(bbox, padding, maxZoom) {
142
142
  map.getView().fit(transformExtent(bbox, EPSG_4326, getProjection()), {
143
143
  padding: [padding, padding, padding, padding],
144
- maxZoom,
144
+ ...(maxZoom ? { maxZoom } : {}),
145
145
  duration: 2000,
146
146
  ...flyToBounds,
147
147
  });
@@ -162,7 +162,7 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
162
162
  }
163
163
  }
164
164
  else if (coordinates) {
165
- reverseMarker = new Feature(new Point(fromLonLat(coordinates, getProjection())));
165
+ reverseMarker = new OlFeature(new OlPoint(fromLonLat(coordinates, getProjection())));
166
166
  reverseMarker.setProperties({ isReverse: true });
167
167
  source.addFeature(reverseMarker);
168
168
  }
@@ -181,7 +181,7 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
181
181
  if (!geom) {
182
182
  continue;
183
183
  }
184
- source.addFeature(new Feature({
184
+ source.addFeature(new OlFeature({
185
185
  isMask: !!f.properties?.isMask,
186
186
  geometry: fromWgs84(geom),
187
187
  }));
@@ -191,7 +191,6 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
191
191
  if (reverseMarker) {
192
192
  source.addFeature(reverseMarker);
193
193
  }
194
- setData();
195
194
  if (picked) {
196
195
  let handled = false;
197
196
  if (picked.geometry.type === "GeometryCollection") {
@@ -203,17 +202,17 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
203
202
  : null)
204
203
  .filter((a) => !!a);
205
204
  if (geoms.length > 0) {
206
- source.addFeature(new Feature(fromWgs84(new OlGeometryCollection(geoms))));
205
+ source.addFeature(new OlFeature(fromWgs84(new OlGeometryCollection(geoms))));
207
206
  handled = true;
208
207
  }
209
208
  else {
210
209
  for (const geometry of picked.geometry.geometries) {
211
210
  if (geometry.type === "LineString") {
212
- source.addFeature(new Feature(fromWgs84(new OlLineString(geometry.coordinates))));
211
+ source.addFeature(new OlFeature(fromWgs84(new OlLineString(geometry.coordinates))));
213
212
  handled = true;
214
213
  }
215
214
  else if (geometry.type === "MultiLineString") {
216
- source.addFeature(new Feature(fromWgs84(new OlMultiLineString(geometry.coordinates))));
215
+ source.addFeature(new OlFeature(fromWgs84(new OlMultiLineString(geometry.coordinates))));
217
216
  }
218
217
  handled = true;
219
218
  }
@@ -229,20 +228,20 @@ export function createOpenLayersMapController(map, flyToOptions = {}, flyToBound
229
228
  setMask(picked, setData);
230
229
  }
231
230
  else if (picked.geometry.type === "LineString") {
232
- source.addFeature(new Feature(fromWgs84(new OlLineString(picked.geometry.coordinates))));
231
+ source.addFeature(new OlFeature(fromWgs84(new OlLineString(picked.geometry.coordinates))));
233
232
  return; // no pin for (multi)linestrings
234
233
  }
235
234
  else if (picked.geometry.type === "MultiLineString") {
236
- source.addFeature(new Feature(fromWgs84(new OlMultiLineString(picked.geometry.coordinates))));
235
+ source.addFeature(new OlFeature(fromWgs84(new OlMultiLineString(picked.geometry.coordinates))));
237
236
  return; // no pin for (multi)linestrings
238
237
  }
239
- source.addFeature(new Feature(fromWgs84(new Point(picked.center))));
238
+ source.addFeature(new OlFeature(fromWgs84(new OlPoint(picked.center))));
240
239
  }
241
240
  for (const feature of markedFeatures ?? []) {
242
241
  if (feature === picked) {
243
242
  continue;
244
243
  }
245
- const marker = new Feature(new Point(fromLonLat(feature.center, getProjection())));
244
+ const marker = new OlFeature(new OlPoint(fromLonLat(feature.center, getProjection())));
246
245
  marker.setId(feature.id);
247
246
  marker.setProperties({
248
247
  fuzzy: !!feature.matching_text,
package/svelte/types.d.ts CHANGED
@@ -30,8 +30,8 @@ export type MapEvent = {
30
30
  };
31
31
  export type MapController = {
32
32
  setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
33
- flyTo(center: Position, zoom: number): void;
34
- fitBounds(bbox: BBox, padding: number, maxZoom: number): void;
33
+ flyTo(center: Position, zoom?: number): void;
34
+ fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
35
35
  indicateReverse(reverse: boolean): void;
36
36
  setMarkers(features: Feature[] | undefined, picked: Feature | undefined): void;
37
37
  setReverseMarker(coordinates?: Position): void;
@@ -129,15 +129,21 @@ export type ControlOptions = {
129
129
  */
130
130
  fuzzyMatch?: boolean;
131
131
  /**
132
- * On geocoded result what zoom level should the map animate to when a bbox isn't found in the response.
133
- * If a bbox is found the map will fit to the bbox.
134
- * Default value is `16`
132
+ * On geocoded result what zoom level should the map animate to when a bbox in the response isn't present or is a point.
133
+ * If a bbox is present and not a point then the map will fit to the bbox.
134
+ *
135
+ * Value can be a number (deprecated) or key-value pairs, where key is a &lt;type&gt; or &lt;type&gt;.&lt;categoy&gt; and value is the zoom level.
136
+ *
137
+ * Default value is `GeocodingControl.ZOOM_DEFAULTS`.
135
138
  */
136
- zoom?: number;
139
+ zoom?: number | Record<string, number>;
137
140
  /**
138
- * On geocoded result what max zoom level should the map animate to when a bbox isn't found in the response. Used for small features.
139
- * If a bbox is found the map will fit to the bbox.
140
- * Default value is `18`.
141
+ * On geocoded result what max zoom level should the map animate to when a bbox in the response isn't present or is a point.
142
+ * Used for small features.
143
+ *
144
+ * If a bbox is present and not a point then the map will fit to the bbox.
145
+ *
146
+ * @deprecated use `zoom` option
141
147
  */
142
148
  maxZoom?: number;
143
149
  /**
package/types.d.ts CHANGED
@@ -30,8 +30,8 @@ export type MapEvent = {
30
30
  };
31
31
  export type MapController = {
32
32
  setEventHandler(handler: undefined | ((e: MapEvent) => void)): void;
33
- flyTo(center: Position, zoom: number): void;
34
- fitBounds(bbox: BBox, padding: number, maxZoom: number): void;
33
+ flyTo(center: Position, zoom?: number): void;
34
+ fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
35
35
  indicateReverse(reverse: boolean): void;
36
36
  setMarkers(features: Feature[] | undefined, picked: Feature | undefined): void;
37
37
  setReverseMarker(coordinates?: Position): void;
@@ -129,15 +129,21 @@ export type ControlOptions = {
129
129
  */
130
130
  fuzzyMatch?: boolean;
131
131
  /**
132
- * On geocoded result what zoom level should the map animate to when a bbox isn't found in the response.
133
- * If a bbox is found the map will fit to the bbox.
134
- * Default value is `16`
132
+ * On geocoded result what zoom level should the map animate to when a bbox in the response isn't present or is a point.
133
+ * If a bbox is present and not a point then the map will fit to the bbox.
134
+ *
135
+ * Value can be a number (deprecated) or key-value pairs, where key is a &lt;type&gt; or &lt;type&gt;.&lt;categoy&gt; and value is the zoom level.
136
+ *
137
+ * Default value is `GeocodingControl.ZOOM_DEFAULTS`.
135
138
  */
136
- zoom?: number;
139
+ zoom?: number | Record<string, number>;
137
140
  /**
138
- * On geocoded result what max zoom level should the map animate to when a bbox isn't found in the response. Used for small features.
139
- * If a bbox is found the map will fit to the bbox.
140
- * Default value is `18`.
141
+ * On geocoded result what max zoom level should the map animate to when a bbox in the response isn't present or is a point.
142
+ * Used for small features.
143
+ *
144
+ * If a bbox is present and not a point then the map will fit to the bbox.
145
+ *
146
+ * @deprecated use `zoom` option
141
147
  */
142
148
  maxZoom?: number;
143
149
  /**