@maptiler/geocoding-control 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -0
- package/dist/leaflet.js +1002 -0
- package/dist/leaflet.umd.cjs +1 -0
- package/dist/lib/LeafletGeocodingControl.d.ts +40 -0
- package/dist/lib/LeafletMapControllerImpl.d.ts +3 -0
- package/dist/lib/MaplibreMapControllerImpl.d.ts +4 -0
- package/dist/lib/MaplibreglGeocodingControl.d.ts +49 -0
- package/dist/lib/leafletMapController.d.ts +3 -0
- package/dist/lib/maplibreMapController.d.ts +4 -0
- package/dist/lib/types.d.ts +128 -0
- package/dist/main.d.ts +3 -0
- package/dist/maplibregl.js +995 -0
- package/dist/maplibregl.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +58 -0
- package/src/lib/BullseyeIcon.svelte +12 -0
- package/src/lib/ClearIcon.svelte +12 -0
- package/src/lib/GeocodingControl.svelte +687 -0
- package/src/lib/LeafletGeocodingControl.ts +123 -0
- package/src/lib/LoadingIcon.svelte +40 -0
- package/src/lib/MaplibreglGeocodingControl.ts +141 -0
- package/src/lib/MarkerIcon.svelte +63 -0
- package/src/lib/SearchIcon.svelte +12 -0
- package/src/lib/leafletMapController.ts +146 -0
- package/src/lib/maplibreMapController.ts +149 -0
- package/src/lib/types.ts +198 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var it=(S,L,W)=>{if(!L.has(S))throw TypeError("Cannot "+W)};var F=(S,L,W)=>(it(S,L,"read from private field"),W?W.call(S):L.get(S)),Ne=(S,L,W)=>{if(L.has(S))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(S):L.set(S,W)},Pe=(S,L,W,J)=>(it(S,L,"write to private field"),J?J.call(S,W):L.set(S,W),W);(function(S,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],L):(S=typeof globalThis<"u"?globalThis:S||self,L(S.leafletMaptilerGeocoder={},S.leaflet))})(this,function(S,L){var Z,ce;"use strict";function W(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,l.get?l:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const J=W(L);function w(){}function ct(t,e){for(const n in e)t[n]=e[n];return t}function qe(t){return t()}function Ge(){return Object.create(null)}function te(t){t.forEach(qe)}function He(t){return typeof t=="function"}function de(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function ft(t){return Object.keys(t).length===0}function ut(t,e,n,l){if(t){const r=Ke(t,e,n,l);return t[0](r)}}function Ke(t,e,n,l){return t[1]&&l?ct(n.ctx.slice(),t[1](l(e))):n.ctx}function at(t,e,n,l){if(t[2]&&l){const r=t[2](l(n));if(e.dirty===void 0)return r;if(typeof r=="object"){const c=[],o=Math.max(e.dirty.length,r.length);for(let i=0;i<o;i+=1)c[i]=e.dirty[i]|r[i];return c}return e.dirty|r}return e.dirty}function dt(t,e,n,l,r,c){if(r){const o=Ke(e,n,l,c);t.p(o,r)}}function ht(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let l=0;l<n;l++)e[l]=-1;return e}return-1}function Qe(t){return t==null?"":t}function y(t,e){t.appendChild(e)}function Q(t,e,n){t.insertBefore(e,n||null)}function q(t){t.parentNode.removeChild(t)}function _t(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function I(t){return document.createElement(t)}function ne(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function oe(t){return document.createTextNode(t)}function X(){return oe(" ")}function V(t,e,n,l){return t.addEventListener(e,n,l),()=>t.removeEventListener(e,n,l)}function gt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function f(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function mt(t){return Array.from(t.childNodes)}function pe(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ve(t,e){t.value=e==null?"":e}function D(t,e,n){t.classList[n?"add":"remove"](e)}function yt(t,e,{bubbles:n=!1,cancelable:l=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,l,e),r}let ve;function we(t){ve=t}function Ue(){if(!ve)throw new Error("Function called outside component initialization");return ve}function bt(t){Ue().$$.on_destroy.push(t)}function pt(){const t=Ue();return(e,n,{cancelable:l=!1}={})=>{const r=t.$$.callbacks[e];if(r){const c=yt(e,n,{cancelable:l});return r.slice().forEach(o=>{o.call(t,c)}),!c.defaultPrevented}return!0}}const ke=[],je=[],Ee=[],We=[],vt=Promise.resolve();let Oe=!1;function wt(){Oe||(Oe=!0,vt.then(Ze))}function Be(t){Ee.push(t)}const Ae=new Set;let Se=0;function Ze(){const t=ve;do{for(;Se<ke.length;){const e=ke[Se];Se++,we(e),kt(e.$$)}for(we(null),ke.length=0,Se=0;je.length;)je.pop()();for(let e=0;e<Ee.length;e+=1){const n=Ee[e];Ae.has(n)||(Ae.add(n),n())}Ee.length=0}while(ke.length);for(;We.length;)We.pop()();Oe=!1,Ae.clear(),we(t)}function kt(t){if(t.fragment!==null){t.update(),te(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Be)}}const Re=new Set;let ie;function Le(){ie={r:0,c:[],p:ie}}function Ie(){ie.r||te(ie.c),ie=ie.p}function P(t,e){t&&t.i&&(Re.delete(t),t.i(e))}function G(t,e,n,l){if(t&&t.o){if(Re.has(t))return;Re.add(t),ie.c.push(()=>{Re.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function Me(t){t&&t.c()}function he(t,e,n,l){const{fragment:r,after_update:c}=t.$$;r&&r.m(e,n),l||Be(()=>{const o=t.$$.on_mount.map(qe).filter(He);t.$$.on_destroy?t.$$.on_destroy.push(...o):te(o),t.$$.on_mount=[]}),c.forEach(Be)}function _e(t,e){const n=t.$$;n.fragment!==null&&(te(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Mt(t,e){t.$$.dirty[0]===-1&&(ke.push(t),wt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ge(t,e,n,l,r,c,o,i=[-1]){const u=ve;we(t);const a=t.$$={fragment:null,ctx:[],props:c,update:w,not_equal:r,bound:Ge(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Ge(),dirty:i,skip_bound:!1,root:e.target||u.$$.root};o&&o(a.root);let h=!1;if(a.ctx=n?n(t,e.props||{},(p,H,...d)=>{const m=d.length?d[0]:H;return a.ctx&&r(a.ctx[p],a.ctx[p]=m)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](m),h&&Mt(t,p)),H}):[],a.update(),h=!0,te(a.before_update),a.fragment=l?l(a.ctx):!1,e.target){if(e.hydrate){const p=mt(e.target);a.fragment&&a.fragment.l(p),p.forEach(q)}else a.fragment&&a.fragment.c();e.intro&&P(t.$$.fragment),he(t,e.target,e.anchor,e.customElement),Ze()}we(u)}class me{$destroy(){_e(this,1),this.$destroy=w}$on(e,n){if(!He(n))return w;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const r=l.indexOf(n);r!==-1&&l.splice(r,1)}}$set(e){this.$$set&&!ft(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const rn="";function Ct(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"),f(e,"viewBox","0 0 1000 1000"),f(e,"width","18px"),f(e,"height","18px"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class Tt extends me{constructor(e){super(),ge(this,e,null,Ct,de,{})}}const sn="";function Et(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),f(e,"viewBox","0 0 18 18"),f(e,"width","16"),f(e,"height","16"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class St extends me{constructor(e){super(),ge(this,e,null,Et,de,{})}}const on="";function Rt(t){let e;return{c(){e=I("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',f(e,"class","svelte-7cmwmc")},m(n,l){Q(n,e,l)},p:w,i:w,o:w,d(n){n&&q(e)}}}class Lt extends me{constructor(e){super(),ge(this,e,null,Rt,de,{})}}const cn="";function It(t){let e,n,l;return{c(){e=ne("svg"),n=ne("path"),f(n,"stroke-width","4"),f(n,"fill-rule","evenodd"),f(n,"clip-rule","evenodd"),f(n,"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"),f(n,"class","svelte-656hh2"),f(e,"width",l=t[0]!=="list"?void 0:"20"),f(e,"viewBox","0 0 70 85"),f(e,"fill","none"),f(e,"class","svelte-656hh2"),D(e,"in-map",t[0]!=="list"),D(e,"for-maplibre",t[0]==="maplibre"),D(e,"for-leaflet",t[0]==="leaflet"),D(e,"list-icon",t[0]==="list")},m(r,c){Q(r,e,c),y(e,n)},p(r,[c]){c&1&&l!==(l=r[0]!=="list"?void 0:"20")&&f(e,"width",l),c&1&&D(e,"in-map",r[0]!=="list"),c&1&&D(e,"for-maplibre",r[0]==="maplibre"),c&1&&D(e,"for-leaflet",r[0]==="leaflet"),c&1&&D(e,"list-icon",r[0]==="list")},i:w,o:w,d(r){r&&q(e)}}}function Pt(t,e,n){let{displayIn:l}=e;return t.$$set=r=>{"displayIn"in r&&n(0,l=r.displayIn)},[l]}class xe extends me{constructor(e){super(),ge(this,e,Pt,It,de,{displayIn:0})}}const fn="";function jt(t){let e,n;return{c(){e=ne("svg"),n=ne("path"),f(n,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),f(e,"viewBox","0 0 18 18"),f(e,"xml:space","preserve"),f(e,"width","20"),f(e,"class","svelte-en2qvf")},m(l,r){Q(l,e,r),y(e,n)},p:w,i:w,o:w,d(l){l&&q(e)}}}class Ot extends me{constructor(e){super(),ge(this,e,null,jt,de,{})}}const un="";function Je(t,e,n){const l=t.slice();return l[59]=e[n],l[61]=n,l}function Xe(t){let e,n;return e=new Lt({}),{c(){Me(e.$$.fragment)},m(l,r){he(e,l,r),n=!0},i(l){n||(P(e.$$.fragment,l),n=!0)},o(l){G(e.$$.fragment,l),n=!1},d(l){_e(e,l)}}}function Ye(t){let e,n,l,r,c,o;return n=new Tt({}),{c(){e=I("button"),Me(n.$$.fragment),f(e,"type","button"),f(e,"title",l=t[7]===!0?"toggle reverse geocoding":t[7]),f(e,"class","svelte-16s24r9"),D(e,"active",t[1])},m(i,u){Q(i,e,u),he(n,e,null),r=!0,c||(o=V(e,"click",t[47]),c=!0)},p(i,u){(!r||u[0]&128&&l!==(l=i[7]===!0?"toggle reverse geocoding":i[7]))&&f(e,"title",l),(!r||u[0]&2)&&D(e,"active",i[1])},i(i){r||(P(n.$$.fragment,i),r=!0)},o(i){G(n.$$.fragment,i),r=!1},d(i){i&&q(e),_e(n),c=!1,o()}}}function Bt(t){let e,n,l,r,c=t[10],o=[];for(let u=0;u<c.length;u+=1)o[u]=$e(Je(t,c,u));const i=u=>G(o[u],1,1,()=>{o[u]=null});return{c(){e=I("ul");for(let u=0;u<o.length;u+=1)o[u].c();f(e,"class","svelte-16s24r9")},m(u,a){Q(u,e,a);for(let h=0;h<o.length;h+=1)o[h].m(e,null);n=!0,l||(r=[V(e,"mouseout",t[50]),V(e,"blur",t[51])],l=!0)},p(u,a){if(a[0]&7425){c=u[10];let h;for(h=0;h<c.length;h+=1){const p=Je(u,c,h);o[h]?(o[h].p(p,a),P(o[h],1)):(o[h]=$e(p),o[h].c(),P(o[h],1),o[h].m(e,null))}for(Le(),h=c.length;h<o.length;h+=1)i(h);Ie()}},i(u){if(!n){for(let a=0;a<c.length;a+=1)P(o[a]);n=!0}},o(u){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)G(o[a]);n=!1},d(u){u&&q(e),_t(o,u),l=!1,te(r)}}}function At(t){let e,n;return{c(){e=I("div"),n=oe(t[5]),f(e,"class","no-results svelte-16s24r9")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&32&&pe(n,l[5])},i:w,o:w,d(l){l&&q(e)}}}function zt(t){let e,n;return{c(){e=I("div"),n=oe(t[4]),f(e,"class","error svelte-16s24r9")},m(l,r){Q(l,e,r),y(e,n)},p(l,r){r[0]&16&&pe(n,l[4])},i:w,o:w,d(l){l&&q(e)}}}function Dt(t){let e="",n;return{c(){n=oe(e)},m(l,r){Q(l,n,r)},p:w,i:w,o:w,d(l){l&&q(n)}}}function Fe(t){let e,n=t[59].place_type+"",l;return{c(){e=I("span"),l=oe(n),f(e,"class","svelte-16s24r9")},m(r,c){Q(r,e,c),y(e,l)},p(r,c){c[0]&1024&&n!==(n=r[59].place_type+"")&&pe(l,n)},d(r){r&&q(e)}}}function $e(t){let e,n,l,r,c,o,i=t[59].place_name.replace(/,.*/,"")+"",u,a,h,p,H,d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"",m,g,b,M,C,x;n=new xe({props:{displayIn:"list"}});let T=t[8]&&Fe(t);function E(){return t[48](t[61])}function v(){return t[49](t[59])}return{c(){e=I("li"),Me(n.$$.fragment),l=X(),r=I("span"),c=I("span"),o=I("span"),u=oe(i),a=X(),T&&T.c(),h=X(),p=I("span"),H=I("span"),m=oe(d),g=X(),f(o,"class","svelte-16s24r9"),f(c,"class","svelte-16s24r9"),f(r,"class","svelte-16s24r9"),f(H,"class","svelte-16s24r9"),f(p,"class","svelte-16s24r9"),f(e,"tabindex","0"),f(e,"data-selected",b=t[12]===t[61]),f(e,"class","svelte-16s24r9"),D(e,"selected",t[12]===t[61])},m(N,k){Q(N,e,k),he(n,e,null),y(e,l),y(e,r),y(r,c),y(c,o),y(o,u),y(c,a),T&&T.m(c,null),y(e,h),y(e,p),y(p,H),y(H,m),y(e,g),M=!0,C||(x=[V(e,"mouseover",E),V(e,"focus",v)],C=!0)},p(N,k){t=N,(!M||k[0]&1024)&&i!==(i=t[59].place_name.replace(/,.*/,"")+"")&&pe(u,i),t[8]?T?T.p(t,k):(T=Fe(t),T.c(),T.m(c,null)):T&&(T.d(1),T=null),(!M||k[0]&1024)&&d!==(d=t[59].place_name.replace(/[^,]*,?\s*/,"")+"")&&pe(m,d),(!M||k[0]&4096&&b!==(b=t[12]===t[61]))&&f(e,"data-selected",b),(!M||k[0]&4096)&&D(e,"selected",t[12]===t[61])},i(N){M||(P(n.$$.fragment,N),M=!0)},o(N){G(n.$$.fragment,N),M=!1},d(N){N&&q(e),_e(n),T&&T.d(),C=!1,te(x)}}}function Nt(t){let e,n,l,r,c,o,i,u,a,h,p,H,d,m,g,b,M,C,x,T;r=new Ot({}),h=new St({});let E=t[16]&&Xe(),v=t[7]&&Ye(t);const N=t[39].default,k=ut(N,t,t[38],null),j=[Dt,zt,At,Bt],z=[];function Ce(_,O){var $,ee;return _[13]?_[15]?1:(($=_[10])==null?void 0:$.length)===0?2:_[13]&&((ee=_[10])==null?void 0:ee.length)?3:-1:0}return~(g=Ce(t))&&(b=z[g]=j[g](t)),{c(){e=I("form"),n=I("div"),l=I("button"),Me(r.$$.fragment),c=X(),o=I("input"),i=X(),u=I("div"),a=I("button"),Me(h.$$.fragment),p=X(),E&&E.c(),H=X(),v&&v.c(),d=X(),k&&k.c(),m=X(),b&&b.c(),f(l,"type","button"),f(l,"class","svelte-16s24r9"),f(o,"placeholder",t[3]),f(o,"aria-label",t[3]),f(o,"class","svelte-16s24r9"),f(a,"type","button"),f(a,"class","svelte-16s24r9"),D(a,"displayable",t[0]!==""),f(u,"class","clear-button-container svelte-16s24r9"),f(n,"class","input-group svelte-16s24r9"),f(e,"tabindex","0"),f(e,"class",M=Qe(t[2])+" svelte-16s24r9"),D(e,"can-collapse",t[6]&&t[0]==="")},m(_,O){Q(_,e,O),y(e,n),y(n,l),he(r,l,null),y(n,c),y(n,o),t[41](o),Ve(o,t[0]),y(n,i),y(n,u),y(u,a),he(h,a,null),y(u,p),E&&E.m(u,null),y(n,H),v&&v.m(n,null),y(n,d),k&&k.m(n,null),y(e,m),~g&&z[g].m(e,null),C=!0,x||(T=[V(l,"click",t[40]),V(o,"input",t[42]),V(o,"focus",t[43]),V(o,"blur",t[44]),V(o,"keydown",t[18]),V(o,"input",t[45]),V(a,"click",t[46]),V(e,"submit",gt(t[17]))],x=!0)},p(_,O){(!C||O[0]&8)&&f(o,"placeholder",_[3]),(!C||O[0]&8)&&f(o,"aria-label",_[3]),O[0]&1&&o.value!==_[0]&&Ve(o,_[0]),(!C||O[0]&1)&&D(a,"displayable",_[0]!==""),_[16]?E?O[0]&65536&&P(E,1):(E=Xe(),E.c(),P(E,1),E.m(u,null)):E&&(Le(),G(E,1,1,()=>{E=null}),Ie()),_[7]?v?(v.p(_,O),O[0]&128&&P(v,1)):(v=Ye(_),v.c(),P(v,1),v.m(n,d)):v&&(Le(),G(v,1,1,()=>{v=null}),Ie()),k&&k.p&&(!C||O[1]&128)&&dt(k,N,_,_[38],C?at(N,_[38],O,null):ht(_[38]),null);let $=g;g=Ce(_),g===$?~g&&z[g].p(_,O):(b&&(Le(),G(z[$],1,1,()=>{z[$]=null}),Ie()),~g?(b=z[g],b?b.p(_,O):(b=z[g]=j[g](_),b.c()),P(b,1),b.m(e,null)):b=null),(!C||O[0]&4&&M!==(M=Qe(_[2])+" svelte-16s24r9"))&&f(e,"class",M),(!C||O[0]&69)&&D(e,"can-collapse",_[6]&&_[0]==="")},i(_){C||(P(r.$$.fragment,_),P(h.$$.fragment,_),P(E),P(v),P(k,_),P(b),C=!0)},o(_){G(r.$$.fragment,_),G(h.$$.fragment,_),G(E),G(v),G(k,_),G(b),C=!1},d(_){_&&q(e),_e(r),t[41](null),_e(h),E&&E.d(),v&&v.d(),k&&k.d(_),~g&&z[g].d(),x=!1,te(T)}}}function qt(t,e,n){let l,{$$slots:r={},$$scope:c}=e,{class:o=void 0}=e,{mapController:i=void 0}=e,{apiKey:u}=e,{debounceSearch:a=200}=e,{placeholder:h="Search"}=e,{errorMessage:p="Searching failed"}=e,{noResultsMessage:H="No results found"}=e,{proximity:d=void 0}=e,{bbox:m=void 0}=e,{trackProximity:g=!0}=e,{minLength:b=2}=e,{language:M=void 0}=e,{showResultsWhileTyping:C=!0}=e,{zoom:x=16}=e,{flyTo:T=!0}=e,{collapsed:E=!1}=e,{clearOnBlur:v=!1}=e,{enableReverse:N=!1}=e,{filter:k=()=>!0}=e,{searchValue:j=""}=e,{reverseActive:z=!1}=e,{showPlaceType:Ce=!1}=e;function _(){le.focus()}function O(){le.blur()}function $(s,U=!0){n(0,j=s),U&&(n(12,A=-1),nt())}let ee=!1,R,K,B,et="",le,A=-1,fe,tt=[],ue,ze,De;const re=pt();bt(()=>{i&&(i.setProximityChangeHandler(void 0),i.setMapClickHandler(void 0),i.indicateReverse(!1),i.setSelectedMarker(-1),i.setMarkers(void 0,void 0))});function nt(){A>-1&&R?(n(11,B=R[A]),n(0,j=B.place_name.replace(/,.*/,"")),n(15,fe=void 0),n(36,K=void 0),n(12,A=-1)):j&<(j).then(()=>{n(36,K=R),n(11,B=void 0),Qt()}).catch(s=>n(15,fe=s))}async function lt(s){n(15,fe=void 0);const U=/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(s),Y=new URLSearchParams;Y.set("key",u),M&&Y.set("language",String(M)),U||(m&&Y.set("bbox",m.join(",")),d&&Y.set("proximity",d.join(",")));const ae="https://api.maptiler.com/geocoding/"+encodeURIComponent(s)+".json?"+Y.toString();if(ae===et){n(10,R=tt);return}et=ae,ue==null||ue.abort(),n(16,ue=new AbortController);let ye;try{ye=await fetch(ae,{signal:ue.signal}).finally(()=>{n(16,ue=void 0)})}catch(be){if(be&&typeof be=="object"&&be.name==="AbortError")return;throw new Error}if(!ye.ok)throw new Error;const Te=await ye.json();re("response",{url:ae,featureCollection:Te}),n(10,R=Te.features.filter(k)),tt=R,U&&le.focus()}function Qt(){var U,Y,ae,ye,Te,be,st,ot;if(!(K!=null&&K.length)||!T)return;const s=[180,90,-180,-90];for(const se of K)s[0]=Math.min(s[0],(Y=(U=se.bbox)==null?void 0:U[0])!=null?Y:se.center[0]),s[1]=Math.min(s[1],(ye=(ae=se.bbox)==null?void 0:ae[1])!=null?ye:se.center[1]),s[2]=Math.max(s[2],(be=(Te=se.bbox)==null?void 0:Te[2])!=null?be:se.center[0]),s[3]=Math.max(s[3],(ot=(st=se.bbox)==null?void 0:st[3])!=null?ot:se.center[1]);i&&K.length>0&&(B&&s[0]===s[2]&&s[1]===s[3]?i.flyTo(B.center,x):i.fitBounds(s,50))}function Vt(s){n(1,z=!1),$(s[0].toFixed(6)+","+s[1].toFixed(6))}function Ut(s){if(!R)return;let U=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:0;U?(A===-1&&U===-1&&n(12,A=R.length),n(12,A+=U),A>=R.length&&n(12,A=-1),s.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(s.key)&&n(12,A=-1)}function rt(s=!0){if(C&&j.length>b){ze&&clearTimeout(ze);const U=j;ze=window.setTimeout(()=>{lt(U).catch(Y=>n(15,fe=Y))},s?a:0)}else n(10,R=void 0),n(15,fe=void 0)}const Wt=()=>le.focus();function Zt(s){je[s?"unshift":"push"](()=>{le=s,n(14,le)})}function xt(){j=this.value,n(0,j),n(9,ee),n(31,v)}const Jt=()=>n(9,ee=!0),Xt=()=>n(9,ee=!1),Yt=()=>rt(),Ft=()=>{n(0,j=""),le.focus()},$t=()=>n(1,z=!z),en=s=>n(12,A=s),tn=s=>{n(11,B=s),n(0,j=s.place_name.replace(/,.*/,"")),n(12,A=-1)},nn=()=>n(12,A=-1),ln=()=>{};return t.$$set=s=>{"class"in s&&n(2,o=s.class),"mapController"in s&&n(21,i=s.mapController),"apiKey"in s&&n(22,u=s.apiKey),"debounceSearch"in s&&n(23,a=s.debounceSearch),"placeholder"in s&&n(3,h=s.placeholder),"errorMessage"in s&&n(4,p=s.errorMessage),"noResultsMessage"in s&&n(5,H=s.noResultsMessage),"proximity"in s&&n(20,d=s.proximity),"bbox"in s&&n(24,m=s.bbox),"trackProximity"in s&&n(25,g=s.trackProximity),"minLength"in s&&n(26,b=s.minLength),"language"in s&&n(27,M=s.language),"showResultsWhileTyping"in s&&n(28,C=s.showResultsWhileTyping),"zoom"in s&&n(29,x=s.zoom),"flyTo"in s&&n(30,T=s.flyTo),"collapsed"in s&&n(6,E=s.collapsed),"clearOnBlur"in s&&n(31,v=s.clearOnBlur),"enableReverse"in s&&n(7,N=s.enableReverse),"filter"in s&&n(32,k=s.filter),"searchValue"in s&&n(0,j=s.searchValue),"reverseActive"in s&&n(1,z=s.reverseActive),"showPlaceType"in s&&n(8,Ce=s.showPlaceType),"$$scope"in s&&n(38,c=s.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&35651584&&i&&i.setProximityChangeHandler(g?s=>{n(20,d=s)}:void 0),t.$$.dirty[0]&33554432&&(g||n(20,d=void 0)),t.$$.dirty[0]&512|t.$$.dirty[1]&1&&setTimeout(()=>{n(13,De=ee),v&&!ee&&n(0,j="")}),t.$$.dirty[0]&1025&&(j||(n(11,B=void 0),n(10,R=void 0),n(15,fe=void 0),n(36,K=R))),t.$$.dirty[0]&1612711936&&i&&B&&T&&(!B.bbox||B.bbox[0]===B.bbox[2]&&B.bbox[1]===B.bbox[3]?i.flyTo(B.center,x):i.fitBounds(B.bbox,0),n(10,R=void 0),n(36,K=void 0),n(12,A=-1)),t.$$.dirty[0]&1024|t.$$.dirty[1]&32&&K!==R&&n(36,K=void 0),t.$$.dirty[0]&2099200|t.$$.dirty[1]&32&&i&&i.setMarkers(K,B),t.$$.dirty[0]&1&&n(12,A=-1),t.$$.dirty[0]&2101248&&(i==null||i.setSelectedMarker(A)),t.$$.dirty[0]&5120&&n(37,l=R==null?void 0:R[A]),t.$$.dirty[1]&64&&re("select",l),t.$$.dirty[0]&2048&&re("pick",B),t.$$.dirty[0]&9216&&re("optionsVisibilityChange",De&&!!R),t.$$.dirty[0]&1024&&re("featuresListed",R),t.$$.dirty[1]&32&&re("featuresMarked",K),t.$$.dirty[0]&2&&re("reverseToggle",z),t.$$.dirty[0]&1&&re("queryChange",j),t.$$.dirty[0]&2097154&&i&&i.indicateReverse(z),t.$$.dirty[0]&2097154&&i&&i.setMapClickHandler(z?Vt:void 0)},[j,z,o,h,p,H,E,N,Ce,ee,R,B,A,De,le,fe,ue,nt,Ut,rt,d,i,u,a,m,g,b,M,C,x,T,v,k,_,O,$,K,l,c,r,Wt,Zt,xt,Jt,Xt,Yt,Ft,$t,en,tn,nn,ln]}class Gt extends me{constructor(e){super(),ge(this,e,qt,Nt,de,{class:2,mapController:21,apiKey:22,debounceSearch:23,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:20,bbox:24,trackProximity:25,minLength:26,language:27,showResultsWhileTyping:28,zoom:29,flyTo:30,collapsed:6,clearOnBlur:31,enableReverse:7,filter:32,searchValue:0,reverseActive:1,showPlaceType:8,focus:33,blur:34,setQuery:35},null,[-1,-1])}get focus(){return this.$$.ctx[33]}get blur(){return this.$$.ctx[34]}get setQuery(){return this.$$.ctx[35]}}function Ht(t,e=!0,n=!0,l={},r={}){let c,o,i,u=[],a;const h=()=>{if(!c){i=void 0;return}let d;const m=t.getZoom()>10?[(d=t.getCenter().wrap()).lng,d.lat]:void 0;i!==m&&(i=m,c(m))},p=d=>{o==null||o([d.latlng.lng,d.latlng.lat])};return{setProximityChangeHandler(d){d?(c=d,t.on("moveend",h),h()):(t.off("moveend",h),c==null||c(void 0),c=void 0)},setMapClickHandler(d){o=d,o?t.on("click",p):t.off("click",p)},flyTo(d,m){t.flyTo(d,m,l)},fitBounds(d,m){t.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{...r,padding:[m,m]})},indicateReverse(d){t.getContainer().style.cursor=d?"crosshair":""},setMarkers(d,m){for(const g of u)g.remove();u.length=0;for(const g of m?[...d!=null?d:[],m]:d!=null?d:[]){let b;const M=[g.center[1],g.center[0]];if(g===m&&typeof e=="object")b=new J.Marker(M,e);else if(g!==m&&typeof n=="object")b=new J.Marker(M,n);else{const C=document.createElement("div");new xe({props:{displayIn:"leaflet"},target:C}),b=new J.Marker(M,{icon:new J.DivIcon({html:C,className:""})})}u.push(b.addTo(t))}},setSelectedMarker(d){var m,g;a&&((m=a.getElement())==null||m.classList.toggle("marker-selected",!1)),a=d>-1?u[d]:void 0,(g=a==null?void 0:a.getElement())==null||g.classList.toggle("marker-selected",!0)}}}class Kt extends J.Control{constructor(n){super();Ne(this,Z,void 0);Ne(this,ce,void 0);Pe(this,ce,n)}onAdd(n){const l=document.createElement("div");l.className="leaflet-ctrl-geocoder",J.DomEvent.disableClickPropagation(l),J.DomEvent.disableScrollPropagation(l);const{marker:r,showResultMarkers:c,flyTo:o,...i}=F(this,ce),u=typeof o=="boolean"?{}:o,a=Ht(n,r,c,u,u);Pe(this,Z,new Gt({target:l,props:{mapController:a,flyTo:o===void 0?!0:!!o,...i}}));for(const h of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])F(this,Z).$on(h,p=>n.fire(h.toLowerCase(),p.detail));return l}setOptions(n){var i;Pe(this,ce,n);const{marker:l,showResultMarkers:r,flyTo:c,...o}=F(this,ce);(i=F(this,Z))==null||i.$set(o)}setQuery(n,l=!0){var r;(r=F(this,Z))==null||r.setQuery(n,l)}setReverseMode(n){var l;(l=F(this,Z))==null||l.$set({reverseActive:n})}focus(){var n;(n=F(this,Z))==null||n.focus()}blur(){var n;(n=F(this,Z))==null||n.blur()}onRemove(){var n;(n=F(this,Z))==null||n.$destroy()}}Z=new WeakMap,ce=new WeakMap,S.GeocodingControl=Kt,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
import type { ControlOptions } from "./types";
|
|
3
|
+
export type { Feature } from "./types";
|
|
4
|
+
declare type LeafletControlOptions = ControlOptions & L.ControlOptions & {
|
|
5
|
+
/**
|
|
6
|
+
* If `true`, a [Marker](https://leafletjs.com/reference.html#marker) will be added to the map at the location of the user-selected result using a default set of Marker options.
|
|
7
|
+
* If the value is an object, the marker will be constructed using these options.
|
|
8
|
+
* If `false`, no marker will be added to the map.
|
|
9
|
+
*
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
marker?: boolean | L.MarkerOptions;
|
|
13
|
+
/**
|
|
14
|
+
* If `true`, [Markers](https://leafletjs.com/reference.html#marker) will be added to the map at the location the top results for the query.
|
|
15
|
+
* If the value is an object, the marker will be constructed using these options.
|
|
16
|
+
* If `false`, no marker will be added to the map.
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
showResultMarkers?: boolean | L.MarkerOptions;
|
|
21
|
+
/**
|
|
22
|
+
* If `false`, animating the map to a selected result is disabled.
|
|
23
|
+
* If `true`, animating the map will use the default animation parameters.
|
|
24
|
+
* If an object, it will be passed as options to the map `flyTo` or `fitBounds` method providing control over the animation of the transition.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
flyTo?: boolean | (L.ZoomPanOptions & L.FitBoundsOptions);
|
|
29
|
+
};
|
|
30
|
+
export declare class GeocodingControl extends L.Control {
|
|
31
|
+
#private;
|
|
32
|
+
constructor(options: LeafletControlOptions);
|
|
33
|
+
onAdd(map: L.Map): HTMLDivElement;
|
|
34
|
+
setOptions(options: LeafletControlOptions): void;
|
|
35
|
+
setQuery(value: string, submit?: boolean): void;
|
|
36
|
+
setReverseMode(value: boolean): void;
|
|
37
|
+
focus(): void;
|
|
38
|
+
blur(): void;
|
|
39
|
+
onRemove(): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
import type { MapController } from "./types";
|
|
3
|
+
export declare function createLeafletMapController(map: L.Map, marker?: boolean | L.MarkerOptions, showResultMarkers?: boolean | L.MarkerOptions, flyToOptions?: L.ZoomPanOptions, flyToBounds?: L.FitBoundsOptions): MapController;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type MapLibreGL from "maplibre-gl";
|
|
2
|
+
import type { FitBoundsOptions, Map, FlyToOptions } from "maplibre-gl";
|
|
3
|
+
import type { MapController } from "./types";
|
|
4
|
+
export declare function createMaplibreMapController(map: Map, maplibregl?: typeof MapLibreGL | undefined, marker?: boolean | maplibregl.MarkerOptions, showResultMarkers?: boolean | maplibregl.MarkerOptions, flyToOptions?: FlyToOptions, fitBoundsOptions?: FitBoundsOptions): MapController;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Map, type IControl, type MarkerOptions, type FlyToOptions, type FitBoundsOptions, Evented } from "maplibre-gl";
|
|
2
|
+
import type maplibregl from "maplibre-gl";
|
|
3
|
+
import type { ControlOptions } from "./types";
|
|
4
|
+
export type { Feature } from "./types";
|
|
5
|
+
declare type MapLibreGL = typeof maplibregl;
|
|
6
|
+
declare type MapLibreControlOptions = ControlOptions & {
|
|
7
|
+
/**
|
|
8
|
+
* A Maplibre GL instance to use when creating [Markers](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker).
|
|
9
|
+
* Required if `options.marker` is `true`.
|
|
10
|
+
*/
|
|
11
|
+
maplibregl?: MapLibreGL;
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, a [Marker](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker) will be added to the map at the location of the user-selected result using a default set of Marker options.
|
|
14
|
+
* If the value is an object, the marker will be constructed using these options.
|
|
15
|
+
* If `false`, no marker will be added to the map.
|
|
16
|
+
* Requires that `options.maplibregl` also be set.
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
marker?: boolean | MarkerOptions;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, [Markers](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker) will be added to the map at the location the top results for the query.
|
|
23
|
+
* If the value is an object, the marker will be constructed using these options.
|
|
24
|
+
* If `false`, no marker will be added to the map.
|
|
25
|
+
* Requires that `options.maplibregl` also be set.
|
|
26
|
+
*
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
showResultMarkers?: boolean | MarkerOptions;
|
|
30
|
+
/**
|
|
31
|
+
* If `false`, animating the map to a selected result is disabled.
|
|
32
|
+
* If `true`, animating the map will use the default animation parameters.
|
|
33
|
+
* If an object, it will be passed as options to the map `flyTo` or `fitBounds` method providing control over the animation of the transition.
|
|
34
|
+
*
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
flyTo?: boolean | (FlyToOptions & FitBoundsOptions);
|
|
38
|
+
};
|
|
39
|
+
export declare class GeocodingControl extends Evented implements IControl {
|
|
40
|
+
#private;
|
|
41
|
+
constructor(options: MapLibreControlOptions);
|
|
42
|
+
onAdd(map: Map): HTMLDivElement;
|
|
43
|
+
setOptions(options: MapLibreControlOptions): void;
|
|
44
|
+
setQuery(value: string, submit?: boolean): void;
|
|
45
|
+
setReverseMode(value: boolean): void;
|
|
46
|
+
focus(): void;
|
|
47
|
+
blur(): void;
|
|
48
|
+
onRemove(): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
import type { MapController } from "./types";
|
|
3
|
+
export declare function createLeafletMapController(map: L.Map, marker?: boolean | L.MarkerOptions, showResultMarkers?: boolean | L.MarkerOptions, flyToOptions?: L.ZoomPanOptions, flyToBounds?: L.FitBoundsOptions): MapController;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type MapLibreGL from "maplibre-gl";
|
|
2
|
+
import type { FitBoundsOptions, Map, FlyToOptions } from "maplibre-gl";
|
|
3
|
+
import type { MapController } from "./types";
|
|
4
|
+
export declare function createMaplibreMapController(map: Map, maplibregl?: typeof MapLibreGL | undefined, marker?: boolean | maplibregl.MarkerOptions, showResultMarkers?: boolean | maplibregl.MarkerOptions, flyToOptions?: FlyToOptions, fitBoundsOptions?: FitBoundsOptions): MapController;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export declare type Feature = {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
place_name: string;
|
|
5
|
+
place_type: string;
|
|
6
|
+
center: [number, number];
|
|
7
|
+
bbox: [number, number, number, number];
|
|
8
|
+
};
|
|
9
|
+
export declare type FeatureCollection = {
|
|
10
|
+
features: Feature[];
|
|
11
|
+
};
|
|
12
|
+
export declare type MapController = {
|
|
13
|
+
setProximityChangeHandler(proximityChangeHandler: undefined | ((proximity: [number, number] | undefined) => void)): void;
|
|
14
|
+
setMapClickHandler(mapClickHandler: undefined | ((coordinates: [number, number]) => void)): void;
|
|
15
|
+
flyTo(center: [number, number], zoom: number): void;
|
|
16
|
+
fitBounds(bbox: [number, number, number, number], padding: number): void;
|
|
17
|
+
indicateReverse(reverse: boolean): void;
|
|
18
|
+
setMarkers(features: Feature[] | undefined, picked: Feature | undefined): void;
|
|
19
|
+
setSelectedMarker(index: number): void;
|
|
20
|
+
};
|
|
21
|
+
export declare type Proximity = [number, number] | undefined;
|
|
22
|
+
export declare type ControlOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* Maptiler API key
|
|
25
|
+
*/
|
|
26
|
+
apiKey: string;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the amount of time, in milliseconds, to wait before querying the server when a user types into the Geocoder input box.
|
|
29
|
+
* This parameter may be useful for reducing the total number of API calls made for a single query.
|
|
30
|
+
*
|
|
31
|
+
* @default 200
|
|
32
|
+
*/
|
|
33
|
+
debounceSearch?: number;
|
|
34
|
+
/**
|
|
35
|
+
* A proximity argument: this is a geographical point given as an object with latitude and longitude properties.
|
|
36
|
+
* Search results closer to this point will be given higher priority.
|
|
37
|
+
*/
|
|
38
|
+
proximity?: [number, number];
|
|
39
|
+
/**
|
|
40
|
+
* Override the default placeholder attribute value.
|
|
41
|
+
*
|
|
42
|
+
* @default "Search"
|
|
43
|
+
*/
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Override the default error message.
|
|
47
|
+
*
|
|
48
|
+
* @default "Searching failed"
|
|
49
|
+
*/
|
|
50
|
+
errorMessage?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Override the default message if no results are found.
|
|
53
|
+
*
|
|
54
|
+
* @default "No results found"
|
|
55
|
+
*/
|
|
56
|
+
noResultsMessage?: string;
|
|
57
|
+
/**
|
|
58
|
+
* If true, the geocoder proximity will automatically update based on the map view.
|
|
59
|
+
*
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
trackProximity?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Minimum number of characters to enter before results are shown.
|
|
65
|
+
*
|
|
66
|
+
* @default 2
|
|
67
|
+
*/
|
|
68
|
+
minLength?: number;
|
|
69
|
+
/**
|
|
70
|
+
* A bounding box argument: this is a bounding box given as an array in the format [minX, minY, maxX, maxY].
|
|
71
|
+
* Search results will be limited to the bounding box.
|
|
72
|
+
*/
|
|
73
|
+
bbox?: [number, number, number, number];
|
|
74
|
+
/**
|
|
75
|
+
* Specify the language to use for response text and query result weighting.
|
|
76
|
+
* Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script.
|
|
77
|
+
* More than one value can also be specified, separated by commas.
|
|
78
|
+
* Defaults to the browser's language settings.
|
|
79
|
+
*/
|
|
80
|
+
language?: string;
|
|
81
|
+
/**
|
|
82
|
+
* If `false`, indicates that search will only occur on enter key press.
|
|
83
|
+
* If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.
|
|
84
|
+
*
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
showResultsWhileTyping?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* On geocoded result what zoom level should the map animate to when a bbox isn't found in the response.
|
|
90
|
+
* If a bbox is found the map will fit to the bbox.
|
|
91
|
+
*
|
|
92
|
+
* @default 16
|
|
93
|
+
*/
|
|
94
|
+
zoom?: number;
|
|
95
|
+
/**
|
|
96
|
+
* If `true`, the geocoder control will collapse until hovered or in focus.
|
|
97
|
+
*
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
collapsed?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* If true, the geocoder control will clear its value when the input blurs.
|
|
103
|
+
*
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
clearOnBlur?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* A function which accepts a Feature in the Carmen GeoJSON format to filter out results from the Geocoding API response before they are included in the suggestions list.
|
|
109
|
+
* Return true to keep the item, false otherwise.
|
|
110
|
+
*/
|
|
111
|
+
filter?: (feature: Feature) => boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Class of the root element.
|
|
114
|
+
*/
|
|
115
|
+
class?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Set to `true` to enable reverse geocoding button with title _toggle reverse geocoding_ or set the button title directly.
|
|
118
|
+
*
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
enableReverse?: boolean | string;
|
|
122
|
+
/**
|
|
123
|
+
* Set to `true` to show place type.
|
|
124
|
+
*
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
showPlaceType?: boolean;
|
|
128
|
+
};
|
package/dist/main.d.ts
ADDED