diff --git a/README.md b/README.md index e2a10a0..828a012 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ geocoder.on('addresschosen', (evt) => { * `targetType` : `'glass-button'`; Can also be `'text-input'`; * `featureStyle` : `ol.style.Style`; Feature style; * `lang` : `'en-US'`; Preferable language; - * `limit` : `5`; Limit of results; + * `limit` : `5`; Limit of results; If limit = 1 : don't display the list but directly fies to the first found; * `countrycodes` : `''`; Only valid for `osm` and `mapquest`; Limit search results to a specific country (or a list of country codes separated with commas `FR,US`). This is an [ISO 3166-1alpha2 code] (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), e.g. `gb` for the United Kingdom, `br` for Brazil, etc; * `viewbox` : `''`; The preferred area to find search results. Any two corner points of the box are accepted as long as they span a real box. (string) ',,,' x is longitude, y is latitude (EPSG:4326); * `keepOpen` : `false`; Whether the results keep openned; diff --git a/dist/ol-geocoder-debug.js b/dist/ol-geocoder-debug.js index 14db98f..e5a8e51 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 11:09:15 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:36:09 GMT+0200 (heure d’été d’Europe centrale) */ @@ -939,26 +939,28 @@ switch (this.options.provider) { case PROVIDERS.OSM: addressHtml = `${row.address.name}`; - break; default: addressHtml = this.addressTemplate(row.address); } - const html = `${addressHtml}`; - const li = createElement('li', html); - - li.addEventListener( - 'click', - (evt) => { - evt.preventDefault(); - this.chosen(row, addressHtml, row.address, row.original); - }, - false - ); - - ul.append(li); + if (response.length == 1) { + this.chosen(row, addressHtml, row.address, row.original); + } else { + const li = createElement('li', `${addressHtml}`); + + li.addEventListener( + 'click', + (evt) => { + evt.preventDefault(); + this.chosen(row, addressHtml, row.address, row.original); + }, + false + ); + + ul.append(li); + } }); } diff --git a/dist/ol-geocoder-debug.js.map b/dist/ol-geocoder-debug.js.map index 0cfdab8..d489bd8 100644 --- a/dist/ol-geocoder-debug.js.map +++ b/dist/ol-geocoder-debug.js.map @@ -1 +1 @@ -{"version":3,"file":"ol-geocoder-debug.js","sources":["../konstants/index.js","../src/helpers/mix.js","../src/helpers/dom.js","../src/html.js","../src/helpers/ajax.js","../src/providers/photon.js","../src/providers/osm.js","../src/providers/mapquest.js","../src/providers/bing.js","../src/providers/opencage.js","../src/nominatim.js","../src/base.js"],"sourcesContent":["import * as _VARS_ from './vars.json';\n\nexport const VARS = _VARS_;\n\nexport const EVENT_TYPE = {\n ADDRESSCHOSEN: 'addresschosen',\n};\n\nexport const CONTROL_TYPE = {\n NOMINATIM: 'nominatim',\n REVERSE: 'reverse',\n};\n\nexport const TARGET_TYPE = {\n GLASS: 'glass-button',\n INPUT: 'text-input',\n};\n\nexport const FEATURE_SRC = '//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png';\n\nexport const PROVIDERS = {\n OSM: 'osm',\n MAPQUEST: 'mapquest',\n PHOTON: 'photon',\n BING: 'bing',\n OPENCAGE: 'opencage',\n};\n\nexport const DEFAULT_OPTIONS = {\n provider: PROVIDERS.OSM,\n label: '',\n placeholder: 'Search for an address',\n featureStyle: null,\n targetType: TARGET_TYPE.GLASS,\n lang: 'en-US',\n limit: 5,\n keepOpen: false,\n preventDefault: false,\n preventPanning: false,\n preventMarker: false,\n defaultFlyResolution: 10, // Meters per pixel\n debug: false,\n};","export function assert(condition, message = 'Assertion failed') {\n if (!condition) {\n if (typeof Error !== 'undefined') throw new Error(message);\n\n throw message; // Fallback\n }\n}\n\nexport function now() {\n // Polyfill for window.performance.now()\n // @license http://opensource.org/licenses/MIT\n // copyright Paul Irish 2015\n // https://gist.github.com/paulirish/5438650\n if ('performance' in window === false) {\n window.performance = {};\n }\n\n if ('now' in window.performance === false) {\n let nowOffset = Date.now();\n\n if (performance.timing && performance.timing.navigationStart) {\n nowOffset = performance.timing.navigationStart;\n }\n\n window.performance.now = () => Date.now() - nowOffset;\n }\n\n return window.performance.now();\n}\n\nexport function randomId(prefix) {\n const id = now().toString(36);\n\n return prefix ? prefix + id : id;\n}\n\nexport function isNumeric(str) {\n return /^\\d+$/u.test(str);\n}\n\nexport function isEmpty(str) {\n return !str || str.length === 0;\n}\n\nexport function emptyArray(array) {\n while (array.length) array.pop();\n}\n\nexport function anyMatchInArray(source, target) {\n return source.some((each) => target.includes(each));\n}\n\nexport function everyMatchInArray(arr1, arr2) {\n return arr2.every((each) => arr1.includes(each));\n}\n\nexport function anyItemHasValue(obj, has = false) {\n const keys = Object.keys(obj);\n\n keys.forEach((key) => {\n if (!isEmpty(obj[key])) has = true;\n });\n\n return has;\n}","/* eslint-disable prefer-named-capture-group */\nimport {\n isNumeric\n} from './mix';\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to remove a class.\n */\nexport function addClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => addClass(each, classname));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (!hasClass(element, array[i])) {\n _addClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to add a class.\n */\nexport function removeClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => removeClass(each, classname, timeout));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (hasClass(element, array[i])) {\n _removeClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element} element DOM node.\n * @param {String} classname Classname.\n * @return {Boolean}\n */\nexport function hasClass(element, c) {\n // use native if available\n return element.classList ? element.classList.contains(c) : classRegex(c).test(element.className);\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String} classname Classe.\n */\nexport function toggleClass(element, classname) {\n if (Array.isArray(element)) {\n element.forEach((each) => toggleClass(each, classname));\n\n return;\n }\n\n // use native if available\n if (element.classList) {\n element.classList.toggle(classname);\n } else {\n hasClass(element, classname) ? _removeClass(element, classname) : _addClass(element, classname);\n }\n}\n\n/**\n * Abstraction to querySelectorAll for increased\n * performance and greater usability\n * @param {String} selector\n * @param {Element} context (optional)\n * @param {Boolean} findAll (optional)\n * @return (findAll) {Element} : {Array}\n */\nexport function $(id) {\n id = id[0] === '#' ? id.slice(1, 1 + id.length) : id;\n\n return document.getElementById(id);\n}\n\nexport function isElement(obj) {\n // DOM, Level2\n if ('HTMLElement' in window) {\n return !!obj && obj instanceof HTMLElement;\n }\n\n // Older browsers\n return !!obj && typeof obj === 'object' && obj.nodeType === 1 && !!obj.nodeName;\n}\n\nexport function getAllChildren(node, tag) {\n return [].slice.call(node.getElementsByTagName(tag));\n}\n\nexport function removeAllChildren(node) {\n while (node.firstChild) node.firstChild.remove();\n}\n\nexport function removeAll(collection) {\n let node;\n\n while ((node = collection[0])) node.remove();\n}\n\nexport function getChildren(node, tag) {\n return [].filter.call(node.childNodes, (el) =>\n tag ? el.nodeType === 1 && el.tagName.toLowerCase() === tag : el.nodeType === 1\n );\n}\n\nexport function template(html, row) {\n return html.replace(/\\{\\s*([\\w-]+)\\s*\\}/gu, (htm, key) => {\n const value = row[key] === undefined ? '' : row[key];\n\n return htmlEscape(value);\n });\n}\n\nexport function htmlEscape(str) {\n return String(str)\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"')\n .replaceAll(\"'\", ''');\n}\n\nexport function createElement(node, html) {\n let elem;\n\n if (Array.isArray(node)) {\n elem = document.createElement(node[0]);\n\n if (node[1].id) elem.id = node[1].id;\n\n if (node[1].classname) elem.className = node[1].classname;\n\n if (node[1].attr) {\n const {\n attr\n } = node[1];\n\n if (Array.isArray(attr)) {\n let i = -1;\n\n while (++i < attr.length) {\n elem.setAttribute(attr[i].name, attr[i].value);\n }\n } else {\n elem.setAttribute(attr.name, attr.value);\n }\n }\n } else {\n elem = document.createElement(node);\n }\n\n elem.innerHTML = html;\n\n const frag = document.createDocumentFragment();\n\n while (elem.childNodes[0]) frag.append(elem.childNodes[0]);\n\n elem.append(frag);\n\n return elem;\n}\n\nfunction classRegex(classname) {\n return new RegExp(`(^|\\\\s+) ${classname} (\\\\s+|$)`, 'u');\n}\n\nfunction _addClass(el, klass, timeout) {\n // use native if available\n if (el.classList) {\n el.classList.add(klass);\n } else {\n el.className = `${el.className} ${klass}`.trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _removeClass(el, klass), timeout);\n }\n}\n\nfunction _removeClass(el, klass, timeout) {\n if (el.classList) {\n el.classList.remove(klass);\n } else {\n el.className = el.className.replace(classRegex(klass), ' ').trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _addClass(el, klass), timeout);\n }\n}","import {\n VARS,\n TARGET_TYPE\n} from '../konstants';\n\nimport {\n createElement\n} from './helpers/dom';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Html\n */\nexport class Html {\n /**\n * @constructor\n * @param {object} options Options.\n */\n constructor(options) {\n this.options = options;\n this.els = this.createControl();\n }\n\n createControl() {\n let container;\n let containerClass;\n let elements;\n\n if (this.options.targetType === TARGET_TYPE.INPUT) {\n containerClass = `${klasses.namespace} ${klasses.inputText.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.input\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.inputText.control}`),\n label: container.querySelector(`.${klasses.inputText.label}`),\n input: container.querySelector(`.${klasses.inputText.input}`),\n search: container.querySelector(`.${klasses.inputText.search}`),\n result: container.querySelector(`.${klasses.inputText.result}`),\n };\n elements.label.innerHTML = this.options.label;\n } else {\n containerClass = `${klasses.namespace} ${klasses.glass.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.glass\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.glass.control}`),\n button: container.querySelector(`.${klasses.glass.button}`),\n input: container.querySelector(`.${klasses.glass.input}`),\n search: container.querySelector(`.${klasses.glass.search}`),\n result: container.querySelector(`.${klasses.glass.result}`),\n };\n }\n\n // set placeholder from options\n elements.input.placeholder = this.options.placeholder;\n\n return elements;\n }\n}\n\nHtml.glass = `\n
\n \n \n \n
\n
    \n`;\n\nHtml.input = `\n
    \n \n \n \n \n
    \n
      \n`;","export function json(obj) {\n return new Promise((resolve, reject) => {\n const url = encodeUrlXhr(obj.url, obj.data);\n const config = {\n method: 'GET',\n mode: 'cors',\n credentials: 'same-origin',\n };\n\n if (obj.jsonp) {\n jsonp(url, obj.callbackName, resolve);\n } else {\n fetch(url, config)\n .then((r) => r.json())\n .then(resolve)\n .catch(reject);\n }\n });\n}\n\nfunction toQueryString(obj) {\n return Object.keys(obj)\n .reduce((acc, k) => {\n acc.push(\n typeof obj[k] === 'object' ?\n toQueryString(obj[k]) :\n `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`\n );\n\n return acc;\n }, [])\n .join('&');\n}\n\nfunction encodeUrlXhr(url, data) {\n if (data && typeof data === 'object') {\n url += (/\\?/u.test(url) ? '&' : '?') + toQueryString(data);\n }\n\n return url;\n}\n\nfunction jsonp(url, key, callback) {\n // https://github.com/Fresheyeball/micro-jsonp/blob/master/src/jsonp.js\n const {\n head\n } = document;\n const script = document.createElement('script');\n // generate minimally unique name for callback function\n const callbackName = `f${Math.round(Math.random() * Date.now())}`;\n\n // set request url\n script.setAttribute(\n 'src',\n // add callback parameter to the url\n // where key is the parameter key supplied\n // and callbackName is the parameter value\n `${url + (url.indexOf('?') > 0 ? '&' : '?') + key}=${callbackName}`\n );\n\n // place jsonp callback on window,\n // the script sent by the server should call this\n // function as it was passed as a url parameter\n window[callbackName] = (data) => {\n window[callbackName] = undefined;\n\n // clean up script tag created for request\n setTimeout(() => head.removeChild(script), 0);\n\n // hand data back to the user\n callback(data);\n };\n\n // actually make the request\n head.append(script);\n}","/**\n * @class Photon\n */\nexport default class Photon {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://photon.komoot.io/api/',\n\n params: {\n q: '',\n limit: 10,\n lang: 'en',\n },\n\n langs: ['de', 'it', 'fr', 'en'],\n };\n }\n\n getParameters(options) {\n options.lang = options.lang.toLowerCase();\n\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n limit: options.limit || this.settings.params.limit,\n\n lang: this.settings.langs.includes(options.lang) ? options.lang : this.settings.params.lang,\n },\n };\n }\n\n handleResponse(results) {\n if (results.features.length === 0) return [];\n\n return results.features.map((result) => ({\n lon: result.geometry.coordinates[0],\n lat: result.geometry.coordinates[1],\n\n address: {\n name: result.properties.name,\n postcode: result.properties.postcode,\n city: result.properties.city,\n state: result.properties.state,\n country: result.properties.country,\n },\n\n original: {\n formatted: result.properties.name,\n details: result.properties,\n },\n }));\n }\n}","/**\n * @class OpenStreet\n */\nexport default class OpenStreet {\n /**\n * @constructor\n */\n constructor(options) {\n this.settings = {\n url: 'https://nominatim.openstreetmap.org/search',\n ...options, // Allow custom URL for osm provider https://github.com/Dominique92/ol-geocoder/issues/266\n\n params: {\n q: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n viewbox: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(opt) {\n return {\n url: this.settings.url,\n\n params: {\n q: opt.query,\n format: this.settings.params.format,\n addressdetails: this.settings.params.addressdetails,\n limit: opt.limit || this.settings.params.limit,\n countrycodes: opt.countrycodes || this.settings.params.countrycodes,\n viewbox: opt.viewbox || this.settings.params.viewbox,\n 'accept-language': opt.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n bbox: result.boundingbox,\n\n address: {\n name: result.display_name,\n road: result.address.road || '',\n houseNumber: result.address.house_number || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class MapQuest\n */\nexport default class MapQuest {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://open.mapquestapi.com/nominatim/v1/search.php',\n\n params: {\n q: '',\n key: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n format: 'json',\n addressdetails: 1,\n limit: options.limit || this.settings.params.limit,\n countrycodes: options.countrycodes || this.settings.params.countrycodes,\n\n 'accept-language': options.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n\n address: {\n name: result.address.neighbourhood || '',\n road: result.address.road || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class Bing\n */\nexport default class Bing {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://dev.virtualearth.net/REST/v1/Locations',\n callbackName: 'jsonp',\n\n params: {\n query: '',\n key: '',\n includeNeighborhood: 0,\n maxResults: 10,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n callbackName: this.settings.callbackName,\n\n params: {\n query: options.query,\n key: options.key,\n\n includeNeighborhood: options.includeNeighborhood || this.settings.params.includeNeighborhood,\n\n maxResults: options.maxResults || this.settings.params.maxResults,\n },\n };\n }\n\n handleResponse(results) {\n const {\n resources\n } = results.resourceSets[0];\n\n if (resources.length === 0) return [];\n\n return resources.map((result) => ({\n lon: result.point.coordinates[1],\n lat: result.point.coordinates[0],\n\n address: {\n name: result.name,\n },\n\n original: {\n formatted: result.address.formattedAddress,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class OpenCage\n */\nexport default class OpenCage {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://api.opencagedata.com/geocode/v1/json?',\n\n params: {\n q: '',\n key: '',\n limit: 10,\n countrycode: '',\n pretty: 1,\n no_annotations: 1,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n limit: options.limit || this.settings.params.limit,\n countrycode: options.countrycodes || this.settings.params.countrycodes,\n },\n };\n }\n\n handleResponse(results) {\n if (results.results.length === 0) return [];\n\n return results.results.map((result) => ({\n lon: result.geometry.lng,\n lat: result.geometry.lat,\n\n address: {\n name: result.components.house_number || '',\n road: result.components.road || '',\n postcode: result.components.postcode,\n city: result.components.city || result.components.town,\n state: result.components.state,\n country: result.components.country,\n },\n\n original: {\n formatted: result.formatted,\n details: result.components,\n },\n }));\n }\n}","import LayerVector from 'ol/layer/Vector';\nimport SourceVector from 'ol/source/Vector';\nimport Point from 'ol/geom/Point';\nimport Feature from 'ol/Feature';\nimport * as proj from 'ol/proj';\n\nimport {\n VARS,\n TARGET_TYPE,\n PROVIDERS,\n EVENT_TYPE\n} from '../konstants';\nimport {\n hasClass,\n addClass,\n removeClass,\n createElement,\n template,\n removeAllChildren,\n} from './helpers/dom';\nimport {\n randomId\n} from './helpers/mix';\nimport {\n json\n} from './helpers/ajax';\n\nimport Photon from './providers/photon';\nimport OpenStreet from './providers/osm';\nimport MapQuest from './providers/mapquest';\nimport Bing from './providers/bing';\nimport OpenCage from './providers/opencage';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Nominatim\n */\nexport class Nominatim {\n /**\n * @constructor\n * @param {Function} base Base class.\n */\n constructor(base, els) {\n this.Base = base;\n\n this.layerName = randomId('geocoder-layer-');\n this.layer = new LayerVector({\n name: this.layerName,\n source: new SourceVector(),\n displayInLayerSwitcher: false, // Remove search layer from legend https://github.com/Dominique92/ol-geocoder/issues/256\n });\n\n this.options = base.options;\n // provider is either the name of a built-in provider as a string or an\n // object that implements the provider API\n this.options.provider =\n typeof this.options.provider === 'string' ?\n this.options.provider.toLowerCase() :\n this.options.provider;\n this.provider = this.newProvider();\n\n this.els = els;\n this.lastQuery = '';\n this.container = this.els.container;\n this.registeredListeners = {\n mapClick: false,\n };\n this.setListeners();\n }\n\n setListeners() {\n const openSearch = (evt) => {\n evt.stopPropagation();\n hasClass(this.els.control, klasses.glass.expanded) ? this.collapse() : this.expand();\n };\n const query = (evt) => {\n const value = evt.target.value.trim();\n const hit = evt.key ?\n evt.key === 'Enter' :\n evt.which ?\n evt.which === 13 :\n evt.keyCode ?\n evt.keyCode === 13 :\n false;\n\n if (hit) {\n evt.preventDefault();\n this.query(value);\n }\n };\n const stopBubbling = (evt) => evt.stopPropagation();\n const search = () => {\n this.els.input.focus();\n this.query(this.els.input.value);\n };\n const handleValue = (evt) => {\n const value = evt.target.value.trim();\n\n value.length !== 0 ?\n removeClass(this.els.search, klasses.hidden) :\n addClass(this.els.search, klasses.hidden);\n };\n\n this.els.input.addEventListener('keypress', query, false);\n this.els.input.addEventListener('click', stopBubbling, false);\n this.els.input.addEventListener('input', handleValue, false);\n this.els.search.addEventListener('click', search, false);\n\n if (this.options.targetType === TARGET_TYPE.GLASS) {\n this.els.button.addEventListener('click', openSearch, false);\n }\n }\n\n query(q) {\n // lazy provider\n if (!this.provider) {\n this.provider = this.newProvider();\n }\n\n const parameters = this.provider.getParameters({\n query: q,\n key: this.options.key,\n lang: this.options.lang,\n countrycodes: this.options.countrycodes,\n viewbox: this.options.viewbox,\n limit: this.options.limit,\n });\n\n if (this.lastQuery === q && this.els.result.firstChild) return;\n\n this.lastQuery = q;\n this.clearResults();\n addClass(this.els.search, klasses.spin);\n\n const ajax = {\n url: parameters.url,\n data: parameters.params,\n };\n\n if (parameters.callbackName) {\n ajax.jsonp = true;\n ajax.callbackName = parameters.callbackName;\n }\n\n json(ajax)\n .then((res) => {\n // eslint-disable-next-line no-console\n this.options.debug && console.info(res);\n\n removeClass(this.els.search, klasses.spin);\n\n // will be fullfiled according to provider\n const res_ = this.provider.handleResponse(res);\n\n if (res_) {\n this.createList(res_);\n this.listenMapClick();\n }\n })\n .catch(() => {\n removeClass(this.els.search, klasses.spin);\n\n const li = createElement('li', '
      Error! No internet connection?
      ');\n\n this.els.result.append(li);\n });\n }\n\n createList(response) {\n const ul = this.els.result;\n\n response.forEach((row) => {\n let addressHtml;\n\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n addressHtml = `${row.address.name}`;\n\n break;\n\n default:\n addressHtml = this.addressTemplate(row.address);\n }\n\n const html = `${addressHtml}`;\n const li = createElement('li', html);\n\n li.addEventListener(\n 'click',\n (evt) => {\n evt.preventDefault();\n this.chosen(row, addressHtml, row.address, row.original);\n },\n false\n );\n\n ul.append(li);\n });\n }\n\n chosen(place, addressHtml, addressObj, addressOriginal) {\n const map = this.Base.getMap();\n const coord_ = [Number.parseFloat(place.lon), Number.parseFloat(place.lat)];\n const projection = map.getView().getProjection();\n const coord = proj.transform(coord_, 'EPSG:4326', projection);\n\n let {\n bbox\n } = place;\n\n if (bbox) {\n bbox = proj.transformExtent(\n // https://nominatim.org/release-docs/latest/api/Output/#boundingbox\n // Requires parseFloat on negative bbox entries\n [parseFloat(bbox[2]), parseFloat(bbox[0]), parseFloat(bbox[3]), parseFloat(bbox[1])], // SNWE -> WSEN\n 'EPSG:4326',\n projection\n );\n }\n\n const address = {\n formatted: addressHtml,\n details: addressObj,\n original: addressOriginal,\n };\n\n this.options.keepOpen === false && this.clearResults(true);\n\n if (this.options.preventDefault === true || this.options.preventMarker === true) {\n // No display change\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n coordinate: coord,\n bbox,\n place,\n });\n } else {\n // Display a marker\n const feature = this.createFeature(coord, address);\n\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n feature,\n coordinate: coord,\n bbox,\n place,\n });\n }\n\n if (this.options.preventDefault !== true && this.options.preventPanning !== true) {\n // Move & zoom to the position\n if (bbox) {\n map.getView().fit(bbox, {\n duration: 500,\n });\n } else {\n map.getView().animate({\n center: coord,\n // ol-geocoder results are too much zoomed -in Dominique92/ol-geocoder#235\n resolution: this.options.defaultFlyResolution,\n duration: 500,\n });\n }\n }\n }\n\n createFeature(coord) {\n const feature = new Feature(new Point(coord));\n\n this.addLayer();\n feature.setStyle(this.options.featureStyle);\n feature.setId(randomId('geocoder-ft-'));\n this.getSource().addFeature(feature);\n\n return feature;\n }\n\n addressTemplate(address) {\n const html = [];\n\n if (address.name) {\n html.push(['{name}'].join(''));\n }\n\n if (address.road || address.building || address.house_number) {\n html.push(\n ['{building} {road} {house_number}'].join('')\n );\n }\n\n if (address.city || address.town || address.village) {\n html.push(\n ['{postcode} {city} {town} {village}'].join('')\n );\n }\n\n if (address.state || address.country) {\n html.push(['{state} {country}'].join(''));\n }\n\n return template(html.join('
      '), address);\n }\n\n newProvider() {\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n return new OpenStreet(this.options);\n case PROVIDERS.MAPQUEST:\n return new MapQuest();\n case PROVIDERS.PHOTON:\n return new Photon();\n case PROVIDERS.BING:\n return new Bing();\n case PROVIDERS.OPENCAGE:\n return new OpenCage();\n\n default:\n return this.options.provider;\n }\n }\n\n expand() {\n removeClass(this.els.input, klasses.spin);\n addClass(this.els.control, klasses.glass.expanded);\n window.setTimeout(() => this.els.input.focus(), 100);\n this.listenMapClick();\n }\n\n collapse() {\n this.els.input.value = '';\n this.els.input.blur();\n addClass(this.els.search, klasses.hidden);\n removeClass(this.els.control, klasses.glass.expanded);\n this.clearResults();\n }\n\n listenMapClick() {\n // already registered\n if (this.registeredListeners.mapClick) return;\n\n const that = this;\n const mapElement = this.Base.getMap().getTargetElement();\n\n this.registeredListeners.mapClick = true;\n\n // one-time fire click\n mapElement.addEventListener(\n 'click', {\n handleEvent(evt) {\n that.clearResults(true);\n mapElement.removeEventListener(evt.type, this, false);\n that.registeredListeners.mapClick = false;\n },\n },\n false\n );\n }\n\n clearResults(collapse) {\n collapse && this.options.targetType === TARGET_TYPE.GLASS ?\n this.collapse() :\n removeAllChildren(this.els.result);\n }\n\n getSource() {\n return this.layer.getSource();\n }\n\n addLayer() {\n let found = false;\n\n const map = this.Base.getMap();\n\n map.getLayers().forEach((layer) => {\n if (layer === this.layer) found = true;\n });\n\n if (!found) map.addLayer(this.layer);\n }\n}","import Control from 'ol/control/Control';\nimport Style from 'ol/style/Style';\nimport Icon from 'ol/style/Icon';\n\nimport {\n CONTROL_TYPE,\n DEFAULT_OPTIONS,\n FEATURE_SRC\n} from '../konstants';\n\nimport {\n Html\n} from './html';\nimport {\n Nominatim\n} from './nominatim';\nimport {\n assert,\n} from './helpers/mix';\n\n/**\n * @class Base\n * @extends {ol.control.Control}\n */\nexport default class Base extends Control {\n /**\n * @constructor\n * @param {string} type nominatim|reverse.\n * @param {object} options Options.\n */\n constructor(type = CONTROL_TYPE.NOMINATIM, options = {}) {\n assert(typeof type === 'string', '@param `type` should be string!');\n assert(\n type === CONTROL_TYPE.NOMINATIM || type === CONTROL_TYPE.REVERSE,\n `@param 'type' should be '${CONTROL_TYPE.NOMINATIM}'\n or '${CONTROL_TYPE.REVERSE}'!`\n );\n options = {\n ...DEFAULT_OPTIONS,\n featureStyle: [\n new Style({\n image: new Icon({\n scale: 0.7,\n src: FEATURE_SRC\n })\n }),\n ],\n ...options,\n };\n\n let container;\n\n let $nominatim;\n\n const $html = new Html(options);\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n container = $html.els.container;\n }\n\n super({\n element: container,\n ...options, // Allows to add ol.control.Control options (as target:)\n });\n\n if (!(this instanceof Base)) return new Base();\n\n this.options = options;\n this.container = container;\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n $nominatim = new Nominatim(this, $html.els);\n this.layer = $nominatim.layer;\n }\n }\n\n /**\n * @return {ol.layer.Vector} Returns the layer created by this control\n */\n getLayer() {\n return this.layer;\n }\n\n /**\n * @return {ol.source.Vector} Returns the source created by this control\n */\n getSource() {\n return this.getLayer().getSource();\n }\n\n /**\n * Set a new provider\n * @param {String} provider\n */\n setProvider(provider) {\n this.options.provider = provider;\n }\n\n /**\n * Set provider key\n * @param {String} key\n */\n setProviderKey(key) {\n this.options.key = key;\n }\n}"],"names":["klasses","LayerVector","SourceVector","proj","Feature","Point","Control","Style","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEO,MAAM,IAAI,GAAG,MAAM,CAAC;AAC3B;EACO,MAAM,UAAU,GAAG;EAC1B,EAAE,aAAa,EAAE,eAAe;EAChC,CAAC,CAAC;AACF;EACO,MAAM,YAAY,GAAG;EAC5B,EAAE,SAAS,EAAE,WAAW;EACxB,EAAE,OAAO,EAAE,SAAS;EACpB,CAAC,CAAC;AACF;EACO,MAAM,WAAW,GAAG;EAC3B,EAAE,KAAK,EAAE,cAAc;EACvB,EAAE,KAAK,EAAE,YAAY;EACrB,CAAC,CAAC;AACF;EACO,MAAM,WAAW,GAAG,mEAAmE,CAAC;AAC/F;EACO,MAAM,SAAS,GAAG;EACzB,EAAE,GAAG,EAAE,KAAK;EACZ,EAAE,QAAQ,EAAE,UAAU;EACtB,EAAE,MAAM,EAAE,QAAQ;EAClB,EAAE,IAAI,EAAE,MAAM;EACd,EAAE,QAAQ,EAAE,UAAU;EACtB,CAAC,CAAC;AACF;EACO,MAAM,eAAe,GAAG;EAC/B,EAAE,QAAQ,EAAE,SAAS,CAAC,GAAG;EACzB,EAAE,KAAK,EAAE,EAAE;EACX,EAAE,WAAW,EAAE,uBAAuB;EACtC,E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,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC;AACnD;EACA,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;EAC3B,IAAI,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;AAC/B;EACA,IAAI,IAAI,IAAI,KAAK,YAAY,CAAC,SAAS,EAAE;EACzC,MAAM,UAAU,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;EAClD,MAAM,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;EACpC,KAAK;EACL,GAAG;AACH;EACA;EACA;EACA;EACA,EAAE,QAAQ,GAAG;EACb,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC;EACtB,GAAG;AACH;EACA;EACA;EACA;EACA,EAAE,SAAS,GAAG;EACd,IAAI,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC;EACvC,GAAG;AACH;EACA;EACA;EACA;EACA;EACA,EAAE,WAAW,CAAC,QAAQ,EAAE;EACxB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;EACrC,GAAG;AACH;EACA;EACA;EACA;EACA;EACA,EAAE,cAAc,CAAC,GAAG,EAAE;EACtB,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;EAC3B,GAAG;EACH;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"ol-geocoder-debug.js","sources":["../konstants/index.js","../src/helpers/mix.js","../src/helpers/dom.js","../src/html.js","../src/helpers/ajax.js","../src/providers/photon.js","../src/providers/osm.js","../src/providers/mapquest.js","../src/providers/bing.js","../src/providers/opencage.js","../src/nominatim.js","../src/base.js"],"sourcesContent":["import * as _VARS_ from './vars.json';\n\nexport const VARS = _VARS_;\n\nexport const EVENT_TYPE = {\n ADDRESSCHOSEN: 'addresschosen',\n};\n\nexport const CONTROL_TYPE = {\n NOMINATIM: 'nominatim',\n REVERSE: 'reverse',\n};\n\nexport const TARGET_TYPE = {\n GLASS: 'glass-button',\n INPUT: 'text-input',\n};\n\nexport const FEATURE_SRC = '//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png';\n\nexport const PROVIDERS = {\n OSM: 'osm',\n MAPQUEST: 'mapquest',\n PHOTON: 'photon',\n BING: 'bing',\n OPENCAGE: 'opencage',\n};\n\nexport const DEFAULT_OPTIONS = {\n provider: PROVIDERS.OSM,\n label: '',\n placeholder: 'Search for an address',\n featureStyle: null,\n targetType: TARGET_TYPE.GLASS,\n lang: 'en-US',\n limit: 5,\n keepOpen: false,\n preventDefault: false,\n preventPanning: false,\n preventMarker: false,\n defaultFlyResolution: 10, // Meters per pixel\n debug: false,\n};","export function assert(condition, message = 'Assertion failed') {\n if (!condition) {\n if (typeof Error !== 'undefined') throw new Error(message);\n\n throw message; // Fallback\n }\n}\n\nexport function now() {\n // Polyfill for window.performance.now()\n // @license http://opensource.org/licenses/MIT\n // copyright Paul Irish 2015\n // https://gist.github.com/paulirish/5438650\n if ('performance' in window === false) {\n window.performance = {};\n }\n\n if ('now' in window.performance === false) {\n let nowOffset = Date.now();\n\n if (performance.timing && performance.timing.navigationStart) {\n nowOffset = performance.timing.navigationStart;\n }\n\n window.performance.now = () => Date.now() - nowOffset;\n }\n\n return window.performance.now();\n}\n\nexport function randomId(prefix) {\n const id = now().toString(36);\n\n return prefix ? prefix + id : id;\n}\n\nexport function isNumeric(str) {\n return /^\\d+$/u.test(str);\n}\n\nexport function isEmpty(str) {\n return !str || str.length === 0;\n}\n\nexport function emptyArray(array) {\n while (array.length) array.pop();\n}\n\nexport function anyMatchInArray(source, target) {\n return source.some((each) => target.includes(each));\n}\n\nexport function everyMatchInArray(arr1, arr2) {\n return arr2.every((each) => arr1.includes(each));\n}\n\nexport function anyItemHasValue(obj, has = false) {\n const keys = Object.keys(obj);\n\n keys.forEach((key) => {\n if (!isEmpty(obj[key])) has = true;\n });\n\n return has;\n}","/* eslint-disable prefer-named-capture-group */\nimport {\n isNumeric\n} from './mix';\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to remove a class.\n */\nexport function addClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => addClass(each, classname));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (!hasClass(element, array[i])) {\n _addClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to add a class.\n */\nexport function removeClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => removeClass(each, classname, timeout));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (hasClass(element, array[i])) {\n _removeClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element} element DOM node.\n * @param {String} classname Classname.\n * @return {Boolean}\n */\nexport function hasClass(element, c) {\n // use native if available\n return element.classList ? element.classList.contains(c) : classRegex(c).test(element.className);\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String} classname Classe.\n */\nexport function toggleClass(element, classname) {\n if (Array.isArray(element)) {\n element.forEach((each) => toggleClass(each, classname));\n\n return;\n }\n\n // use native if available\n if (element.classList) {\n element.classList.toggle(classname);\n } else {\n hasClass(element, classname) ? _removeClass(element, classname) : _addClass(element, classname);\n }\n}\n\n/**\n * Abstraction to querySelectorAll for increased\n * performance and greater usability\n * @param {String} selector\n * @param {Element} context (optional)\n * @param {Boolean} findAll (optional)\n * @return (findAll) {Element} : {Array}\n */\nexport function $(id) {\n id = id[0] === '#' ? id.slice(1, 1 + id.length) : id;\n\n return document.getElementById(id);\n}\n\nexport function isElement(obj) {\n // DOM, Level2\n if ('HTMLElement' in window) {\n return !!obj && obj instanceof HTMLElement;\n }\n\n // Older browsers\n return !!obj && typeof obj === 'object' && obj.nodeType === 1 && !!obj.nodeName;\n}\n\nexport function getAllChildren(node, tag) {\n return [].slice.call(node.getElementsByTagName(tag));\n}\n\nexport function removeAllChildren(node) {\n while (node.firstChild) node.firstChild.remove();\n}\n\nexport function removeAll(collection) {\n let node;\n\n while ((node = collection[0])) node.remove();\n}\n\nexport function getChildren(node, tag) {\n return [].filter.call(node.childNodes, (el) =>\n tag ? el.nodeType === 1 && el.tagName.toLowerCase() === tag : el.nodeType === 1\n );\n}\n\nexport function template(html, row) {\n return html.replace(/\\{\\s*([\\w-]+)\\s*\\}/gu, (htm, key) => {\n const value = row[key] === undefined ? '' : row[key];\n\n return htmlEscape(value);\n });\n}\n\nexport function htmlEscape(str) {\n return String(str)\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"')\n .replaceAll(\"'\", ''');\n}\n\nexport function createElement(node, html) {\n let elem;\n\n if (Array.isArray(node)) {\n elem = document.createElement(node[0]);\n\n if (node[1].id) elem.id = node[1].id;\n\n if (node[1].classname) elem.className = node[1].classname;\n\n if (node[1].attr) {\n const {\n attr\n } = node[1];\n\n if (Array.isArray(attr)) {\n let i = -1;\n\n while (++i < attr.length) {\n elem.setAttribute(attr[i].name, attr[i].value);\n }\n } else {\n elem.setAttribute(attr.name, attr.value);\n }\n }\n } else {\n elem = document.createElement(node);\n }\n\n elem.innerHTML = html;\n\n const frag = document.createDocumentFragment();\n\n while (elem.childNodes[0]) frag.append(elem.childNodes[0]);\n\n elem.append(frag);\n\n return elem;\n}\n\nfunction classRegex(classname) {\n return new RegExp(`(^|\\\\s+) ${classname} (\\\\s+|$)`, 'u');\n}\n\nfunction _addClass(el, klass, timeout) {\n // use native if available\n if (el.classList) {\n el.classList.add(klass);\n } else {\n el.className = `${el.className} ${klass}`.trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _removeClass(el, klass), timeout);\n }\n}\n\nfunction _removeClass(el, klass, timeout) {\n if (el.classList) {\n el.classList.remove(klass);\n } else {\n el.className = el.className.replace(classRegex(klass), ' ').trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _addClass(el, klass), timeout);\n }\n}","import {\n VARS,\n TARGET_TYPE\n} from '../konstants';\n\nimport {\n createElement\n} from './helpers/dom';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Html\n */\nexport class Html {\n /**\n * @constructor\n * @param {object} options Options.\n */\n constructor(options) {\n this.options = options;\n this.els = this.createControl();\n }\n\n createControl() {\n let container;\n let containerClass;\n let elements;\n\n if (this.options.targetType === TARGET_TYPE.INPUT) {\n containerClass = `${klasses.namespace} ${klasses.inputText.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.input\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.inputText.control}`),\n label: container.querySelector(`.${klasses.inputText.label}`),\n input: container.querySelector(`.${klasses.inputText.input}`),\n search: container.querySelector(`.${klasses.inputText.search}`),\n result: container.querySelector(`.${klasses.inputText.result}`),\n };\n elements.label.innerHTML = this.options.label;\n } else {\n containerClass = `${klasses.namespace} ${klasses.glass.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.glass\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.glass.control}`),\n button: container.querySelector(`.${klasses.glass.button}`),\n input: container.querySelector(`.${klasses.glass.input}`),\n search: container.querySelector(`.${klasses.glass.search}`),\n result: container.querySelector(`.${klasses.glass.result}`),\n };\n }\n\n // set placeholder from options\n elements.input.placeholder = this.options.placeholder;\n\n return elements;\n }\n}\n\nHtml.glass = `\n
      \n \n \n \n
      \n
        \n`;\n\nHtml.input = `\n
        \n \n \n \n \n
        \n
          \n`;","export function json(obj) {\n return new Promise((resolve, reject) => {\n const url = encodeUrlXhr(obj.url, obj.data);\n const config = {\n method: 'GET',\n mode: 'cors',\n credentials: 'same-origin',\n };\n\n if (obj.jsonp) {\n jsonp(url, obj.callbackName, resolve);\n } else {\n fetch(url, config)\n .then((r) => r.json())\n .then(resolve)\n .catch(reject);\n }\n });\n}\n\nfunction toQueryString(obj) {\n return Object.keys(obj)\n .reduce((acc, k) => {\n acc.push(\n typeof obj[k] === 'object' ?\n toQueryString(obj[k]) :\n `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`\n );\n\n return acc;\n }, [])\n .join('&');\n}\n\nfunction encodeUrlXhr(url, data) {\n if (data && typeof data === 'object') {\n url += (/\\?/u.test(url) ? '&' : '?') + toQueryString(data);\n }\n\n return url;\n}\n\nfunction jsonp(url, key, callback) {\n // https://github.com/Fresheyeball/micro-jsonp/blob/master/src/jsonp.js\n const {\n head\n } = document;\n const script = document.createElement('script');\n // generate minimally unique name for callback function\n const callbackName = `f${Math.round(Math.random() * Date.now())}`;\n\n // set request url\n script.setAttribute(\n 'src',\n // add callback parameter to the url\n // where key is the parameter key supplied\n // and callbackName is the parameter value\n `${url + (url.indexOf('?') > 0 ? '&' : '?') + key}=${callbackName}`\n );\n\n // place jsonp callback on window,\n // the script sent by the server should call this\n // function as it was passed as a url parameter\n window[callbackName] = (data) => {\n window[callbackName] = undefined;\n\n // clean up script tag created for request\n setTimeout(() => head.removeChild(script), 0);\n\n // hand data back to the user\n callback(data);\n };\n\n // actually make the request\n head.append(script);\n}","/**\n * @class Photon\n */\nexport default class Photon {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://photon.komoot.io/api/',\n\n params: {\n q: '',\n limit: 10,\n lang: 'en',\n },\n\n langs: ['de', 'it', 'fr', 'en'],\n };\n }\n\n getParameters(options) {\n options.lang = options.lang.toLowerCase();\n\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n limit: options.limit || this.settings.params.limit,\n\n lang: this.settings.langs.includes(options.lang) ? options.lang : this.settings.params.lang,\n },\n };\n }\n\n handleResponse(results) {\n if (results.features.length === 0) return [];\n\n return results.features.map((result) => ({\n lon: result.geometry.coordinates[0],\n lat: result.geometry.coordinates[1],\n\n address: {\n name: result.properties.name,\n postcode: result.properties.postcode,\n city: result.properties.city,\n state: result.properties.state,\n country: result.properties.country,\n },\n\n original: {\n formatted: result.properties.name,\n details: result.properties,\n },\n }));\n }\n}","/**\n * @class OpenStreet\n */\nexport default class OpenStreet {\n /**\n * @constructor\n */\n constructor(options) {\n this.settings = {\n url: 'https://nominatim.openstreetmap.org/search',\n ...options, // Allow custom URL for osm provider https://github.com/Dominique92/ol-geocoder/issues/266\n\n params: {\n q: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n viewbox: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(opt) {\n return {\n url: this.settings.url,\n\n params: {\n q: opt.query,\n format: this.settings.params.format,\n addressdetails: this.settings.params.addressdetails,\n limit: opt.limit || this.settings.params.limit,\n countrycodes: opt.countrycodes || this.settings.params.countrycodes,\n viewbox: opt.viewbox || this.settings.params.viewbox,\n 'accept-language': opt.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n bbox: result.boundingbox,\n\n address: {\n name: result.display_name,\n road: result.address.road || '',\n houseNumber: result.address.house_number || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class MapQuest\n */\nexport default class MapQuest {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://open.mapquestapi.com/nominatim/v1/search.php',\n\n params: {\n q: '',\n key: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n format: 'json',\n addressdetails: 1,\n limit: options.limit || this.settings.params.limit,\n countrycodes: options.countrycodes || this.settings.params.countrycodes,\n\n 'accept-language': options.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n\n address: {\n name: result.address.neighbourhood || '',\n road: result.address.road || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class Bing\n */\nexport default class Bing {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://dev.virtualearth.net/REST/v1/Locations',\n callbackName: 'jsonp',\n\n params: {\n query: '',\n key: '',\n includeNeighborhood: 0,\n maxResults: 10,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n callbackName: this.settings.callbackName,\n\n params: {\n query: options.query,\n key: options.key,\n\n includeNeighborhood: options.includeNeighborhood || this.settings.params.includeNeighborhood,\n\n maxResults: options.maxResults || this.settings.params.maxResults,\n },\n };\n }\n\n handleResponse(results) {\n const {\n resources\n } = results.resourceSets[0];\n\n if (resources.length === 0) return [];\n\n return resources.map((result) => ({\n lon: result.point.coordinates[1],\n lat: result.point.coordinates[0],\n\n address: {\n name: result.name,\n },\n\n original: {\n formatted: result.address.formattedAddress,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class OpenCage\n */\nexport default class OpenCage {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://api.opencagedata.com/geocode/v1/json?',\n\n params: {\n q: '',\n key: '',\n limit: 10,\n countrycode: '',\n pretty: 1,\n no_annotations: 1,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n limit: options.limit || this.settings.params.limit,\n countrycode: options.countrycodes || this.settings.params.countrycodes,\n },\n };\n }\n\n handleResponse(results) {\n if (results.results.length === 0) return [];\n\n return results.results.map((result) => ({\n lon: result.geometry.lng,\n lat: result.geometry.lat,\n\n address: {\n name: result.components.house_number || '',\n road: result.components.road || '',\n postcode: result.components.postcode,\n city: result.components.city || result.components.town,\n state: result.components.state,\n country: result.components.country,\n },\n\n original: {\n formatted: result.formatted,\n details: result.components,\n },\n }));\n }\n}","import LayerVector from 'ol/layer/Vector';\nimport SourceVector from 'ol/source/Vector';\nimport Point from 'ol/geom/Point';\nimport Feature from 'ol/Feature';\nimport * as proj from 'ol/proj';\n\nimport {\n VARS,\n TARGET_TYPE,\n PROVIDERS,\n EVENT_TYPE\n} from '../konstants';\nimport {\n hasClass,\n addClass,\n removeClass,\n createElement,\n template,\n removeAllChildren,\n} from './helpers/dom';\nimport {\n randomId\n} from './helpers/mix';\nimport {\n json\n} from './helpers/ajax';\n\nimport Photon from './providers/photon';\nimport OpenStreet from './providers/osm';\nimport MapQuest from './providers/mapquest';\nimport Bing from './providers/bing';\nimport OpenCage from './providers/opencage';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Nominatim\n */\nexport class Nominatim {\n /**\n * @constructor\n * @param {Function} base Base class.\n */\n constructor(base, els) {\n this.Base = base;\n\n this.layerName = randomId('geocoder-layer-');\n this.layer = new LayerVector({\n name: this.layerName,\n source: new SourceVector(),\n displayInLayerSwitcher: false, // Remove search layer from legend https://github.com/Dominique92/ol-geocoder/issues/256\n });\n\n this.options = base.options;\n // provider is either the name of a built-in provider as a string or an\n // object that implements the provider API\n this.options.provider =\n typeof this.options.provider === 'string' ?\n this.options.provider.toLowerCase() :\n this.options.provider;\n this.provider = this.newProvider();\n\n this.els = els;\n this.lastQuery = '';\n this.container = this.els.container;\n this.registeredListeners = {\n mapClick: false,\n };\n this.setListeners();\n }\n\n setListeners() {\n const openSearch = (evt) => {\n evt.stopPropagation();\n hasClass(this.els.control, klasses.glass.expanded) ? this.collapse() : this.expand();\n };\n const query = (evt) => {\n const value = evt.target.value.trim();\n const hit = evt.key ?\n evt.key === 'Enter' :\n evt.which ?\n evt.which === 13 :\n evt.keyCode ?\n evt.keyCode === 13 :\n false;\n\n if (hit) {\n evt.preventDefault();\n this.query(value);\n }\n };\n const stopBubbling = (evt) => evt.stopPropagation();\n const search = () => {\n this.els.input.focus();\n this.query(this.els.input.value);\n };\n const handleValue = (evt) => {\n const value = evt.target.value.trim();\n\n value.length !== 0 ?\n removeClass(this.els.search, klasses.hidden) :\n addClass(this.els.search, klasses.hidden);\n };\n\n this.els.input.addEventListener('keypress', query, false);\n this.els.input.addEventListener('click', stopBubbling, false);\n this.els.input.addEventListener('input', handleValue, false);\n this.els.search.addEventListener('click', search, false);\n\n if (this.options.targetType === TARGET_TYPE.GLASS) {\n this.els.button.addEventListener('click', openSearch, false);\n }\n }\n\n query(q) {\n // lazy provider\n if (!this.provider) {\n this.provider = this.newProvider();\n }\n\n const parameters = this.provider.getParameters({\n query: q,\n key: this.options.key,\n lang: this.options.lang,\n countrycodes: this.options.countrycodes,\n viewbox: this.options.viewbox,\n limit: this.options.limit,\n });\n\n if (this.lastQuery === q && this.els.result.firstChild) return;\n\n this.lastQuery = q;\n this.clearResults();\n addClass(this.els.search, klasses.spin);\n\n const ajax = {\n url: parameters.url,\n data: parameters.params,\n };\n\n if (parameters.callbackName) {\n ajax.jsonp = true;\n ajax.callbackName = parameters.callbackName;\n }\n\n json(ajax)\n .then((res) => {\n // eslint-disable-next-line no-console\n this.options.debug && console.info(res);\n\n removeClass(this.els.search, klasses.spin);\n\n // will be fullfiled according to provider\n const res_ = this.provider.handleResponse(res);\n\n if (res_) {\n this.createList(res_);\n this.listenMapClick();\n }\n })\n .catch(() => {\n removeClass(this.els.search, klasses.spin);\n\n const li = createElement('li', '
          Error! No internet connection?
          ');\n\n this.els.result.append(li);\n });\n }\n\n createList(response) {\n const ul = this.els.result;\n\n response.forEach((row) => {\n let addressHtml;\n\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n addressHtml = `${row.address.name}`;\n break;\n\n default:\n addressHtml = this.addressTemplate(row.address);\n }\n\n if (response.length == 1) {\n this.chosen(row, addressHtml, row.address, row.original);\n } else {\n const li = createElement('li', `${addressHtml}`);\n\n li.addEventListener(\n 'click',\n (evt) => {\n evt.preventDefault();\n this.chosen(row, addressHtml, row.address, row.original);\n },\n false\n );\n\n ul.append(li);\n }\n });\n }\n\n chosen(place, addressHtml, addressObj, addressOriginal) {\n const map = this.Base.getMap();\n const coord_ = [Number.parseFloat(place.lon), Number.parseFloat(place.lat)];\n const projection = map.getView().getProjection();\n const coord = proj.transform(coord_, 'EPSG:4326', projection);\n\n let {\n bbox\n } = place;\n\n if (bbox) {\n bbox = proj.transformExtent(\n // https://nominatim.org/release-docs/latest/api/Output/#boundingbox\n // Requires parseFloat on negative bbox entries\n [parseFloat(bbox[2]), parseFloat(bbox[0]), parseFloat(bbox[3]), parseFloat(bbox[1])], // SNWE -> WSEN\n 'EPSG:4326',\n projection\n );\n }\n\n const address = {\n formatted: addressHtml,\n details: addressObj,\n original: addressOriginal,\n };\n\n this.options.keepOpen === false && this.clearResults(true);\n\n if (this.options.preventDefault === true || this.options.preventMarker === true) {\n // No display change\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n coordinate: coord,\n bbox,\n place,\n });\n } else {\n // Display a marker\n const feature = this.createFeature(coord, address);\n\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n feature,\n coordinate: coord,\n bbox,\n place,\n });\n }\n\n if (this.options.preventDefault !== true && this.options.preventPanning !== true) {\n // Move & zoom to the position\n if (bbox) {\n map.getView().fit(bbox, {\n duration: 500,\n });\n } else {\n map.getView().animate({\n center: coord,\n // ol-geocoder results are too much zoomed -in Dominique92/ol-geocoder#235\n resolution: this.options.defaultFlyResolution,\n duration: 500,\n });\n }\n }\n }\n\n createFeature(coord) {\n const feature = new Feature(new Point(coord));\n\n this.addLayer();\n feature.setStyle(this.options.featureStyle);\n feature.setId(randomId('geocoder-ft-'));\n this.getSource().addFeature(feature);\n\n return feature;\n }\n\n addressTemplate(address) {\n const html = [];\n\n if (address.name) {\n html.push(['{name}'].join(''));\n }\n\n if (address.road || address.building || address.house_number) {\n html.push(\n ['{building} {road} {house_number}'].join('')\n );\n }\n\n if (address.city || address.town || address.village) {\n html.push(\n ['{postcode} {city} {town} {village}'].join('')\n );\n }\n\n if (address.state || address.country) {\n html.push(['{state} {country}'].join(''));\n }\n\n return template(html.join('
          '), address);\n }\n\n newProvider() {\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n return new OpenStreet(this.options);\n case PROVIDERS.MAPQUEST:\n return new MapQuest();\n case PROVIDERS.PHOTON:\n return new Photon();\n case PROVIDERS.BING:\n return new Bing();\n case PROVIDERS.OPENCAGE:\n return new OpenCage();\n\n default:\n return this.options.provider;\n }\n }\n\n expand() {\n removeClass(this.els.input, klasses.spin);\n addClass(this.els.control, klasses.glass.expanded);\n window.setTimeout(() => this.els.input.focus(), 100);\n this.listenMapClick();\n }\n\n collapse() {\n this.els.input.value = '';\n this.els.input.blur();\n addClass(this.els.search, klasses.hidden);\n removeClass(this.els.control, klasses.glass.expanded);\n this.clearResults();\n }\n\n listenMapClick() {\n // already registered\n if (this.registeredListeners.mapClick) return;\n\n const that = this;\n const mapElement = this.Base.getMap().getTargetElement();\n\n this.registeredListeners.mapClick = true;\n\n // one-time fire click\n mapElement.addEventListener(\n 'click', {\n handleEvent(evt) {\n that.clearResults(true);\n mapElement.removeEventListener(evt.type, this, false);\n that.registeredListeners.mapClick = false;\n },\n },\n false\n );\n }\n\n clearResults(collapse) {\n collapse && this.options.targetType === TARGET_TYPE.GLASS ?\n this.collapse() :\n removeAllChildren(this.els.result);\n }\n\n getSource() {\n return this.layer.getSource();\n }\n\n addLayer() {\n let found = false;\n\n const map = this.Base.getMap();\n\n map.getLayers().forEach((layer) => {\n if (layer === this.layer) found = true;\n });\n\n if (!found) map.addLayer(this.layer);\n }\n}","import Control from 'ol/control/Control';\nimport Style from 'ol/style/Style';\nimport Icon from 'ol/style/Icon';\n\nimport {\n CONTROL_TYPE,\n DEFAULT_OPTIONS,\n FEATURE_SRC\n} from '../konstants';\n\nimport {\n Html\n} from './html';\nimport {\n Nominatim\n} from './nominatim';\nimport {\n assert,\n} from './helpers/mix';\n\n/**\n * @class Base\n * @extends {ol.control.Control}\n */\nexport default class Base extends Control {\n /**\n * @constructor\n * @param {string} type nominatim|reverse.\n * @param {object} options Options.\n */\n constructor(type = CONTROL_TYPE.NOMINATIM, options = {}) {\n assert(typeof type === 'string', '@param `type` should be string!');\n assert(\n type === CONTROL_TYPE.NOMINATIM || type === CONTROL_TYPE.REVERSE,\n `@param 'type' should be '${CONTROL_TYPE.NOMINATIM}'\n or '${CONTROL_TYPE.REVERSE}'!`\n );\n options = {\n ...DEFAULT_OPTIONS,\n featureStyle: [\n new Style({\n image: new Icon({\n scale: 0.7,\n src: FEATURE_SRC\n })\n }),\n ],\n ...options,\n };\n\n let container;\n\n let $nominatim;\n\n const $html = new Html(options);\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n container = $html.els.container;\n }\n\n super({\n element: container,\n ...options, // Allows to add ol.control.Control options (as target:)\n });\n\n if (!(this instanceof Base)) return new Base();\n\n this.options = options;\n this.container = container;\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n $nominatim = new Nominatim(this, $html.els);\n this.layer = $nominatim.layer;\n }\n }\n\n /**\n * @return {ol.layer.Vector} Returns the layer created by this control\n */\n getLayer() {\n return this.layer;\n }\n\n /**\n * @return {ol.source.Vector} Returns the source created by this control\n */\n getSource() {\n return this.getLayer().getSource();\n }\n\n /**\n * Set a new provider\n * @param {String} provider\n */\n setProvider(provider) {\n this.options.provider = provider;\n }\n\n /**\n * Set provider key\n * @param {String} key\n */\n setProviderKey(key) {\n this.options.key = key;\n }\n}"],"names":["klasses","LayerVector","SourceVector","proj","Feature","Point","Control","Style","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;EACpC,KAAK;EACL,GAAG;AACH;EACA;EACA;EACA;EACA,EAAE,QAAQ,GAAG;EACb,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC;EACtB,GAAG;AACH;EACA;EACA;EACA;EACA,EAAE,SAAS,GAAG;EACd,IAAI,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC;EACvC,GAAG;AACH;EACA;EACA;EACA;EACA;EACA,EAAE,WAAW,CAAC,QAAQ,EAAE;EACxB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;EACrC,GAAG;AACH;EACA;EACA;EACA;EACA;EACA,EAAE,cAAc,CAAC,GAAG,EAAE;EACtB,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;EAC3B,GAAG;EACH;;;;;;;;"} \ No newline at end of file diff --git a/dist/ol-geocoder.css b/dist/ol-geocoder.css index 6c529cf..9aa5c46 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 11:09:17 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:36:11 GMT+0200 (heure d’été d’Europe centrale) */ .ol-touch .ol-control.gcd-gl-control button { diff --git a/dist/ol-geocoder.js b/dist/ol-geocoder.js index 4bef240..5c3be6a 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 11:09:15 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:36:09 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((e=>{let s;if(this.options.provider===I)s=`${e.address.name}`;else s=this.addressTemplate(e.address);const r=U("li",`${s}`);r.addEventListener("click",(t=>{t.preventDefault(),this.chosen(e,s,e.address,e.original)}),!1),t.append(r)}))}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})); +!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.js.map b/dist/ol-geocoder.js.map index 8a902ab..4e8a5ce 100644 --- a/dist/ol-geocoder.js.map +++ b/dist/ol-geocoder.js.map @@ -1 +1 @@ -{"version":3,"file":"ol-geocoder.js","sources":["../konstants/index.js","../src/helpers/mix.js","../src/helpers/dom.js","../src/html.js","../src/helpers/ajax.js","../src/providers/photon.js","../src/providers/osm.js","../src/providers/mapquest.js","../src/providers/bing.js","../src/providers/opencage.js","../src/nominatim.js","../src/base.js"],"sourcesContent":["import * as _VARS_ from './vars.json';\n\nexport const VARS = _VARS_;\n\nexport const EVENT_TYPE = {\n ADDRESSCHOSEN: 'addresschosen',\n};\n\nexport const CONTROL_TYPE = {\n NOMINATIM: 'nominatim',\n REVERSE: 'reverse',\n};\n\nexport const TARGET_TYPE = {\n GLASS: 'glass-button',\n INPUT: 'text-input',\n};\n\nexport const FEATURE_SRC = '//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png';\n\nexport const PROVIDERS = {\n OSM: 'osm',\n MAPQUEST: 'mapquest',\n PHOTON: 'photon',\n BING: 'bing',\n OPENCAGE: 'opencage',\n};\n\nexport const DEFAULT_OPTIONS = {\n provider: PROVIDERS.OSM,\n label: '',\n placeholder: 'Search for an address',\n featureStyle: null,\n targetType: TARGET_TYPE.GLASS,\n lang: 'en-US',\n limit: 5,\n keepOpen: false,\n preventDefault: false,\n preventPanning: false,\n preventMarker: false,\n defaultFlyResolution: 10, // Meters per pixel\n debug: false,\n};","export function assert(condition, message = 'Assertion failed') {\n if (!condition) {\n if (typeof Error !== 'undefined') throw new Error(message);\n\n throw message; // Fallback\n }\n}\n\nexport function now() {\n // Polyfill for window.performance.now()\n // @license http://opensource.org/licenses/MIT\n // copyright Paul Irish 2015\n // https://gist.github.com/paulirish/5438650\n if ('performance' in window === false) {\n window.performance = {};\n }\n\n if ('now' in window.performance === false) {\n let nowOffset = Date.now();\n\n if (performance.timing && performance.timing.navigationStart) {\n nowOffset = performance.timing.navigationStart;\n }\n\n window.performance.now = () => Date.now() - nowOffset;\n }\n\n return window.performance.now();\n}\n\nexport function randomId(prefix) {\n const id = now().toString(36);\n\n return prefix ? prefix + id : id;\n}\n\nexport function isNumeric(str) {\n return /^\\d+$/u.test(str);\n}\n\nexport function isEmpty(str) {\n return !str || str.length === 0;\n}\n\nexport function emptyArray(array) {\n while (array.length) array.pop();\n}\n\nexport function anyMatchInArray(source, target) {\n return source.some((each) => target.includes(each));\n}\n\nexport function everyMatchInArray(arr1, arr2) {\n return arr2.every((each) => arr1.includes(each));\n}\n\nexport function anyItemHasValue(obj, has = false) {\n const keys = Object.keys(obj);\n\n keys.forEach((key) => {\n if (!isEmpty(obj[key])) has = true;\n });\n\n return has;\n}","/* eslint-disable prefer-named-capture-group */\nimport {\n isNumeric\n} from './mix';\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to remove a class.\n */\nexport function addClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => addClass(each, classname));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (!hasClass(element, array[i])) {\n _addClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to add a class.\n */\nexport function removeClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => removeClass(each, classname, timeout));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (hasClass(element, array[i])) {\n _removeClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element} element DOM node.\n * @param {String} classname Classname.\n * @return {Boolean}\n */\nexport function hasClass(element, c) {\n // use native if available\n return element.classList ? element.classList.contains(c) : classRegex(c).test(element.className);\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String} classname Classe.\n */\nexport function toggleClass(element, classname) {\n if (Array.isArray(element)) {\n element.forEach((each) => toggleClass(each, classname));\n\n return;\n }\n\n // use native if available\n if (element.classList) {\n element.classList.toggle(classname);\n } else {\n hasClass(element, classname) ? _removeClass(element, classname) : _addClass(element, classname);\n }\n}\n\n/**\n * Abstraction to querySelectorAll for increased\n * performance and greater usability\n * @param {String} selector\n * @param {Element} context (optional)\n * @param {Boolean} findAll (optional)\n * @return (findAll) {Element} : {Array}\n */\nexport function $(id) {\n id = id[0] === '#' ? id.slice(1, 1 + id.length) : id;\n\n return document.getElementById(id);\n}\n\nexport function isElement(obj) {\n // DOM, Level2\n if ('HTMLElement' in window) {\n return !!obj && obj instanceof HTMLElement;\n }\n\n // Older browsers\n return !!obj && typeof obj === 'object' && obj.nodeType === 1 && !!obj.nodeName;\n}\n\nexport function getAllChildren(node, tag) {\n return [].slice.call(node.getElementsByTagName(tag));\n}\n\nexport function removeAllChildren(node) {\n while (node.firstChild) node.firstChild.remove();\n}\n\nexport function removeAll(collection) {\n let node;\n\n while ((node = collection[0])) node.remove();\n}\n\nexport function getChildren(node, tag) {\n return [].filter.call(node.childNodes, (el) =>\n tag ? el.nodeType === 1 && el.tagName.toLowerCase() === tag : el.nodeType === 1\n );\n}\n\nexport function template(html, row) {\n return html.replace(/\\{\\s*([\\w-]+)\\s*\\}/gu, (htm, key) => {\n const value = row[key] === undefined ? '' : row[key];\n\n return htmlEscape(value);\n });\n}\n\nexport function htmlEscape(str) {\n return String(str)\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"')\n .replaceAll(\"'\", ''');\n}\n\nexport function createElement(node, html) {\n let elem;\n\n if (Array.isArray(node)) {\n elem = document.createElement(node[0]);\n\n if (node[1].id) elem.id = node[1].id;\n\n if (node[1].classname) elem.className = node[1].classname;\n\n if (node[1].attr) {\n const {\n attr\n } = node[1];\n\n if (Array.isArray(attr)) {\n let i = -1;\n\n while (++i < attr.length) {\n elem.setAttribute(attr[i].name, attr[i].value);\n }\n } else {\n elem.setAttribute(attr.name, attr.value);\n }\n }\n } else {\n elem = document.createElement(node);\n }\n\n elem.innerHTML = html;\n\n const frag = document.createDocumentFragment();\n\n while (elem.childNodes[0]) frag.append(elem.childNodes[0]);\n\n elem.append(frag);\n\n return elem;\n}\n\nfunction classRegex(classname) {\n return new RegExp(`(^|\\\\s+) ${classname} (\\\\s+|$)`, 'u');\n}\n\nfunction _addClass(el, klass, timeout) {\n // use native if available\n if (el.classList) {\n el.classList.add(klass);\n } else {\n el.className = `${el.className} ${klass}`.trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _removeClass(el, klass), timeout);\n }\n}\n\nfunction _removeClass(el, klass, timeout) {\n if (el.classList) {\n el.classList.remove(klass);\n } else {\n el.className = el.className.replace(classRegex(klass), ' ').trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _addClass(el, klass), timeout);\n }\n}","import {\n VARS,\n TARGET_TYPE\n} from '../konstants';\n\nimport {\n createElement\n} from './helpers/dom';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Html\n */\nexport class Html {\n /**\n * @constructor\n * @param {object} options Options.\n */\n constructor(options) {\n this.options = options;\n this.els = this.createControl();\n }\n\n createControl() {\n let container;\n let containerClass;\n let elements;\n\n if (this.options.targetType === TARGET_TYPE.INPUT) {\n containerClass = `${klasses.namespace} ${klasses.inputText.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.input\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.inputText.control}`),\n label: container.querySelector(`.${klasses.inputText.label}`),\n input: container.querySelector(`.${klasses.inputText.input}`),\n search: container.querySelector(`.${klasses.inputText.search}`),\n result: container.querySelector(`.${klasses.inputText.result}`),\n };\n elements.label.innerHTML = this.options.label;\n } else {\n containerClass = `${klasses.namespace} ${klasses.glass.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.glass\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.glass.control}`),\n button: container.querySelector(`.${klasses.glass.button}`),\n input: container.querySelector(`.${klasses.glass.input}`),\n search: container.querySelector(`.${klasses.glass.search}`),\n result: container.querySelector(`.${klasses.glass.result}`),\n };\n }\n\n // set placeholder from options\n elements.input.placeholder = this.options.placeholder;\n\n return elements;\n }\n}\n\nHtml.glass = `\n
                  \n \n \n \n
                  \n
                    \n`;\n\nHtml.input = `\n
                    \n \n \n \n \n
                    \n
                      \n`;","export function json(obj) {\n return new Promise((resolve, reject) => {\n const url = encodeUrlXhr(obj.url, obj.data);\n const config = {\n method: 'GET',\n mode: 'cors',\n credentials: 'same-origin',\n };\n\n if (obj.jsonp) {\n jsonp(url, obj.callbackName, resolve);\n } else {\n fetch(url, config)\n .then((r) => r.json())\n .then(resolve)\n .catch(reject);\n }\n });\n}\n\nfunction toQueryString(obj) {\n return Object.keys(obj)\n .reduce((acc, k) => {\n acc.push(\n typeof obj[k] === 'object' ?\n toQueryString(obj[k]) :\n `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`\n );\n\n return acc;\n }, [])\n .join('&');\n}\n\nfunction encodeUrlXhr(url, data) {\n if (data && typeof data === 'object') {\n url += (/\\?/u.test(url) ? '&' : '?') + toQueryString(data);\n }\n\n return url;\n}\n\nfunction jsonp(url, key, callback) {\n // https://github.com/Fresheyeball/micro-jsonp/blob/master/src/jsonp.js\n const {\n head\n } = document;\n const script = document.createElement('script');\n // generate minimally unique name for callback function\n const callbackName = `f${Math.round(Math.random() * Date.now())}`;\n\n // set request url\n script.setAttribute(\n 'src',\n // add callback parameter to the url\n // where key is the parameter key supplied\n // and callbackName is the parameter value\n `${url + (url.indexOf('?') > 0 ? '&' : '?') + key}=${callbackName}`\n );\n\n // place jsonp callback on window,\n // the script sent by the server should call this\n // function as it was passed as a url parameter\n window[callbackName] = (data) => {\n window[callbackName] = undefined;\n\n // clean up script tag created for request\n setTimeout(() => head.removeChild(script), 0);\n\n // hand data back to the user\n callback(data);\n };\n\n // actually make the request\n head.append(script);\n}","/**\n * @class Photon\n */\nexport default class Photon {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://photon.komoot.io/api/',\n\n params: {\n q: '',\n limit: 10,\n lang: 'en',\n },\n\n langs: ['de', 'it', 'fr', 'en'],\n };\n }\n\n getParameters(options) {\n options.lang = options.lang.toLowerCase();\n\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n limit: options.limit || this.settings.params.limit,\n\n lang: this.settings.langs.includes(options.lang) ? options.lang : this.settings.params.lang,\n },\n };\n }\n\n handleResponse(results) {\n if (results.features.length === 0) return [];\n\n return results.features.map((result) => ({\n lon: result.geometry.coordinates[0],\n lat: result.geometry.coordinates[1],\n\n address: {\n name: result.properties.name,\n postcode: result.properties.postcode,\n city: result.properties.city,\n state: result.properties.state,\n country: result.properties.country,\n },\n\n original: {\n formatted: result.properties.name,\n details: result.properties,\n },\n }));\n }\n}","/**\n * @class OpenStreet\n */\nexport default class OpenStreet {\n /**\n * @constructor\n */\n constructor(options) {\n this.settings = {\n url: 'https://nominatim.openstreetmap.org/search',\n ...options, // Allow custom URL for osm provider https://github.com/Dominique92/ol-geocoder/issues/266\n\n params: {\n q: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n viewbox: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(opt) {\n return {\n url: this.settings.url,\n\n params: {\n q: opt.query,\n format: this.settings.params.format,\n addressdetails: this.settings.params.addressdetails,\n limit: opt.limit || this.settings.params.limit,\n countrycodes: opt.countrycodes || this.settings.params.countrycodes,\n viewbox: opt.viewbox || this.settings.params.viewbox,\n 'accept-language': opt.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n bbox: result.boundingbox,\n\n address: {\n name: result.display_name,\n road: result.address.road || '',\n houseNumber: result.address.house_number || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class MapQuest\n */\nexport default class MapQuest {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://open.mapquestapi.com/nominatim/v1/search.php',\n\n params: {\n q: '',\n key: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n format: 'json',\n addressdetails: 1,\n limit: options.limit || this.settings.params.limit,\n countrycodes: options.countrycodes || this.settings.params.countrycodes,\n\n 'accept-language': options.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n\n address: {\n name: result.address.neighbourhood || '',\n road: result.address.road || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class Bing\n */\nexport default class Bing {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://dev.virtualearth.net/REST/v1/Locations',\n callbackName: 'jsonp',\n\n params: {\n query: '',\n key: '',\n includeNeighborhood: 0,\n maxResults: 10,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n callbackName: this.settings.callbackName,\n\n params: {\n query: options.query,\n key: options.key,\n\n includeNeighborhood: options.includeNeighborhood || this.settings.params.includeNeighborhood,\n\n maxResults: options.maxResults || this.settings.params.maxResults,\n },\n };\n }\n\n handleResponse(results) {\n const {\n resources\n } = results.resourceSets[0];\n\n if (resources.length === 0) return [];\n\n return resources.map((result) => ({\n lon: result.point.coordinates[1],\n lat: result.point.coordinates[0],\n\n address: {\n name: result.name,\n },\n\n original: {\n formatted: result.address.formattedAddress,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class OpenCage\n */\nexport default class OpenCage {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://api.opencagedata.com/geocode/v1/json?',\n\n params: {\n q: '',\n key: '',\n limit: 10,\n countrycode: '',\n pretty: 1,\n no_annotations: 1,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n limit: options.limit || this.settings.params.limit,\n countrycode: options.countrycodes || this.settings.params.countrycodes,\n },\n };\n }\n\n handleResponse(results) {\n if (results.results.length === 0) return [];\n\n return results.results.map((result) => ({\n lon: result.geometry.lng,\n lat: result.geometry.lat,\n\n address: {\n name: result.components.house_number || '',\n road: result.components.road || '',\n postcode: result.components.postcode,\n city: result.components.city || result.components.town,\n state: result.components.state,\n country: result.components.country,\n },\n\n original: {\n formatted: result.formatted,\n details: result.components,\n },\n }));\n }\n}","import LayerVector from 'ol/layer/Vector';\nimport SourceVector from 'ol/source/Vector';\nimport Point from 'ol/geom/Point';\nimport Feature from 'ol/Feature';\nimport * as proj from 'ol/proj';\n\nimport {\n VARS,\n TARGET_TYPE,\n PROVIDERS,\n EVENT_TYPE\n} from '../konstants';\nimport {\n hasClass,\n addClass,\n removeClass,\n createElement,\n template,\n removeAllChildren,\n} from './helpers/dom';\nimport {\n randomId\n} from './helpers/mix';\nimport {\n json\n} from './helpers/ajax';\n\nimport Photon from './providers/photon';\nimport OpenStreet from './providers/osm';\nimport MapQuest from './providers/mapquest';\nimport Bing from './providers/bing';\nimport OpenCage from './providers/opencage';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Nominatim\n */\nexport class Nominatim {\n /**\n * @constructor\n * @param {Function} base Base class.\n */\n constructor(base, els) {\n this.Base = base;\n\n this.layerName = randomId('geocoder-layer-');\n this.layer = new LayerVector({\n name: this.layerName,\n source: new SourceVector(),\n displayInLayerSwitcher: false, // Remove search layer from legend https://github.com/Dominique92/ol-geocoder/issues/256\n });\n\n this.options = base.options;\n // provider is either the name of a built-in provider as a string or an\n // object that implements the provider API\n this.options.provider =\n typeof this.options.provider === 'string' ?\n this.options.provider.toLowerCase() :\n this.options.provider;\n this.provider = this.newProvider();\n\n this.els = els;\n this.lastQuery = '';\n this.container = this.els.container;\n this.registeredListeners = {\n mapClick: false,\n };\n this.setListeners();\n }\n\n setListeners() {\n const openSearch = (evt) => {\n evt.stopPropagation();\n hasClass(this.els.control, klasses.glass.expanded) ? this.collapse() : this.expand();\n };\n const query = (evt) => {\n const value = evt.target.value.trim();\n const hit = evt.key ?\n evt.key === 'Enter' :\n evt.which ?\n evt.which === 13 :\n evt.keyCode ?\n evt.keyCode === 13 :\n false;\n\n if (hit) {\n evt.preventDefault();\n this.query(value);\n }\n };\n const stopBubbling = (evt) => evt.stopPropagation();\n const search = () => {\n this.els.input.focus();\n this.query(this.els.input.value);\n };\n const handleValue = (evt) => {\n const value = evt.target.value.trim();\n\n value.length !== 0 ?\n removeClass(this.els.search, klasses.hidden) :\n addClass(this.els.search, klasses.hidden);\n };\n\n this.els.input.addEventListener('keypress', query, false);\n this.els.input.addEventListener('click', stopBubbling, false);\n this.els.input.addEventListener('input', handleValue, false);\n this.els.search.addEventListener('click', search, false);\n\n if (this.options.targetType === TARGET_TYPE.GLASS) {\n this.els.button.addEventListener('click', openSearch, false);\n }\n }\n\n query(q) {\n // lazy provider\n if (!this.provider) {\n this.provider = this.newProvider();\n }\n\n const parameters = this.provider.getParameters({\n query: q,\n key: this.options.key,\n lang: this.options.lang,\n countrycodes: this.options.countrycodes,\n viewbox: this.options.viewbox,\n limit: this.options.limit,\n });\n\n if (this.lastQuery === q && this.els.result.firstChild) return;\n\n this.lastQuery = q;\n this.clearResults();\n addClass(this.els.search, klasses.spin);\n\n const ajax = {\n url: parameters.url,\n data: parameters.params,\n };\n\n if (parameters.callbackName) {\n ajax.jsonp = true;\n ajax.callbackName = parameters.callbackName;\n }\n\n json(ajax)\n .then((res) => {\n // eslint-disable-next-line no-console\n this.options.debug && console.info(res);\n\n removeClass(this.els.search, klasses.spin);\n\n // will be fullfiled according to provider\n const res_ = this.provider.handleResponse(res);\n\n if (res_) {\n this.createList(res_);\n this.listenMapClick();\n }\n })\n .catch(() => {\n removeClass(this.els.search, klasses.spin);\n\n const li = createElement('li', '
                      Error! No internet connection?
                      ');\n\n this.els.result.append(li);\n });\n }\n\n createList(response) {\n const ul = this.els.result;\n\n response.forEach((row) => {\n let addressHtml;\n\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n addressHtml = `${row.address.name}`;\n\n break;\n\n default:\n addressHtml = this.addressTemplate(row.address);\n }\n\n const html = `${addressHtml}`;\n const li = createElement('li', html);\n\n li.addEventListener(\n 'click',\n (evt) => {\n evt.preventDefault();\n this.chosen(row, addressHtml, row.address, row.original);\n },\n false\n );\n\n ul.append(li);\n });\n }\n\n chosen(place, addressHtml, addressObj, addressOriginal) {\n const map = this.Base.getMap();\n const coord_ = [Number.parseFloat(place.lon), Number.parseFloat(place.lat)];\n const projection = map.getView().getProjection();\n const coord = proj.transform(coord_, 'EPSG:4326', projection);\n\n let {\n bbox\n } = place;\n\n if (bbox) {\n bbox = proj.transformExtent(\n // https://nominatim.org/release-docs/latest/api/Output/#boundingbox\n // Requires parseFloat on negative bbox entries\n [parseFloat(bbox[2]), parseFloat(bbox[0]), parseFloat(bbox[3]), parseFloat(bbox[1])], // SNWE -> WSEN\n 'EPSG:4326',\n projection\n );\n }\n\n const address = {\n formatted: addressHtml,\n details: addressObj,\n original: addressOriginal,\n };\n\n this.options.keepOpen === false && this.clearResults(true);\n\n if (this.options.preventDefault === true || this.options.preventMarker === true) {\n // No display change\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n coordinate: coord,\n bbox,\n place,\n });\n } else {\n // Display a marker\n const feature = this.createFeature(coord, address);\n\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n feature,\n coordinate: coord,\n bbox,\n place,\n });\n }\n\n if (this.options.preventDefault !== true && this.options.preventPanning !== true) {\n // Move & zoom to the position\n if (bbox) {\n map.getView().fit(bbox, {\n duration: 500,\n });\n } else {\n map.getView().animate({\n center: coord,\n // ol-geocoder results are too much zoomed -in Dominique92/ol-geocoder#235\n resolution: this.options.defaultFlyResolution,\n duration: 500,\n });\n }\n }\n }\n\n createFeature(coord) {\n const feature = new Feature(new Point(coord));\n\n this.addLayer();\n feature.setStyle(this.options.featureStyle);\n feature.setId(randomId('geocoder-ft-'));\n this.getSource().addFeature(feature);\n\n return feature;\n }\n\n addressTemplate(address) {\n const html = [];\n\n if (address.name) {\n html.push(['{name}'].join(''));\n }\n\n if (address.road || address.building || address.house_number) {\n html.push(\n ['{building} {road} {house_number}'].join('')\n );\n }\n\n if (address.city || address.town || address.village) {\n html.push(\n ['{postcode} {city} {town} {village}'].join('')\n );\n }\n\n if (address.state || address.country) {\n html.push(['{state} {country}'].join(''));\n }\n\n return template(html.join('
                      '), address);\n }\n\n newProvider() {\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n return new OpenStreet(this.options);\n case PROVIDERS.MAPQUEST:\n return new MapQuest();\n case PROVIDERS.PHOTON:\n return new Photon();\n case PROVIDERS.BING:\n return new Bing();\n case PROVIDERS.OPENCAGE:\n return new OpenCage();\n\n default:\n return this.options.provider;\n }\n }\n\n expand() {\n removeClass(this.els.input, klasses.spin);\n addClass(this.els.control, klasses.glass.expanded);\n window.setTimeout(() => this.els.input.focus(), 100);\n this.listenMapClick();\n }\n\n collapse() {\n this.els.input.value = '';\n this.els.input.blur();\n addClass(this.els.search, klasses.hidden);\n removeClass(this.els.control, klasses.glass.expanded);\n this.clearResults();\n }\n\n listenMapClick() {\n // already registered\n if (this.registeredListeners.mapClick) return;\n\n const that = this;\n const mapElement = this.Base.getMap().getTargetElement();\n\n this.registeredListeners.mapClick = true;\n\n // one-time fire click\n mapElement.addEventListener(\n 'click', {\n handleEvent(evt) {\n that.clearResults(true);\n mapElement.removeEventListener(evt.type, this, false);\n that.registeredListeners.mapClick = false;\n },\n },\n false\n );\n }\n\n clearResults(collapse) {\n collapse && this.options.targetType === TARGET_TYPE.GLASS ?\n this.collapse() :\n removeAllChildren(this.els.result);\n }\n\n getSource() {\n return this.layer.getSource();\n }\n\n addLayer() {\n let found = false;\n\n const map = this.Base.getMap();\n\n map.getLayers().forEach((layer) => {\n if (layer === this.layer) found = true;\n });\n\n if (!found) map.addLayer(this.layer);\n }\n}","import Control from 'ol/control/Control';\nimport Style from 'ol/style/Style';\nimport Icon from 'ol/style/Icon';\n\nimport {\n CONTROL_TYPE,\n DEFAULT_OPTIONS,\n FEATURE_SRC\n} from '../konstants';\n\nimport {\n Html\n} from './html';\nimport {\n Nominatim\n} from './nominatim';\nimport {\n assert,\n} from './helpers/mix';\n\n/**\n * @class Base\n * @extends {ol.control.Control}\n */\nexport default class Base extends Control {\n /**\n * @constructor\n * @param {string} type nominatim|reverse.\n * @param {object} options Options.\n */\n constructor(type = CONTROL_TYPE.NOMINATIM, options = {}) {\n assert(typeof type === 'string', '@param `type` should be string!');\n assert(\n type === CONTROL_TYPE.NOMINATIM || type === CONTROL_TYPE.REVERSE,\n `@param 'type' should be '${CONTROL_TYPE.NOMINATIM}'\n or '${CONTROL_TYPE.REVERSE}'!`\n );\n options = {\n ...DEFAULT_OPTIONS,\n featureStyle: [\n new Style({\n image: new Icon({\n scale: 0.7,\n src: FEATURE_SRC\n })\n }),\n ],\n ...options,\n };\n\n let container;\n\n let $nominatim;\n\n const $html = new Html(options);\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n container = $html.els.container;\n }\n\n super({\n element: container,\n ...options, // Allows to add ol.control.Control options (as target:)\n });\n\n if (!(this instanceof Base)) return new Base();\n\n this.options = options;\n this.container = container;\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n $nominatim = new Nominatim(this, $html.els);\n this.layer = $nominatim.layer;\n }\n }\n\n /**\n * @return {ol.layer.Vector} Returns the layer created by this control\n */\n getLayer() {\n return this.layer;\n }\n\n /**\n * @return {ol.source.Vector} Returns the source created by this control\n */\n getSource() {\n return this.getLayer().getSource();\n }\n\n /**\n * Set a new provider\n * @param {String} provider\n */\n setProvider(provider) {\n this.options.provider = provider;\n }\n\n /**\n * Set provider key\n * @param {String} key\n */\n setProviderKey(key) {\n this.options.key = key;\n }\n}"],"names":["VARS","EVENT_TYPE","CONTROL_TYPE","TARGET_TYPE","PROVIDERS","DEFAULT_OPTIONS","provider","label","placeholder","featureStyle","targetType","lang","limit","keepOpen","preventDefault","preventPanning","preventMarker","defaultFlyResolution","debug","assert","condition","message","Error","randomId","prefix","id","window","performance","nowOffset","Date","now","timing","navigationStart","toString","isNumeric","str","test","addClass","element","classname","timeout","Array","isArray","forEach","each","array","split","i","length","hasClass","_addClass","removeClass","_removeClass","c","classList","contains","classRegex","className","template","html","row","replace","htm","key","value","undefined","String","replaceAll","createElement","node","elem","document","attr","setAttribute","name","innerHTML","frag","createDocumentFragment","childNodes","append","RegExp","el","klass","add","trim","setTimeout","remove","klasses","cssClasses","Html","constructor","options","this","els","createControl","container","containerClass","elements","namespace","inputText","containerId","input","control","querySelector","search","result","glass","button","json","obj","Promise","resolve","reject","url","data","toQueryString","encodeUrlXhr","config","method","mode","credentials","jsonp","callback","head","script","callbackName","Math","round","random","indexOf","removeChild","fetch","then","r","catch","Object","keys","reduce","acc","k","push","encodeURIComponent","join","olControl","buttonControlId","inputQueryId","inputSearchId","hidden","icon","Photon","settings","params","q","langs","getParameters","toLowerCase","query","includes","handleResponse","results","features","map","lon","geometry","coordinates","lat","address","properties","postcode","city","state","country","original","formatted","details","OpenStreet","format","addressdetails","countrycodes","viewbox","opt","bbox","boundingbox","display_name","road","houseNumber","house_number","town","MapQuest","neighbourhood","Bing","includeNeighborhood","maxResults","resources","resourceSets","point","formattedAddress","OpenCage","countrycode","pretty","no_annotations","lng","components","Nominatim","base","Base","layerName","layer","LayerVector","source","SourceVector","displayInLayerSwitcher","newProvider","lastQuery","registeredListeners","mapClick","setListeners","openSearch","evt","stopPropagation","expanded","collapse","expand","addEventListener","target","which","keyCode","focus","parameters","firstChild","clearResults","spin","ajax","res","console","info","res_","createList","listenMapClick","li","response","ul","addressHtml","addressTemplate","chosen","place","addressObj","addressOriginal","getMap","coord_","Number","parseFloat","projection","getView","getProjection","coord","proj","transform","transformExtent","dispatchEvent","type","coordinate","feature","createFeature","fit","duration","animate","center","resolution","Feature","Point","addLayer","setStyle","setId","getSource","addFeature","building","village","blur","that","mapElement","getTargetElement","handleEvent","removeEventListener","removeAllChildren","found","getLayers","Control","$nominatim","Style","image","Icon","scale","src","$html","super","getLayer","setProvider","setPro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E,OAAOtL,KAAK4M,WAAWtB,WACxB,CAMD,WAAAuB,CAAYnS,GACVsF,KAAKD,QAAQrF,SAAWA,CACzB,CAMD,cAAAoS,CAAe3O,GACb6B,KAAKD,QAAQ5B,IAAMA,CACpB"} \ No newline at end of file +{"version":3,"file":"ol-geocoder.js","sources":["../konstants/index.js","../src/helpers/mix.js","../src/helpers/dom.js","../src/html.js","../src/helpers/ajax.js","../src/providers/photon.js","../src/providers/osm.js","../src/providers/mapquest.js","../src/providers/bing.js","../src/providers/opencage.js","../src/nominatim.js","../src/base.js"],"sourcesContent":["import * as _VARS_ from './vars.json';\n\nexport const VARS = _VARS_;\n\nexport const EVENT_TYPE = {\n ADDRESSCHOSEN: 'addresschosen',\n};\n\nexport const CONTROL_TYPE = {\n NOMINATIM: 'nominatim',\n REVERSE: 'reverse',\n};\n\nexport const TARGET_TYPE = {\n GLASS: 'glass-button',\n INPUT: 'text-input',\n};\n\nexport const FEATURE_SRC = '//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png';\n\nexport const PROVIDERS = {\n OSM: 'osm',\n MAPQUEST: 'mapquest',\n PHOTON: 'photon',\n BING: 'bing',\n OPENCAGE: 'opencage',\n};\n\nexport const DEFAULT_OPTIONS = {\n provider: PROVIDERS.OSM,\n label: '',\n placeholder: 'Search for an address',\n featureStyle: null,\n targetType: TARGET_TYPE.GLASS,\n lang: 'en-US',\n limit: 5,\n keepOpen: false,\n preventDefault: false,\n preventPanning: false,\n preventMarker: false,\n defaultFlyResolution: 10, // Meters per pixel\n debug: false,\n};","export function assert(condition, message = 'Assertion failed') {\n if (!condition) {\n if (typeof Error !== 'undefined') throw new Error(message);\n\n throw message; // Fallback\n }\n}\n\nexport function now() {\n // Polyfill for window.performance.now()\n // @license http://opensource.org/licenses/MIT\n // copyright Paul Irish 2015\n // https://gist.github.com/paulirish/5438650\n if ('performance' in window === false) {\n window.performance = {};\n }\n\n if ('now' in window.performance === false) {\n let nowOffset = Date.now();\n\n if (performance.timing && performance.timing.navigationStart) {\n nowOffset = performance.timing.navigationStart;\n }\n\n window.performance.now = () => Date.now() - nowOffset;\n }\n\n return window.performance.now();\n}\n\nexport function randomId(prefix) {\n const id = now().toString(36);\n\n return prefix ? prefix + id : id;\n}\n\nexport function isNumeric(str) {\n return /^\\d+$/u.test(str);\n}\n\nexport function isEmpty(str) {\n return !str || str.length === 0;\n}\n\nexport function emptyArray(array) {\n while (array.length) array.pop();\n}\n\nexport function anyMatchInArray(source, target) {\n return source.some((each) => target.includes(each));\n}\n\nexport function everyMatchInArray(arr1, arr2) {\n return arr2.every((each) => arr1.includes(each));\n}\n\nexport function anyItemHasValue(obj, has = false) {\n const keys = Object.keys(obj);\n\n keys.forEach((key) => {\n if (!isEmpty(obj[key])) has = true;\n });\n\n return has;\n}","/* eslint-disable prefer-named-capture-group */\nimport {\n isNumeric\n} from './mix';\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to remove a class.\n */\nexport function addClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => addClass(each, classname));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (!hasClass(element, array[i])) {\n _addClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String|Array} classname Class or array of classes.\n * For example: 'class1 class2' or ['class1', 'class2']\n * @param {Number|undefined} timeout Timeout to add a class.\n */\nexport function removeClass(element, classname, timeout) {\n if (Array.isArray(element)) {\n element.forEach((each) => removeClass(each, classname, timeout));\n\n return;\n }\n\n const array = Array.isArray(classname) ? classname : classname.split(/\\s+/u);\n\n let i = array.length;\n\n while (i--) {\n if (hasClass(element, array[i])) {\n _removeClass(element, array[i], timeout);\n }\n }\n}\n\n/**\n * @param {Element} element DOM node.\n * @param {String} classname Classname.\n * @return {Boolean}\n */\nexport function hasClass(element, c) {\n // use native if available\n return element.classList ? element.classList.contains(c) : classRegex(c).test(element.className);\n}\n\n/**\n * @param {Element|Array} element DOM node or array of nodes.\n * @param {String} classname Classe.\n */\nexport function toggleClass(element, classname) {\n if (Array.isArray(element)) {\n element.forEach((each) => toggleClass(each, classname));\n\n return;\n }\n\n // use native if available\n if (element.classList) {\n element.classList.toggle(classname);\n } else {\n hasClass(element, classname) ? _removeClass(element, classname) : _addClass(element, classname);\n }\n}\n\n/**\n * Abstraction to querySelectorAll for increased\n * performance and greater usability\n * @param {String} selector\n * @param {Element} context (optional)\n * @param {Boolean} findAll (optional)\n * @return (findAll) {Element} : {Array}\n */\nexport function $(id) {\n id = id[0] === '#' ? id.slice(1, 1 + id.length) : id;\n\n return document.getElementById(id);\n}\n\nexport function isElement(obj) {\n // DOM, Level2\n if ('HTMLElement' in window) {\n return !!obj && obj instanceof HTMLElement;\n }\n\n // Older browsers\n return !!obj && typeof obj === 'object' && obj.nodeType === 1 && !!obj.nodeName;\n}\n\nexport function getAllChildren(node, tag) {\n return [].slice.call(node.getElementsByTagName(tag));\n}\n\nexport function removeAllChildren(node) {\n while (node.firstChild) node.firstChild.remove();\n}\n\nexport function removeAll(collection) {\n let node;\n\n while ((node = collection[0])) node.remove();\n}\n\nexport function getChildren(node, tag) {\n return [].filter.call(node.childNodes, (el) =>\n tag ? el.nodeType === 1 && el.tagName.toLowerCase() === tag : el.nodeType === 1\n );\n}\n\nexport function template(html, row) {\n return html.replace(/\\{\\s*([\\w-]+)\\s*\\}/gu, (htm, key) => {\n const value = row[key] === undefined ? '' : row[key];\n\n return htmlEscape(value);\n });\n}\n\nexport function htmlEscape(str) {\n return String(str)\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"')\n .replaceAll(\"'\", ''');\n}\n\nexport function createElement(node, html) {\n let elem;\n\n if (Array.isArray(node)) {\n elem = document.createElement(node[0]);\n\n if (node[1].id) elem.id = node[1].id;\n\n if (node[1].classname) elem.className = node[1].classname;\n\n if (node[1].attr) {\n const {\n attr\n } = node[1];\n\n if (Array.isArray(attr)) {\n let i = -1;\n\n while (++i < attr.length) {\n elem.setAttribute(attr[i].name, attr[i].value);\n }\n } else {\n elem.setAttribute(attr.name, attr.value);\n }\n }\n } else {\n elem = document.createElement(node);\n }\n\n elem.innerHTML = html;\n\n const frag = document.createDocumentFragment();\n\n while (elem.childNodes[0]) frag.append(elem.childNodes[0]);\n\n elem.append(frag);\n\n return elem;\n}\n\nfunction classRegex(classname) {\n return new RegExp(`(^|\\\\s+) ${classname} (\\\\s+|$)`, 'u');\n}\n\nfunction _addClass(el, klass, timeout) {\n // use native if available\n if (el.classList) {\n el.classList.add(klass);\n } else {\n el.className = `${el.className} ${klass}`.trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _removeClass(el, klass), timeout);\n }\n}\n\nfunction _removeClass(el, klass, timeout) {\n if (el.classList) {\n el.classList.remove(klass);\n } else {\n el.className = el.className.replace(classRegex(klass), ' ').trim();\n }\n\n if (timeout && isNumeric(timeout)) {\n window.setTimeout(() => _addClass(el, klass), timeout);\n }\n}","import {\n VARS,\n TARGET_TYPE\n} from '../konstants';\n\nimport {\n createElement\n} from './helpers/dom';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Html\n */\nexport class Html {\n /**\n * @constructor\n * @param {object} options Options.\n */\n constructor(options) {\n this.options = options;\n this.els = this.createControl();\n }\n\n createControl() {\n let container;\n let containerClass;\n let elements;\n\n if (this.options.targetType === TARGET_TYPE.INPUT) {\n containerClass = `${klasses.namespace} ${klasses.inputText.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.input\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.inputText.control}`),\n label: container.querySelector(`.${klasses.inputText.label}`),\n input: container.querySelector(`.${klasses.inputText.input}`),\n search: container.querySelector(`.${klasses.inputText.search}`),\n result: container.querySelector(`.${klasses.inputText.result}`),\n };\n elements.label.innerHTML = this.options.label;\n } else {\n containerClass = `${klasses.namespace} ${klasses.glass.container}`;\n container = createElement(\n ['div', {\n id: VARS.containerId,\n classname: containerClass\n }],\n Html.glass\n );\n elements = {\n container,\n control: container.querySelector(`.${klasses.glass.control}`),\n button: container.querySelector(`.${klasses.glass.button}`),\n input: container.querySelector(`.${klasses.glass.input}`),\n search: container.querySelector(`.${klasses.glass.search}`),\n result: container.querySelector(`.${klasses.glass.result}`),\n };\n }\n\n // set placeholder from options\n elements.input.placeholder = this.options.placeholder;\n\n return elements;\n }\n}\n\nHtml.glass = `\n
                      \n \n \n \n
                      \n
                        \n`;\n\nHtml.input = `\n
                        \n \n \n \n \n
                        \n
                          \n`;","export function json(obj) {\n return new Promise((resolve, reject) => {\n const url = encodeUrlXhr(obj.url, obj.data);\n const config = {\n method: 'GET',\n mode: 'cors',\n credentials: 'same-origin',\n };\n\n if (obj.jsonp) {\n jsonp(url, obj.callbackName, resolve);\n } else {\n fetch(url, config)\n .then((r) => r.json())\n .then(resolve)\n .catch(reject);\n }\n });\n}\n\nfunction toQueryString(obj) {\n return Object.keys(obj)\n .reduce((acc, k) => {\n acc.push(\n typeof obj[k] === 'object' ?\n toQueryString(obj[k]) :\n `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`\n );\n\n return acc;\n }, [])\n .join('&');\n}\n\nfunction encodeUrlXhr(url, data) {\n if (data && typeof data === 'object') {\n url += (/\\?/u.test(url) ? '&' : '?') + toQueryString(data);\n }\n\n return url;\n}\n\nfunction jsonp(url, key, callback) {\n // https://github.com/Fresheyeball/micro-jsonp/blob/master/src/jsonp.js\n const {\n head\n } = document;\n const script = document.createElement('script');\n // generate minimally unique name for callback function\n const callbackName = `f${Math.round(Math.random() * Date.now())}`;\n\n // set request url\n script.setAttribute(\n 'src',\n // add callback parameter to the url\n // where key is the parameter key supplied\n // and callbackName is the parameter value\n `${url + (url.indexOf('?') > 0 ? '&' : '?') + key}=${callbackName}`\n );\n\n // place jsonp callback on window,\n // the script sent by the server should call this\n // function as it was passed as a url parameter\n window[callbackName] = (data) => {\n window[callbackName] = undefined;\n\n // clean up script tag created for request\n setTimeout(() => head.removeChild(script), 0);\n\n // hand data back to the user\n callback(data);\n };\n\n // actually make the request\n head.append(script);\n}","/**\n * @class Photon\n */\nexport default class Photon {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://photon.komoot.io/api/',\n\n params: {\n q: '',\n limit: 10,\n lang: 'en',\n },\n\n langs: ['de', 'it', 'fr', 'en'],\n };\n }\n\n getParameters(options) {\n options.lang = options.lang.toLowerCase();\n\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n limit: options.limit || this.settings.params.limit,\n\n lang: this.settings.langs.includes(options.lang) ? options.lang : this.settings.params.lang,\n },\n };\n }\n\n handleResponse(results) {\n if (results.features.length === 0) return [];\n\n return results.features.map((result) => ({\n lon: result.geometry.coordinates[0],\n lat: result.geometry.coordinates[1],\n\n address: {\n name: result.properties.name,\n postcode: result.properties.postcode,\n city: result.properties.city,\n state: result.properties.state,\n country: result.properties.country,\n },\n\n original: {\n formatted: result.properties.name,\n details: result.properties,\n },\n }));\n }\n}","/**\n * @class OpenStreet\n */\nexport default class OpenStreet {\n /**\n * @constructor\n */\n constructor(options) {\n this.settings = {\n url: 'https://nominatim.openstreetmap.org/search',\n ...options, // Allow custom URL for osm provider https://github.com/Dominique92/ol-geocoder/issues/266\n\n params: {\n q: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n viewbox: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(opt) {\n return {\n url: this.settings.url,\n\n params: {\n q: opt.query,\n format: this.settings.params.format,\n addressdetails: this.settings.params.addressdetails,\n limit: opt.limit || this.settings.params.limit,\n countrycodes: opt.countrycodes || this.settings.params.countrycodes,\n viewbox: opt.viewbox || this.settings.params.viewbox,\n 'accept-language': opt.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n bbox: result.boundingbox,\n\n address: {\n name: result.display_name,\n road: result.address.road || '',\n houseNumber: result.address.house_number || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class MapQuest\n */\nexport default class MapQuest {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://open.mapquestapi.com/nominatim/v1/search.php',\n\n params: {\n q: '',\n key: '',\n format: 'json',\n addressdetails: 1,\n limit: 10,\n countrycodes: '',\n 'accept-language': 'en-US',\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n format: 'json',\n addressdetails: 1,\n limit: options.limit || this.settings.params.limit,\n countrycodes: options.countrycodes || this.settings.params.countrycodes,\n\n 'accept-language': options.lang || this.settings.params['accept-language'],\n },\n };\n }\n\n handleResponse(results) {\n if (results.length === 0) return [];\n\n return results.map((result) => ({\n lon: result.lon,\n lat: result.lat,\n\n address: {\n name: result.address.neighbourhood || '',\n road: result.address.road || '',\n postcode: result.address.postcode,\n city: result.address.city || result.address.town,\n state: result.address.state,\n country: result.address.country,\n },\n\n original: {\n formatted: result.display_name,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class Bing\n */\nexport default class Bing {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://dev.virtualearth.net/REST/v1/Locations',\n callbackName: 'jsonp',\n\n params: {\n query: '',\n key: '',\n includeNeighborhood: 0,\n maxResults: 10,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n callbackName: this.settings.callbackName,\n\n params: {\n query: options.query,\n key: options.key,\n\n includeNeighborhood: options.includeNeighborhood || this.settings.params.includeNeighborhood,\n\n maxResults: options.maxResults || this.settings.params.maxResults,\n },\n };\n }\n\n handleResponse(results) {\n const {\n resources\n } = results.resourceSets[0];\n\n if (resources.length === 0) return [];\n\n return resources.map((result) => ({\n lon: result.point.coordinates[1],\n lat: result.point.coordinates[0],\n\n address: {\n name: result.name,\n },\n\n original: {\n formatted: result.address.formattedAddress,\n details: result.address,\n },\n }));\n }\n}","/**\n * @class OpenCage\n */\nexport default class OpenCage {\n /**\n * @constructor\n */\n constructor() {\n this.settings = {\n url: 'https://api.opencagedata.com/geocode/v1/json?',\n\n params: {\n q: '',\n key: '',\n limit: 10,\n countrycode: '',\n pretty: 1,\n no_annotations: 1,\n },\n };\n }\n\n getParameters(options) {\n return {\n url: this.settings.url,\n\n params: {\n q: options.query,\n key: options.key,\n limit: options.limit || this.settings.params.limit,\n countrycode: options.countrycodes || this.settings.params.countrycodes,\n },\n };\n }\n\n handleResponse(results) {\n if (results.results.length === 0) return [];\n\n return results.results.map((result) => ({\n lon: result.geometry.lng,\n lat: result.geometry.lat,\n\n address: {\n name: result.components.house_number || '',\n road: result.components.road || '',\n postcode: result.components.postcode,\n city: result.components.city || result.components.town,\n state: result.components.state,\n country: result.components.country,\n },\n\n original: {\n formatted: result.formatted,\n details: result.components,\n },\n }));\n }\n}","import LayerVector from 'ol/layer/Vector';\nimport SourceVector from 'ol/source/Vector';\nimport Point from 'ol/geom/Point';\nimport Feature from 'ol/Feature';\nimport * as proj from 'ol/proj';\n\nimport {\n VARS,\n TARGET_TYPE,\n PROVIDERS,\n EVENT_TYPE\n} from '../konstants';\nimport {\n hasClass,\n addClass,\n removeClass,\n createElement,\n template,\n removeAllChildren,\n} from './helpers/dom';\nimport {\n randomId\n} from './helpers/mix';\nimport {\n json\n} from './helpers/ajax';\n\nimport Photon from './providers/photon';\nimport OpenStreet from './providers/osm';\nimport MapQuest from './providers/mapquest';\nimport Bing from './providers/bing';\nimport OpenCage from './providers/opencage';\n\nconst klasses = VARS.cssClasses;\n\n/**\n * @class Nominatim\n */\nexport class Nominatim {\n /**\n * @constructor\n * @param {Function} base Base class.\n */\n constructor(base, els) {\n this.Base = base;\n\n this.layerName = randomId('geocoder-layer-');\n this.layer = new LayerVector({\n name: this.layerName,\n source: new SourceVector(),\n displayInLayerSwitcher: false, // Remove search layer from legend https://github.com/Dominique92/ol-geocoder/issues/256\n });\n\n this.options = base.options;\n // provider is either the name of a built-in provider as a string or an\n // object that implements the provider API\n this.options.provider =\n typeof this.options.provider === 'string' ?\n this.options.provider.toLowerCase() :\n this.options.provider;\n this.provider = this.newProvider();\n\n this.els = els;\n this.lastQuery = '';\n this.container = this.els.container;\n this.registeredListeners = {\n mapClick: false,\n };\n this.setListeners();\n }\n\n setListeners() {\n const openSearch = (evt) => {\n evt.stopPropagation();\n hasClass(this.els.control, klasses.glass.expanded) ? this.collapse() : this.expand();\n };\n const query = (evt) => {\n const value = evt.target.value.trim();\n const hit = evt.key ?\n evt.key === 'Enter' :\n evt.which ?\n evt.which === 13 :\n evt.keyCode ?\n evt.keyCode === 13 :\n false;\n\n if (hit) {\n evt.preventDefault();\n this.query(value);\n }\n };\n const stopBubbling = (evt) => evt.stopPropagation();\n const search = () => {\n this.els.input.focus();\n this.query(this.els.input.value);\n };\n const handleValue = (evt) => {\n const value = evt.target.value.trim();\n\n value.length !== 0 ?\n removeClass(this.els.search, klasses.hidden) :\n addClass(this.els.search, klasses.hidden);\n };\n\n this.els.input.addEventListener('keypress', query, false);\n this.els.input.addEventListener('click', stopBubbling, false);\n this.els.input.addEventListener('input', handleValue, false);\n this.els.search.addEventListener('click', search, false);\n\n if (this.options.targetType === TARGET_TYPE.GLASS) {\n this.els.button.addEventListener('click', openSearch, false);\n }\n }\n\n query(q) {\n // lazy provider\n if (!this.provider) {\n this.provider = this.newProvider();\n }\n\n const parameters = this.provider.getParameters({\n query: q,\n key: this.options.key,\n lang: this.options.lang,\n countrycodes: this.options.countrycodes,\n viewbox: this.options.viewbox,\n limit: this.options.limit,\n });\n\n if (this.lastQuery === q && this.els.result.firstChild) return;\n\n this.lastQuery = q;\n this.clearResults();\n addClass(this.els.search, klasses.spin);\n\n const ajax = {\n url: parameters.url,\n data: parameters.params,\n };\n\n if (parameters.callbackName) {\n ajax.jsonp = true;\n ajax.callbackName = parameters.callbackName;\n }\n\n json(ajax)\n .then((res) => {\n // eslint-disable-next-line no-console\n this.options.debug && console.info(res);\n\n removeClass(this.els.search, klasses.spin);\n\n // will be fullfiled according to provider\n const res_ = this.provider.handleResponse(res);\n\n if (res_) {\n this.createList(res_);\n this.listenMapClick();\n }\n })\n .catch(() => {\n removeClass(this.els.search, klasses.spin);\n\n const li = createElement('li', '
                          Error! No internet connection?
                          ');\n\n this.els.result.append(li);\n });\n }\n\n createList(response) {\n const ul = this.els.result;\n\n response.forEach((row) => {\n let addressHtml;\n\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n addressHtml = `${row.address.name}`;\n break;\n\n default:\n addressHtml = this.addressTemplate(row.address);\n }\n\n if (response.length == 1) {\n this.chosen(row, addressHtml, row.address, row.original);\n } else {\n const li = createElement('li', `${addressHtml}`);\n\n li.addEventListener(\n 'click',\n (evt) => {\n evt.preventDefault();\n this.chosen(row, addressHtml, row.address, row.original);\n },\n false\n );\n\n ul.append(li);\n }\n });\n }\n\n chosen(place, addressHtml, addressObj, addressOriginal) {\n const map = this.Base.getMap();\n const coord_ = [Number.parseFloat(place.lon), Number.parseFloat(place.lat)];\n const projection = map.getView().getProjection();\n const coord = proj.transform(coord_, 'EPSG:4326', projection);\n\n let {\n bbox\n } = place;\n\n if (bbox) {\n bbox = proj.transformExtent(\n // https://nominatim.org/release-docs/latest/api/Output/#boundingbox\n // Requires parseFloat on negative bbox entries\n [parseFloat(bbox[2]), parseFloat(bbox[0]), parseFloat(bbox[3]), parseFloat(bbox[1])], // SNWE -> WSEN\n 'EPSG:4326',\n projection\n );\n }\n\n const address = {\n formatted: addressHtml,\n details: addressObj,\n original: addressOriginal,\n };\n\n this.options.keepOpen === false && this.clearResults(true);\n\n if (this.options.preventDefault === true || this.options.preventMarker === true) {\n // No display change\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n coordinate: coord,\n bbox,\n place,\n });\n } else {\n // Display a marker\n const feature = this.createFeature(coord, address);\n\n this.Base.dispatchEvent({\n type: EVENT_TYPE.ADDRESSCHOSEN,\n address,\n feature,\n coordinate: coord,\n bbox,\n place,\n });\n }\n\n if (this.options.preventDefault !== true && this.options.preventPanning !== true) {\n // Move & zoom to the position\n if (bbox) {\n map.getView().fit(bbox, {\n duration: 500,\n });\n } else {\n map.getView().animate({\n center: coord,\n // ol-geocoder results are too much zoomed -in Dominique92/ol-geocoder#235\n resolution: this.options.defaultFlyResolution,\n duration: 500,\n });\n }\n }\n }\n\n createFeature(coord) {\n const feature = new Feature(new Point(coord));\n\n this.addLayer();\n feature.setStyle(this.options.featureStyle);\n feature.setId(randomId('geocoder-ft-'));\n this.getSource().addFeature(feature);\n\n return feature;\n }\n\n addressTemplate(address) {\n const html = [];\n\n if (address.name) {\n html.push(['{name}'].join(''));\n }\n\n if (address.road || address.building || address.house_number) {\n html.push(\n ['{building} {road} {house_number}'].join('')\n );\n }\n\n if (address.city || address.town || address.village) {\n html.push(\n ['{postcode} {city} {town} {village}'].join('')\n );\n }\n\n if (address.state || address.country) {\n html.push(['{state} {country}'].join(''));\n }\n\n return template(html.join('
                          '), address);\n }\n\n newProvider() {\n switch (this.options.provider) {\n case PROVIDERS.OSM:\n return new OpenStreet(this.options);\n case PROVIDERS.MAPQUEST:\n return new MapQuest();\n case PROVIDERS.PHOTON:\n return new Photon();\n case PROVIDERS.BING:\n return new Bing();\n case PROVIDERS.OPENCAGE:\n return new OpenCage();\n\n default:\n return this.options.provider;\n }\n }\n\n expand() {\n removeClass(this.els.input, klasses.spin);\n addClass(this.els.control, klasses.glass.expanded);\n window.setTimeout(() => this.els.input.focus(), 100);\n this.listenMapClick();\n }\n\n collapse() {\n this.els.input.value = '';\n this.els.input.blur();\n addClass(this.els.search, klasses.hidden);\n removeClass(this.els.control, klasses.glass.expanded);\n this.clearResults();\n }\n\n listenMapClick() {\n // already registered\n if (this.registeredListeners.mapClick) return;\n\n const that = this;\n const mapElement = this.Base.getMap().getTargetElement();\n\n this.registeredListeners.mapClick = true;\n\n // one-time fire click\n mapElement.addEventListener(\n 'click', {\n handleEvent(evt) {\n that.clearResults(true);\n mapElement.removeEventListener(evt.type, this, false);\n that.registeredListeners.mapClick = false;\n },\n },\n false\n );\n }\n\n clearResults(collapse) {\n collapse && this.options.targetType === TARGET_TYPE.GLASS ?\n this.collapse() :\n removeAllChildren(this.els.result);\n }\n\n getSource() {\n return this.layer.getSource();\n }\n\n addLayer() {\n let found = false;\n\n const map = this.Base.getMap();\n\n map.getLayers().forEach((layer) => {\n if (layer === this.layer) found = true;\n });\n\n if (!found) map.addLayer(this.layer);\n }\n}","import Control from 'ol/control/Control';\nimport Style from 'ol/style/Style';\nimport Icon from 'ol/style/Icon';\n\nimport {\n CONTROL_TYPE,\n DEFAULT_OPTIONS,\n FEATURE_SRC\n} from '../konstants';\n\nimport {\n Html\n} from './html';\nimport {\n Nominatim\n} from './nominatim';\nimport {\n assert,\n} from './helpers/mix';\n\n/**\n * @class Base\n * @extends {ol.control.Control}\n */\nexport default class Base extends Control {\n /**\n * @constructor\n * @param {string} type nominatim|reverse.\n * @param {object} options Options.\n */\n constructor(type = CONTROL_TYPE.NOMINATIM, options = {}) {\n assert(typeof type === 'string', '@param `type` should be string!');\n assert(\n type === CONTROL_TYPE.NOMINATIM || type === CONTROL_TYPE.REVERSE,\n `@param 'type' should be '${CONTROL_TYPE.NOMINATIM}'\n or '${CONTROL_TYPE.REVERSE}'!`\n );\n options = {\n ...DEFAULT_OPTIONS,\n featureStyle: [\n new Style({\n image: new Icon({\n scale: 0.7,\n src: FEATURE_SRC\n })\n }),\n ],\n ...options,\n };\n\n let container;\n\n let $nominatim;\n\n const $html = new Html(options);\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n container = $html.els.container;\n }\n\n super({\n element: container,\n ...options, // Allows to add ol.control.Control options (as target:)\n });\n\n if (!(this instanceof Base)) return new Base();\n\n this.options = options;\n this.container = container;\n\n if (type === CONTROL_TYPE.NOMINATIM) {\n $nominatim = new Nominatim(this, $html.els);\n this.layer = $nominatim.layer;\n }\n }\n\n /**\n * @return {ol.layer.Vector} Returns the layer created by this control\n */\n getLayer() {\n return this.layer;\n }\n\n /**\n * @return {ol.source.Vector} Returns the source created by this control\n */\n getSource() {\n return this.getLayer().getSource();\n }\n\n /**\n * Set a new provider\n * @param {String} provider\n */\n setProvider(provider) {\n this.options.provider = provider;\n }\n\n /**\n * Set provider key\n * @param {String} key\n */\n setProviderKey(key) {\n this.options.key = key;\n }\n}"],"names":["VARS","EVENT_TYPE","CONTROL_TYPE","TARGET_TYPE","PROVIDERS","DEFAULT_OPTIONS","provider","label","placeholder","featureStyle","targetType","lang","limit","keepOpen","preventDefault","preventPanning","preventMarker","defaultFlyResolution","debug","assert","condition","message","Error","randomId","prefix","id","window","performance","nowOffset","Date","now","timing","navigationStart","toString","isNumeric","str","test","addClass","element","classname","timeout","Array","isArray","forEach","each","array","split","i","length","hasClass","_addClass","removeClass","_removeClass","c","classList","contains","classRegex","className","template","html","row","replace","htm","key","value","undefined","String","replaceAll","createElement","node","elem","document","attr","setAttribute","name","innerHTML","frag","createDocumentFragment","childNodes","append","RegExp","el","klass","add","trim","setTimeout","remove","klasses","cssClasses","Html","constructor","options","this","els","createControl","container","containerClass","elements","namespace","inputText","containerId","input","control","querySelector","search","result","glass","button","json","obj","Promise","resolve","reject","url","data","toQueryString","encodeUrlXhr","config","method","mode","credentials","jsonp","callback","head","script","callbackName","Math","round","random","indexOf","removeChild","fetch","then","r","catch","Object","keys","reduce","acc","k","push","encodeURIComponent","join","olControl","buttonControlId","inputQueryId","inputSearchId","hidden","icon","Photon","settings","params","q","langs","getParameters","toLowerCase","query","includes","handleResponse","results","features","map","lon","geometry","coordinates","lat","address","properties","postcode","city","state","country","original","formatted","details","OpenStreet","format","addressdetails","countrycodes","viewbox","opt","bbox","boundingbox","display_name","road","houseNumber","house_number","town","MapQuest","neighbourhood","Bing","includeNeighborhood","maxResults","resources","resourceSets","point","formattedAddress","OpenCage","countrycode","pretty","no_annotations","lng","components","Nominatim","base","Base","layerName","layer","LayerVector","source","SourceVector","displayInLayerSwitcher","newProvider","lastQuery","registeredListeners","mapClick","setListeners","openSearch","evt","stopPropagation","expanded","collapse","expand","addEventListener","target","which","keyCode","focus","parameters","firstChild","clearResults","spin","ajax","res","console","info","res_","createList","listenMapClick","li","response","ul","addressHtml","addressTemplate","chosen","place","addressObj","addressOriginal","getMap","coord_","Number","parseFloat","projection","getView","getProjection","coord","proj","transform","transformExtent","dispatchEvent","type","coordinate","feature","createFeature","fit","duration","animate","center","resolution","Feature","Point","addLayer","setStyle","setId","getSource","addFeature","building","village","blur","that","mapElement","getTargetElement","handleEvent","removeEventListener","removeAllChildren","found","getLayers","Control","$nominatim","Style","image","Icon","scale","src","$html","super","getLayer","setProvider","setProviderKey"],"mappings":";;;;;;+zDAEO,MAAMA,uIAEAC,EACI,gBAGJC,EACA,YADAA,EAEF,UAGEC,EACJ,eADIA,EAEJ,aAKIC,EACN,MADMA,EAED,WAFCA,EAGH,SAHGA,EAIL,OAJKA,EAKD,WAGCC,EAAkB,CAC7BC,SAAUF,EACVG,MAAO,GACPC,YAAa,wBACbC,aAAc,KACdC,WAAYP,EACZQ,KAAM,QACNC,MAAO,EACPC,UAAU,EACVC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,qBAAsB,GACtBC,OAAO,GCzCF,SAASC,EAAOC,EAAWC,EAAU,oBAC1C,IAAKD,EAAW,CACd,GAAqB,oBAAVE,MAAuB,MAAM,IAAIA,MAAMD,GAElD,MAAMA,CACP,CACH,CAwBO,SAASE,EAASC,GACvB,MAAMC,EAvBD,WASL,GAJI,gBAAiBC,QAAW,IAC9BA,OAAOC,YAAc,IAGnB,QAASD,OAAOC,aAAgB,EAAO,CACzC,IAAIC,EAAYC,KAA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MAC/B,ECvWY,MAAMF,WAAakF,EAAAA,QAMhC,WAAArM,CAAY0K,EAAOlQ,EAAwByF,EAAU,CAAA,GAoBnD,IAAII,EAEAiM,EArBJ7Q,EAAuB,iBAATiP,EAAmB,mCACjCjP,EACEiP,IAASlQ,GAA0BkQ,IAASlQ,EAC5C,4BAA4BA,iBACtBA,OAERyF,EAAU,IACLtF,EACHI,aAAc,CACZ,IAAIwR,UAAM,CACRC,MAAO,IAAIC,EAAAA,QAAK,CACdC,MAAO,GACPC,IXzBe,4EW6BlB1M,GAOL,MAAM2M,EAAQ,IAAI7M,EAAKE,GAWvB,GATIyK,IAASlQ,IACX6F,EAAYuM,EAAMzM,IAAIE,WAGxBwM,MAAM,CACJjQ,QAASyD,KACNJ,MAGCC,gBAAgBiH,IAAO,OAAO,IAAIA,GAExCjH,KAAKD,QAAUA,EACfC,KAAKG,UAAYA,EAEbqK,IAASlQ,IACX8R,EAAa,IAAIrF,GAAU/G,KAAM0M,EAAMzM,KACvCD,KAAKmH,MAAQiF,EAAWjF,MAE3B,CAKD,QAAAyF,GACE,OAAO5M,KAAKmH,KACb,CAKD,SAAAmE,GACE,OAAOtL,KAAK4M,WAAWtB,WACxB,CAMD,WAAAuB,CAAYnS,GACVsF,KAAKD,QAAQrF,SAAWA,CACzB,CAMD,cAAAoS,CAAe3O,GACb6B,KAAKD,QAAQ5B,IAAMA,CACpB"} \ No newline at end of file diff --git a/dist/ol-geocoder.min.css b/dist/ol-geocoder.min.css index aa8d5da..b46e33c 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 11:09:17 GMT+0200 (heure d’été d’Europe centrale) + * Built: Wed Sep 13 2023 20:36:11 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/6G9strvitbFQGO8Vlx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HIrL5/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-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 diff --git a/examples/nodejs.html b/examples/nodejs.html index 22281c0..9b2e1a2 100644 --- a/examples/nodejs.html +++ b/examples/nodejs.html @@ -27,6 +27,7 @@ control-nominatim   control-glass   custom-provider   + Miscellaneous features

                          diff --git a/package-lock.json b/package-lock.json index 3599c22..811fac2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ol-geocoder", - "version": "dev", + "version": "4.3.1-dev", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ol-geocoder", - "version": "dev", + "version": "4.3.1-dev", "license": "MIT", "devDependencies": { "@babel/eslint-parser": "^7.19.1", @@ -5253,9 +5253,9 @@ } }, "node_modules/define-data-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.0.1.tgz", - "integrity": "sha512-22M+6zEspQHx10bfFQl2ET39IvfuQ7+rZIH7+ard8fCC4hPmkOSy+8JhKxBRLaWUziJ0O63NTYT97LR8zUfPTw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", "dev": true, "dependencies": { "get-intrinsic": "^1.2.1", @@ -5634,9 +5634,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.519", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.519.tgz", - "integrity": "sha512-kqs9oGYL4UFVkLKhqCTgBCYZv+wZ374yABDMqlDda9HvlkQxvSr7kgf4hfWVjMieDbX+1MwPHFBsOGCMIBaFKg==", + "version": "1.4.520", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.520.tgz", + "integrity": "sha512-Frfus2VpYADsrh1lB3v/ft/WVFlVzOIm+Q0p7U7VqHI6qr7NWHYKe+Wif3W50n7JAFoBsWVsoU0+qDks6WQ60g==", "dev": true }, "node_modules/elegant-spinner": { @@ -12397,12 +12397,13 @@ "dev": true }, "node_modules/set-function-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.0.tgz", - "integrity": "sha512-WmS8UHojv5s1eSoRSmzO5zzgDq8PE1/X/ij0k+9fMYmINCc6+j+SF3Om8YyucKn2yjnK4ItNZOoQycNnHsZJTw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", "dev": true, "dependencies": { "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.0" }, "engines": { diff --git a/src/nominatim.js b/src/nominatim.js index 4c625cb..c0456fe 100644 --- a/src/nominatim.js +++ b/src/nominatim.js @@ -176,26 +176,28 @@ export class Nominatim { switch (this.options.provider) { case PROVIDERS.OSM: addressHtml = `${row.address.name}`; - break; default: addressHtml = this.addressTemplate(row.address); } - const html = `${addressHtml}`; - const li = createElement('li', html); - - li.addEventListener( - 'click', - (evt) => { - evt.preventDefault(); - this.chosen(row, addressHtml, row.address, row.original); - }, - false - ); - - ul.append(li); + if (response.length == 1) { + this.chosen(row, addressHtml, row.address, row.original); + } else { + const li = createElement('li', `${addressHtml}`); + + li.addEventListener( + 'click', + (evt) => { + evt.preventDefault(); + this.chosen(row, addressHtml, row.address, row.original); + }, + false + ); + + ul.append(li); + } }); }