diff --git a/dist/ol-geocoder-debug.js b/dist/ol-geocoder-debug.js index e5a8e51..63771e7 100644 --- a/dist/ol-geocoder-debug.js +++ b/dist/ol-geocoder-debug.js @@ -2,7 +2,7 @@ * ol-geocoder - v4.3.1-dev * A geocoder extension compatible with OpenLayers v7+ & v8+ * https://github.com/Dominique92/ol-geocoder - * Built: Wed Sep 13 2023 20:36:09 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:58:26 GMT+0200 (heure d’été d’Europe centrale) */ diff --git a/dist/ol-geocoder.css b/dist/ol-geocoder.css index 9aa5c46..d863526 100644 --- a/dist/ol-geocoder.css +++ b/dist/ol-geocoder.css @@ -2,7 +2,7 @@ * ol-geocoder - v4.3.1-dev * A geocoder extension compatible with OpenLayers v7+ & v8+ * https://github.com/Dominique92/ol-geocoder - * Built: Wed Sep 13 2023 20:36:11 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:58:28 GMT+0200 (heure d’été d’Europe centrale) */ .ol-touch .ol-control.gcd-gl-control button { @@ -74,11 +74,10 @@ width: 1.5625em; height: 1.5625em; top: 0.125em; - left: 0.125em; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVwAAAFcBAMAAAB2OBsfAAAAGFBMVEXu7u7///8AAAAoKCh8fHzKysqlpaVSUlKH5Q7jAAAKM0lEQVR42u2dSVsbORCGW2aSuUrTi69Mt5crOAtX7CHJNSaBuaY9CVzHTjL8/cEYDEilpdWqdvmJdGseu/RS1lL6JFUnYlN4sinUHyNuxI24ETfiRtyIG3EjLonHJGH3fyH+GHEjbsSNuBE34kbciBtxd44bw/OIG3EjbsSNuBE34kbcPcUVTwpxBXL99OLi6uvZj7P3VxfzLTbJ8JwJ/uL6Vbkt1ck7RhaXifx6Usrl9ReauIIDsOtyMieIKz7DsHcengtiuPyv0lCq003XpYL7clWay1vG6eD+XVrLeC6o4H4qHUpVcxq4/5SlG6+ggOtIe8v7Rewc1532zr87xnXpZ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qpscbCbTya/RQ2ycL7HIrL5/Jmk9vbZ2KwdEtLCswwcJu9SWnAnpvSfXmIhtvkBWvbdOMPprgp7kXB5e68W9pH3InBvTi4ifjs2hJUhWVlcC8SruMr7G5pG+C+wcO95bWPD/+BDUn/PYaHm4jcNl+cgt81DCtHiLg22e4EDgNMC9SKIeKuHax95231jjUQ4mWhD+ld2EK8BN/sU/1g2u+apvAqcHiuPApxeaOMtRvPar5rbPHHyLh3v8zLD9t3d1cn21cUab67MIaa6LibR/7i4vLq28XFkze6az7cM44my25wH4r9UJz59YLj7nDdHnnp4F46uJbVyJgaburgXkK4ltYwJoZr04mnxHCLYPppJ7i2F05OieHa3UsK1+5eWriZzb3BFMggjzbhaooTnvs+2l7pOaKFa3VvTQvX0b1UcBObCl/TwrWEvfd3ZsngWt07J4br4l5CuC7upYTr4F5KuMKiCTJiuJZV0CExXLt7aeFa3HtEDNdynMNVP0WPd+8f2YHNvTTC84fH3OZeWrjMsoY/poWbWM56VcRwbe5d0sK1uXdMDNfNvXRwndxLB1ect9BPd4DrIPBRwrUpUDUx3MI+VVDCtbh3RA23sI4NpHCFdSNzxwqk9GhWoBiV8NxNP51TwzULfOS8a3RvlZDDNQl8Y04O1yTwjQjiGtx7TK8xmNw7J4nbN7QFgrg6906J4vYNO4IEcWGBb8qp4qb67VaKuJB7a04X9wAeFsgokNKjqp/WxESn5/rpJ81ONk1cRYGqGWlcSYEacdq4knvtaeV2jPvMvUNOHfeZe+cJedwn7l3n+iGPmz9eyUv2AHern94ljaKPmz/sUSV7gXt/lfiU7wnuOjPJq1OR7AuuWN8pTvYHVwhiZyAT3IxZETfiRtyIG3EjbsSNuBG348f9iXcjbsSNuBE34kbciBtxI25UIONqIuJG3IgbcSNuxI24ETcqkDE830vc/wE4HweKeBzDmAAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: center center; - background-size: 20px; } + left: 0.125em; } + +.ol-geocoder .gcd-gl-btn:after { + content: "\1F50D"; } .ol-geocoder ul.gcd-gl-result { position: absolute; @@ -182,16 +181,15 @@ .ol-geocoder .gcd-txt-glass { position: absolute; - top: 0; - left: 0; + top: 26px; + left: 9px; z-index: 100; display: inline-block; width: 2.5em; - height: 100%; - background-size: 1.38889em; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23333' d='M29.156 29.961l-.709.709a2.006 2.006 0 0 1-2.838 0l-5.676-5.674c-.656-.658-.729-1.644-.281-2.412l-3.104-3.102a9.975 9.975 0 0 1-5.965 1.979C5.043 21.461.552 16.97.552 11.43S5.043 1.398 10.583 1.398c5.541 0 10.031 4.491 10.031 10.032 0 2.579-.98 4.923-2.58 6.7l3.035 3.035c.768-.447 1.754-.375 2.41.283l5.676 5.674c.784.785.784 2.056.001 2.839zM18.088 11.389c0-4.155-3.369-7.523-7.524-7.523a7.523 7.523 0 1 0-.001 15.046 7.525 7.525 0 0 0 7.525-7.523z'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: center center; } + height: 100%; } + +.ol-geocoder .gcd-txt-glass:after { + content: "\1F50D"; } .ol-geocoder ul.gcd-txt-result { position: absolute; diff --git a/dist/ol-geocoder.js b/dist/ol-geocoder.js index 5c3be6a..bef57f7 100644 --- a/dist/ol-geocoder.js +++ b/dist/ol-geocoder.js @@ -2,7 +2,7 @@ * ol-geocoder - v4.3.1-dev * A geocoder extension compatible with OpenLayers v7+ & v8+ * https://github.com/Dominique92/ol-geocoder - * Built: Wed Sep 13 2023 20:36:09 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:58:26 GMT+0200 (heure d’été d’Europe centrale) */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("ol/control/Control"),require("ol/style/Style"),require("ol/style/Icon"),require("ol/layer/Vector"),require("ol/source/Vector"),require("ol/geom/Point"),require("ol/Feature"),require("ol/proj")):"function"==typeof define&&define.amd?define(["ol/control/Control","ol/style/Style","ol/style/Icon","ol/layer/Vector","ol/source/Vector","ol/geom/Point","ol/Feature","ol/proj"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Geocoder=t(e.ol.control.Control,e.ol.style.Style,e.ol.style.Icon,e.ol.layer.Vector,e.ol.source.Vector,e.ol.geom.Point,e.ol.Feature,e.ol.proj)}(this,(function(e,t,s,r,n,o,a,i){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var d=l(e),u=l(t),p=l(s),h=l(r),m=l(n),g=l(o),y=l(a),f=c(i),b="gcd-container",v="gcd-button-control",w="gcd-input-query",x="gcd-input-label",$="gcd-input-search",k={namespace:"ol-geocoder",spin:"gcd-pseudo-rotate",hidden:"gcd-hidden",address:"gcd-address",country:"gcd-country",city:"gcd-city",road:"gcd-road",olControl:"ol-control",glass:{container:"gcd-gl-container",control:"gcd-gl-control",button:"gcd-gl-btn",input:"gcd-gl-input",expanded:"gcd-gl-expanded",search:"gcd-gl-search",result:"gcd-gl-result"},inputText:{container:"gcd-txt-container",control:"gcd-txt-control",label:"gcd-txt-label",input:"gcd-txt-input",search:"gcd-txt-search",icon:"gcd-txt-glass",result:"gcd-txt-result"}},S={containerId:b,buttonControlId:v,inputQueryId:w,inputLabelId:x,inputSearchId:$,cssClasses:k};const q=Object.freeze({__proto__:null,containerId:b,buttonControlId:v,inputQueryId:w,inputLabelId:x,inputSearchId:$,cssClasses:k,default:S}),L="addresschosen",C="nominatim",j="reverse",E="glass-button",T="text-input",I="osm",N="mapquest",P="photon",A="bing",R="opencage",F={provider:I,label:"",placeholder:"Search for an address",featureStyle:null,targetType:E,lang:"en-US",limit:5,keepOpen:!1,preventDefault:!1,preventPanning:!1,preventMarker:!1,defaultFlyResolution:10,debug:!1};function _(e,t="Assertion failed"){if(!e){if("undefined"!=typeof Error)throw new Error(t);throw t}}function M(e){const t=function(){if("performance"in window==0&&(window.performance={}),"now"in window.performance==0){let e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=()=>Date.now()-e}return window.performance.now()}().toString(36);return e?e+t:t}function O(e){return/^\d+$/u.test(e)}function D(e,t,s){if(Array.isArray(e))return void e.forEach((e=>D(e,t)));const r=Array.isArray(t)?t:t.split(/\s+/u);let n=r.length;for(;n--;)Q(e,r[n])||z(e,r[n],s)}function V(e,t,s){if(Array.isArray(e))return void e.forEach((e=>V(e,t,s)));const r=Array.isArray(t)?t:t.split(/\s+/u);let n=r.length;for(;n--;)Q(e,r[n])&&H(e,r[n],s)}function Q(e,t){return e.classList?e.classList.contains(t):G(t).test(e.className)}function B(e,t){return e.replace(/\{\s*([\w-]+)\s*\}/gu,((e,s)=>{const r=void 0===t[s]?"":t[s];return String(r).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}))}function U(e,t){let s;if(Array.isArray(e)){if(s=document.createElement(e[0]),e[1].id&&(s.id=e[1].id),e[1].classname&&(s.className=e[1].classname),e[1].attr){const{attr:t}=e[1];if(Array.isArray(t)){let e=-1;for(;++eH(e,t)),s)}function H(e,t,s){e.classList?e.classList.remove(t):e.className=e.className.replace(G(t)," ").trim(),s&&O(s)&&window.setTimeout((()=>z(e,t)),s)}const K=q.cssClasses;class J{constructor(e){this.options=e,this.els=this.createControl()}createControl(){let e,t,s;return this.options.targetType===T?(t=`${K.namespace} ${K.inputText.container}`,e=U(["div",{id:q.containerId,classname:t}],J.input),s={container:e,control:e.querySelector(`.${K.inputText.control}`),label:e.querySelector(`.${K.inputText.label}`),input:e.querySelector(`.${K.inputText.input}`),search:e.querySelector(`.${K.inputText.search}`),result:e.querySelector(`.${K.inputText.result}`)},s.label.innerHTML=this.options.label):(t=`${K.namespace} ${K.glass.container}`,e=U(["div",{id:q.containerId,classname:t}],J.glass),s={container:e,control:e.querySelector(`.${K.glass.control}`),button:e.querySelector(`.${K.glass.button}`),input:e.querySelector(`.${K.glass.input}`),search:e.querySelector(`.${K.glass.search}`),result:e.querySelector(`.${K.glass.result}`)}),s.input.placeholder=this.options.placeholder,s}}function W(e){return new Promise(((t,s)=>{const r=function(e,t){t&&"object"==typeof t&&(e+=(/\?/u.test(e)?"&":"?")+X(t));return e}(e.url,e.data),n={method:"GET",mode:"cors",credentials:"same-origin"};e.jsonp?function(e,t,s){const{head:r}=document,n=document.createElement("script"),o=`f${Math.round(Math.random()*Date.now())}`;n.setAttribute("src",`${e+(e.indexOf("?")>0?"&":"?")+t}=${o}`),window[o]=e=>{window[o]=void 0,setTimeout((()=>r.removeChild(n)),0),s(e)},r.append(n)}(r,e.callbackName,t):fetch(r,n).then((e=>e.json())).then(t).catch(s)}))}function X(e){return Object.keys(e).reduce(((t,s)=>(t.push("object"==typeof e[s]?X(e[s]):`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`),t)),[]).join("&")}J.glass=`\n
\n \n \n \n
\n \n`,J.input=`\n
\n \n \n \n \n
\n \n`;class Y{constructor(){this.settings={url:"https://photon.komoot.io/api/",params:{q:"",limit:10,lang:"en"},langs:["de","it","fr","en"]}}getParameters(e){return e.lang=e.lang.toLowerCase(),{url:this.settings.url,params:{q:e.query,limit:e.limit||this.settings.params.limit,lang:this.settings.langs.includes(e.lang)?e.lang:this.settings.params.lang}}}handleResponse(e){return 0===e.features.length?[]:e.features.map((e=>({lon:e.geometry.coordinates[0],lat:e.geometry.coordinates[1],address:{name:e.properties.name,postcode:e.properties.postcode,city:e.properties.city,state:e.properties.state,country:e.properties.country},original:{formatted:e.properties.name,details:e.properties}})))}}class Z{constructor(e){this.settings={url:"https://nominatim.openstreetmap.org/search",...e,params:{q:"",format:"json",addressdetails:1,limit:10,countrycodes:"",viewbox:"","accept-language":"en-US"}}}getParameters(e){return{url:this.settings.url,params:{q:e.query,format:this.settings.params.format,addressdetails:this.settings.params.addressdetails,limit:e.limit||this.settings.params.limit,countrycodes:e.countrycodes||this.settings.params.countrycodes,viewbox:e.viewbox||this.settings.params.viewbox,"accept-language":e.lang||this.settings.params["accept-language"]}}}handleResponse(e){return 0===e.length?[]:e.map((e=>({lon:e.lon,lat:e.lat,bbox:e.boundingbox,address:{name:e.display_name,road:e.address.road||"",houseNumber:e.address.house_number||"",postcode:e.address.postcode,city:e.address.city||e.address.town,state:e.address.state,country:e.address.country},original:{formatted:e.display_name,details:e.address}})))}}class ee{constructor(){this.settings={url:"https://open.mapquestapi.com/nominatim/v1/search.php",params:{q:"",key:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}}getParameters(e){return{url:this.settings.url,params:{q:e.query,key:e.key,format:"json",addressdetails:1,limit:e.limit||this.settings.params.limit,countrycodes:e.countrycodes||this.settings.params.countrycodes,"accept-language":e.lang||this.settings.params["accept-language"]}}}handleResponse(e){return 0===e.length?[]:e.map((e=>({lon:e.lon,lat:e.lat,address:{name:e.address.neighbourhood||"",road:e.address.road||"",postcode:e.address.postcode,city:e.address.city||e.address.town,state:e.address.state,country:e.address.country},original:{formatted:e.display_name,details:e.address}})))}}class te{constructor(){this.settings={url:"https://dev.virtualearth.net/REST/v1/Locations",callbackName:"jsonp",params:{query:"",key:"",includeNeighborhood:0,maxResults:10}}}getParameters(e){return{url:this.settings.url,callbackName:this.settings.callbackName,params:{query:e.query,key:e.key,includeNeighborhood:e.includeNeighborhood||this.settings.params.includeNeighborhood,maxResults:e.maxResults||this.settings.params.maxResults}}}handleResponse(e){const{resources:t}=e.resourceSets[0];return 0===t.length?[]:t.map((e=>({lon:e.point.coordinates[1],lat:e.point.coordinates[0],address:{name:e.name},original:{formatted:e.address.formattedAddress,details:e.address}})))}}class se{constructor(){this.settings={url:"https://api.opencagedata.com/geocode/v1/json?",params:{q:"",key:"",limit:10,countrycode:"",pretty:1,no_annotations:1}}}getParameters(e){return{url:this.settings.url,params:{q:e.query,key:e.key,limit:e.limit||this.settings.params.limit,countrycode:e.countrycodes||this.settings.params.countrycodes}}}handleResponse(e){return 0===e.results.length?[]:e.results.map((e=>({lon:e.geometry.lng,lat:e.geometry.lat,address:{name:e.components.house_number||"",road:e.components.road||"",postcode:e.components.postcode,city:e.components.city||e.components.town,state:e.components.state,country:e.components.country},original:{formatted:e.formatted,details:e.components}})))}}const re=q.cssClasses;class ne{constructor(e,t){this.Base=e,this.layerName=M("geocoder-layer-"),this.layer=new h.default({name:this.layerName,source:new m.default,displayInLayerSwitcher:!1}),this.options=e.options,this.options.provider="string"==typeof this.options.provider?this.options.provider.toLowerCase():this.options.provider,this.provider=this.newProvider(),this.els=t,this.lastQuery="",this.container=this.els.container,this.registeredListeners={mapClick:!1},this.setListeners()}setListeners(){const e=e=>{e.stopPropagation(),Q(this.els.control,re.glass.expanded)?this.collapse():this.expand()};this.els.input.addEventListener("keypress",(e=>{const t=e.target.value.trim();(e.key?"Enter"===e.key:e.which?13===e.which:!!e.keyCode&&13===e.keyCode)&&(e.preventDefault(),this.query(t))}),!1),this.els.input.addEventListener("click",(e=>e.stopPropagation()),!1),this.els.input.addEventListener("input",(e=>{0!==e.target.value.trim().length?V(this.els.search,re.hidden):D(this.els.search,re.hidden)}),!1),this.els.search.addEventListener("click",(()=>{this.els.input.focus(),this.query(this.els.input.value)}),!1),this.options.targetType===E&&this.els.button.addEventListener("click",e,!1)}query(e){this.provider||(this.provider=this.newProvider());const t=this.provider.getParameters({query:e,key:this.options.key,lang:this.options.lang,countrycodes:this.options.countrycodes,viewbox:this.options.viewbox,limit:this.options.limit});if(this.lastQuery===e&&this.els.result.firstChild)return;this.lastQuery=e,this.clearResults(),D(this.els.search,re.spin);const s={url:t.url,data:t.params};t.callbackName&&(s.jsonp=!0,s.callbackName=t.callbackName),W(s).then((e=>{this.options.debug&&console.info(e),V(this.els.search,re.spin);const t=this.provider.handleResponse(e);t&&(this.createList(t),this.listenMapClick())})).catch((()=>{V(this.els.search,re.spin);const e=U("li","
Error! No internet connection?
");this.els.result.append(e)}))}createList(e){const t=this.els.result;e.forEach((s=>{let r;if(this.options.provider===I)r=`${s.address.name}`;else r=this.addressTemplate(s.address);if(1==e.length)this.chosen(s,r,s.address,s.original);else{const e=U("li",`${r}`);e.addEventListener("click",(e=>{e.preventDefault(),this.chosen(s,r,s.address,s.original)}),!1),t.append(e)}}))}chosen(e,t,s,r){const n=this.Base.getMap(),o=[Number.parseFloat(e.lon),Number.parseFloat(e.lat)],a=n.getView().getProjection(),i=f.transform(o,"EPSG:4326",a);let{bbox:l}=e;l&&(l=f.transformExtent([parseFloat(l[2]),parseFloat(l[0]),parseFloat(l[3]),parseFloat(l[1])],"EPSG:4326",a));const c={formatted:t,details:s,original:r};if(!1===this.options.keepOpen&&this.clearResults(!0),!0===this.options.preventDefault||!0===this.options.preventMarker)this.Base.dispatchEvent({type:L,address:c,coordinate:i,bbox:l,place:e});else{const t=this.createFeature(i,c);this.Base.dispatchEvent({type:L,address:c,feature:t,coordinate:i,bbox:l,place:e})}!0!==this.options.preventDefault&&!0!==this.options.preventPanning&&(l?n.getView().fit(l,{duration:500}):n.getView().animate({center:i,resolution:this.options.defaultFlyResolution,duration:500}))}createFeature(e){const t=new y.default(new g.default(e));return this.addLayer(),t.setStyle(this.options.featureStyle),t.setId(M("geocoder-ft-")),this.getSource().addFeature(t),t}addressTemplate(e){const t=[];return e.name&&t.push(['{name}'].join("")),(e.road||e.building||e.house_number)&&t.push(['{building} {road} {house_number}'].join("")),(e.city||e.town||e.village)&&t.push(['{postcode} {city} {town} {village}'].join("")),(e.state||e.country)&&t.push(['{state} {country}'].join("")),B(t.join("
"),e)}newProvider(){switch(this.options.provider){case I:return new Z(this.options);case N:return new ee;case P:return new Y;case A:return new te;case R:return new se;default:return this.options.provider}}expand(){V(this.els.input,re.spin),D(this.els.control,re.glass.expanded),window.setTimeout((()=>this.els.input.focus()),100),this.listenMapClick()}collapse(){this.els.input.value="",this.els.input.blur(),D(this.els.search,re.hidden),V(this.els.control,re.glass.expanded),this.clearResults()}listenMapClick(){if(this.registeredListeners.mapClick)return;const e=this,t=this.Base.getMap().getTargetElement();this.registeredListeners.mapClick=!0,t.addEventListener("click",{handleEvent(s){e.clearResults(!0),t.removeEventListener(s.type,this,!1),e.registeredListeners.mapClick=!1}},!1)}clearResults(e){e&&this.options.targetType===E?this.collapse():function(e){for(;e.firstChild;)e.firstChild.remove()}(this.els.result)}getSource(){return this.layer.getSource()}addLayer(){let e=!1;const t=this.Base.getMap();t.getLayers().forEach((t=>{t===this.layer&&(e=!0)})),e||t.addLayer(this.layer)}}class oe extends d.default{constructor(e=C,t={}){let s,r;_("string"==typeof e,"@param `type` should be string!"),_(e===C||e===j,`@param 'type' should be '${C}'\n or '${j}'!`),t={...F,featureStyle:[new u.default({image:new p.default({scale:.7,src:"//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png"})})],...t};const n=new J(t);if(e===C&&(s=n.els.container),super({element:s,...t}),!(this instanceof oe))return new oe;this.options=t,this.container=s,e===C&&(r=new ne(this,n.els),this.layer=r.layer)}getLayer(){return this.layer}getSource(){return this.getLayer().getSource()}setProvider(e){this.options.provider=e}setProviderKey(e){this.options.key=e}}return oe})); //# sourceMappingURL=ol-geocoder.js.map diff --git a/dist/ol-geocoder.min.css b/dist/ol-geocoder.min.css index b46e33c..a43a5d0 100644 --- a/dist/ol-geocoder.min.css +++ b/dist/ol-geocoder.min.css @@ -2,7 +2,7 @@ * ol-geocoder - v4.3.1-dev * A geocoder extension compatible with OpenLayers v7+ & v8+ * https://github.com/Dominique92/ol-geocoder - * Built: Wed Sep 13 2023 20:36:11 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:58:28 GMT+0200 (heure d’été d’Europe centrale) */ - .ol-touch .ol-control.gcd-gl-control button{font-size:1.14em}.ol-touch .ol-geocoder.gcd-gl-container{font-size:1.1em}.ol-geocoder.gcd-gl-container{box-sizing:border-box;font-size:.9em;left:.5em;position:absolute;top:4.875em}.ol-geocoder.gcd-gl-container *,.ol-geocoder.gcd-gl-container :after,.ol-geocoder.gcd-gl-container :before{box-sizing:inherit}.ol-geocoder .gcd-gl-control{height:2.1875em;overflow:hidden;transition:width .2s,height .2s;width:2.1875em}.ol-geocoder .gcd-gl-expanded{height:2.1875em;width:15.625em}.ol-geocoder .gcd-gl-input{background-color:#fff;border:1px solid #ccc;color:#222;font-family:inherit;font-size:.875em;left:2.5em;padding:5px;position:absolute;top:.25em;width:14.84375em;z-index:99}.ol-geocoder .gcd-gl-input:focus{border:none;box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 5px #4d90fe;outline:none}.ol-geocoder .gcd-gl-search{background-color:transparent;border:none;cursor:pointer;display:inline-block;height:100%;line-height:1.4;outline:0;position:absolute;right:0;top:0;width:1.5625em;z-index:100}.ol-geocoder .gcd-gl-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:1.5em}.ol-geocoder .gcd-gl-btn{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVwAAAFcBAMAAAB2OBsfAAAAGFBMVEXu7u7///8AAAAoKCh8fHzKysqlpaVSUlKH5Q7jAAAKM0lEQVR42u2dSVsbORCGW2aSuUrTi69Mt5crOAtX7CHJNSaBuaY9CVzHTjL8/cEYDEilpdWqdvmJdGseu/RS1lL6JFUnYlN4sinUHyNuxI24ETfiRtyIG3EjLonHJGH3fyH+GHEjbsSNuBE34kbciBtxd44bw/OIG3EjbsSNuBE34kbcPcUVTwpxBXL99OLi6uvZj7P3VxfzLTbJ8JwJ/uL6Vbkt1ck7RhaXifx6Usrl9ReauIIDsOtyMieIKz7DsHcengtiuPyv0lCq003XpYL7clWay1vG6eD+XVrLeC6o4H4qHUpVcxq4/5SlG6+ggOtIe8v7Rewc1532zr87xnXpZU/6G9strvitbFQGO8VlxaQZbvlmlwokX5VNy0+xu/B8UTYvNd8VbuZBe9vddoTLJz64t813N7iL0q/UfBe4fU/a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68W9pH3InBvTi4ifjs2hJUhWVlcC8SruMr7G5pG+C+wcO95bWPD/+BDUn/PYaHm4jcNl+cgt81DCtHiLg22e4EDgNMC9SKIeKuHax95231jjUQ4mWhD+ld2EK8BN/sU/1g2u+apvAqcHiuPApxeaOMtRvPar5rbPHHyLh3v8zLD9t3d1cn21cUab67MIaa6LibR/7i4vLq28XFkze6az7cM44my25wH4r9UJz59YLj7nDdHnnp4F46uJbVyJgaburgXkK4ltYwJoZr04mnxHCLYPppJ7i2F05OieHa3UsK1+5eWriZzb3BFMggjzbhaooTnvs+2l7pOaKFa3VvTQvX0b1UcBObCl/TwrWEvfd3ZsngWt07J4br4l5CuC7upYTr4F5KuMKiCTJiuJZV0CExXLt7aeFa3HtEDNdynMNVP0WPd+8f2YHNvTTC84fH3OZeWrjMsoY/poWbWM56VcRwbe5d0sK1uXdMDNfNvXRwndxLB1ect9BPd4DrIPBRwrUpUDUx3MI+VVDCtbh3RA23sI4NpHCFdSNzxwqk9GhWoBiV8NxNP51TwzULfOS8a3RvlZDDNQl8Y04O1yTwjQjiGtx7TK8xmNw7J4nbN7QFgrg6906J4vYNO4IEcWGBb8qp4qb67VaKuJB7a04X9wAeFsgokNKjqp/WxESn5/rpJ81ONk1cRYGqGWlcSYEacdq4knvtaeV2jPvMvUNOHfeZe+cJedwn7l3n+iGPmz9eyUv2AHern94ljaKPmz/sUSV7gXt/lfiU7wnuOjPJq1OR7AuuWN8pTvYHVwhiZyAT3IxZETfiRtyIG3EjbsSNuBG348f9iXcjbsSNuBE34kbciBtxI25UIONqIuJG3IgbcSNuxI24ETcqkDE830vc/wE4HweKeBzDmAAAAABJRU5ErkJggg==");background-position:50%;background-repeat:no-repeat;background-size:20px;height:1.5625em;left:.125em;position:absolute;top:.125em;width:1.5625em}.ol-geocoder ul.gcd-gl-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px rgba(0,0,0,.8);left:2em;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:2.1875em;transition:max-height .3s ease-in;white-space:normal;width:16.25em}.ol-geocoder ul.gcd-gl-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-gl-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-gl-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-gl-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-gl-result:empty{display:none}.ol-geocoder.gcd-txt-container{box-sizing:border-box;height:4.375em;left:calc(50% - 12.5em);position:absolute;top:.5em;width:25em}.ol-geocoder.gcd-txt-container *,.ol-geocoder.gcd-txt-container :after,.ol-geocoder.gcd-txt-container :before{box-sizing:inherit}.ol-geocoder .gcd-txt-control{background-color:#fff;border:1px solid #ccc;height:4.375em;overflow:hidden;position:relative;width:100%}.ol-geocoder .gcd-txt-label{display:inline-block;text-align:center;width:100%}.ol-geocoder .gcd-txt-input{background-color:transparent;border:none;font-family:inherit;font-size:.875em;height:100%;left:0;padding:5px 30px 5px 40px;position:absolute;text-indent:6px;top:0;width:100%;z-index:99}.ol-geocoder .gcd-txt-input:focus{box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 6px #4d90fe;outline:none}.ol-geocoder .gcd-txt-search{background-color:transparent;border:none;cursor:pointer;display:inline-block;height:100%;line-height:100%;outline:0;position:absolute;right:0;top:0;vertical-align:middle;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:2em}.ol-geocoder .gcd-txt-glass{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath fill='%23333' d='m29.156 29.961-.709.709a2.006 2.006 0 0 1-2.838 0l-5.676-5.674c-.656-.658-.729-1.644-.281-2.412l-3.104-3.102a9.975 9.975 0 0 1-5.965 1.979C5.043 21.461.552 16.97.552 11.43S5.043 1.398 10.583 1.398c5.541 0 10.031 4.491 10.031 10.032 0 2.579-.98 4.923-2.58 6.7l3.035 3.035c.768-.447 1.754-.375 2.41.283l5.676 5.674c.784.785.784 2.056.001 2.839zM18.088 11.389a7.524 7.524 0 0 0-7.524-7.523 7.523 7.523 0 1 0-.001 15.046 7.525 7.525 0 0 0 7.525-7.523z'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:1.38889em;display:inline-block;height:100%;left:0;position:absolute;top:0;width:2.5em;z-index:100}.ol-geocoder ul.gcd-txt-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px rgba(0,0,0,.8);left:0;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:4.575em;transition:max-height .3s ease-in;white-space:normal;width:25em}.ol-geocoder ul.gcd-txt-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-txt-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-txt-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-txt-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-txt-result:empty{display:none}.ol-geocoder .gcd-hidden{opacity:0;visibility:hidden}.ol-geocoder .gcd-pseudo-rotate:after{animation:spin .7s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.gcd-address,.gcd-road{color:#333;font-size:.875em;font-weight:500}.gcd-city{font-weight:400}.gcd-city,.gcd-country{color:#333;font-size:.75em}.gcd-country{font-weight:lighter} \ No newline at end of file + .ol-touch .ol-control.gcd-gl-control button{font-size:1.14em}.ol-touch .ol-geocoder.gcd-gl-container{font-size:1.1em}.ol-geocoder.gcd-gl-container{box-sizing:border-box;font-size:.9em;left:.5em;position:absolute;top:4.875em}.ol-geocoder.gcd-gl-container *,.ol-geocoder.gcd-gl-container :after,.ol-geocoder.gcd-gl-container :before{box-sizing:inherit}.ol-geocoder .gcd-gl-control{height:2.1875em;overflow:hidden;transition:width .2s,height .2s;width:2.1875em}.ol-geocoder .gcd-gl-expanded{height:2.1875em;width:15.625em}.ol-geocoder .gcd-gl-input{background-color:#fff;border:1px solid #ccc;color:#222;font-family:inherit;font-size:.875em;left:2.5em;padding:5px;position:absolute;top:.25em;width:14.84375em;z-index:99}.ol-geocoder .gcd-gl-input:focus{border:none;box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 5px #4d90fe;outline:none}.ol-geocoder .gcd-gl-search{background-color:transparent;border:none;cursor:pointer;display:inline-block;height:100%;line-height:1.4;outline:0;position:absolute;right:0;top:0;width:1.5625em;z-index:100}.ol-geocoder .gcd-gl-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:1.5em}.ol-geocoder .gcd-gl-btn{height:1.5625em;left:.125em;position:absolute;top:.125em;width:1.5625em}.ol-geocoder .gcd-gl-btn:after{content:"\1F50D"}.ol-geocoder ul.gcd-gl-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px rgba(0,0,0,.8);left:2em;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:2.1875em;transition:max-height .3s ease-in;white-space:normal;width:16.25em}.ol-geocoder ul.gcd-gl-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-gl-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-gl-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-gl-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-gl-result:empty{display:none}.ol-geocoder.gcd-txt-container{box-sizing:border-box;height:4.375em;left:calc(50% - 12.5em);position:absolute;top:.5em;width:25em}.ol-geocoder.gcd-txt-container *,.ol-geocoder.gcd-txt-container :after,.ol-geocoder.gcd-txt-container :before{box-sizing:inherit}.ol-geocoder .gcd-txt-control{background-color:#fff;border:1px solid #ccc;height:4.375em;overflow:hidden;position:relative;width:100%}.ol-geocoder .gcd-txt-label{display:inline-block;text-align:center;width:100%}.ol-geocoder .gcd-txt-input{background-color:transparent;border:none;font-family:inherit;font-size:.875em;height:100%;left:0;padding:5px 30px 5px 40px;position:absolute;text-indent:6px;top:0;width:100%;z-index:99}.ol-geocoder .gcd-txt-input:focus{box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 6px #4d90fe;outline:none}.ol-geocoder .gcd-txt-search{background-color:transparent;border:none;cursor:pointer;display:inline-block;height:100%;line-height:100%;outline:0;position:absolute;right:0;top:0;vertical-align:middle;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:2em}.ol-geocoder .gcd-txt-glass{display:inline-block;height:100%;left:9px;position:absolute;top:26px;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-glass:after{content:"\1F50D"}.ol-geocoder ul.gcd-txt-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px rgba(0,0,0,.8);left:0;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:4.575em;transition:max-height .3s ease-in;white-space:normal;width:25em}.ol-geocoder ul.gcd-txt-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-txt-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-txt-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-txt-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-txt-result:empty{display:none}.ol-geocoder .gcd-hidden{opacity:0;visibility:hidden}.ol-geocoder .gcd-pseudo-rotate:after{animation:spin .7s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.gcd-address,.gcd-road{color:#333;font-size:.875em;font-weight:500}.gcd-city{font-weight:400}.gcd-city,.gcd-country{color:#333;font-size:.75em}.gcd-country{font-weight:lighter} \ No newline at end of file diff --git a/src/sass/glass.scss b/src/sass/glass.scss index 85a1e42..e190618 100644 --- a/src/sass/glass.scss +++ b/src/sass/glass.scss @@ -82,10 +82,9 @@ $result-top: $control-height; height: $btn-search-width; top: $btn-search-top; left: $btn-search-top; - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVwAAAFcBAMAAAB2OBsfAAAAGFBMVEXu7u7///8AAAAoKCh8fHzKysqlpaVSUlKH5Q7jAAAKM0lEQVR42u2dSVsbORCGW2aSuUrTi69Mt5crOAtX7CHJNSaBuaY9CVzHTjL8/cEYDEilpdWqdvmJdGseu/RS1lL6JFUnYlN4sinUHyNuxI24ETfiRtyIG3EjLonHJGH3fyH+GHEjbsSNuBE34kbciBtxd44bw/OIG3EjbsSNuBE34kbcPcUVTwpxBXL99OLi6uvZj7P3VxfzLTbJ8JwJ/uL6Vbkt1ck7RhaXifx6Usrl9ReauIIDsOtyMieIKz7DsHcengtiuPyv0lCq003XpYL7clWay1vG6eD+XVrLeC6o4H4qHUpVcxq4/5SlG6+ggOtIe8v7Rewc1532zr87xnXpZU/6G9strvitbFQGO8VlxaQZbvlmlwokX5VNy0+xu/B8UTYvNd8VbuZBe9vddoTLJz64t813N7iL0q/UfBe4fU/a7ejbKa5nU3gczTrFdQvDNJMx6xw3L1uUYde43v1sU+bd4rKiFW056hZXzNrhltMucVnWknYTmnWGa2y51c3Z+6uvZ9/Nc0WHuIaWO37/cSvkXX4wt96uFMhzLey7Jx9eq5F64Lqz8Fw75v5k0uLx9rO6kHjIu8LtaVz7RXDA6LVu7O0IVxMtDJhGp9Gs5454N7hwKPZar4Jl4P83Ft3gzvSancYovAKddoKbw8M+NxnNDIEOMu4fYMTNzWI1qJ504V0BjEzV3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YPppJ7i2F05OieHa3UsK1+5eWriZzb3BFMggjzbhaooTnvs+2l7pOaKFa3VvTQvX0b1UcBObCl/TwrWEvfd3ZsngWt07J4br4l5CuC7upYTr4F5KuMKiCTJiuJZV0CExXLt7aeFa3HtEDNdynMNVP0WPd+8f2YHNvTTC84fH3OZeWrjMsoY/poWbWM56VcRwbe5d0sK1uXdMDNfNvXRwndxLB1ect9BPd4DrIPBRwrUpUDUx3MI+VVDCtbh3RA23sI4NpHCFdSNzxwqk9GhWoBiV8NxNP51TwzULfOS8a3RvlZDDNQl8Y04O1yTwjQjiGtx7TK8xmNw7J4nbN7QFgrg6906J4vYNO4IEcWGBb8qp4qb67VaKuJB7a04X9wAeFsgokNKjqp/WxESn5/rpJ81ONk1cRYGqGWlcSYEacdq4knvtaeV2jPvMvUNOHfeZe+cJedwn7l3n+iGPmz9eyUv2AHern94ljaKPmz/sUSV7gXt/lfiU7wnuOjPJq1OR7AuuWN8pTvYHVwhiZyAT3IxZETfiRtyIG3EjbsSNuBG348f9iXcjbsSNuBE34kbciBtxI25UIONqIuJG3IgbcSNuxI24ETcqkDE830vc/wE4HweKeBzDmAAAAABJRU5ErkJggg=='); - background-repeat: no-repeat; - background-position: center center; - background-size: 20px; +} +.#{map-get($glass, button)}:after { + content: "\1F50D"; } ul.#{map-get($glass, result)} { diff --git a/src/sass/input-text.scss b/src/sass/input-text.scss index 9488de4..e270331 100644 --- a/src/sass/input-text.scss +++ b/src/sass/input-text.scss @@ -75,20 +75,19 @@ $result-top: $control-height + .2; cursor: pointer; } } - .#{map-get($input-text, icon)} { position: absolute; - top: 0; - left: 0; + top: 26px; + left: 9px; z-index: $z-index + 1; display: inline-block; width: $icon; height: 100%; - background-size: $icon / 1.8; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23333' d='M29.156 29.961l-.709.709a2.006 2.006 0 0 1-2.838 0l-5.676-5.674c-.656-.658-.729-1.644-.281-2.412l-3.104-3.102a9.975 9.975 0 0 1-5.965 1.979C5.043 21.461.552 16.97.552 11.43S5.043 1.398 10.583 1.398c5.541 0 10.031 4.491 10.031 10.032 0 2.579-.98 4.923-2.58 6.7l3.035 3.035c.768-.447 1.754-.375 2.41.283l5.676 5.674c.784.785.784 2.056.001 2.839zM18.088 11.389c0-4.155-3.369-7.523-7.524-7.523a7.523 7.523 0 1 0-.001 15.046 7.525 7.525 0 0 0 7.525-7.523z'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: center center; } +.#{map-get($input-text, icon)}:after { + content: "\1F50D"; +} + ul.#{map-get($input-text, result)} { position: absolute; top: $result-top;