diff --git a/build/ol3-geocoder-debug.js b/build/ol3-geocoder-debug.js index c81a0d2..af043c3 100644 --- a/build/ol3-geocoder-debug.js +++ b/build/ol3-geocoder-debug.js @@ -1,8 +1,8 @@ /** * A geocoder extension for OpenLayers 3. * https://github.com/jonataswalker/ol3-geocoder - * Version: v2.1.0 - * Built: 2016-06-16T11:50:12-0300 + * Version: v2.2.0 + * Built: 2016-07-29T12:53:37-03:00 */ (function (global, factory) { @@ -69,6 +69,7 @@ MAPQUEST: 'mapquest', GOOGLE: 'google', PHOTON: 'photon', + BING: 'bing', PELIAS: 'pelias' }; @@ -109,6 +110,8 @@ }, json: function json(url, data) { var xhr = new XMLHttpRequest(), + url_ = '', + data_type = '', when = {}, onload = function () { if (xhr.status === 200) { @@ -118,17 +121,65 @@ onerror = function () { console.info('Cannot XHR ' + JSON.stringify(url)); }; - url = this.encodeUrlXhr(url, data); - xhr.open('GET', url, true); - xhr.setRequestHeader('Accept','application/json'); - xhr.onload = onload; - xhr.onerror = onerror; - xhr.send(null); + + if(typeof url === 'object') { + url_ = url.url; + data = url.data; + data_type = url.data_type || 'json'; + } else { + url_ = url; + } + + url_ = this.encodeUrlXhr(url_, data); + if (data_type === 'jsonp') { + this.jsonp(url_, url.callbackName, function(data) { + when.ready.call(undefined, data); + }); + } else { + xhr.open('GET', url_, true); + xhr.setRequestHeader('Accept','application/json'); + xhr.onload = onload; + xhr.onerror = onerror; + xhr.send(null); + } + return { - when: function ( obj ) { when.ready = obj.ready; } + when: function (obj) { when.ready = obj.ready; } }; }, + jsonp: function jsonp(url, key, callback) { + // https://github.com/Fresheyeball/micro-jsonp/blob/master/src/jsonp.js + var head = document.head, + script = document.createElement('script'), + // generate minimally unique name for callback function + callbackName = 'f' + Math.round(Math.random() * Date.now()); + + // set request url + script.setAttribute('src', + /* add callback parameter to the url + where key is the parameter key supplied + and callbackName is the parameter value */ + (url + (url.indexOf('?') > 0 ? '&' : '?') + key + '=' + callbackName)); + + /* place jsonp callback on window, + the script sent by the server should call this + function as it was passed as a url parameter */ + window[callbackName] = function(json) { + window[callbackName] = undefined; + + // clean up script tag created for request + setTimeout(function() { + head.removeChild(script); + }, 0); + + // hand data back to the user + callback(json); + }; + + // actually make the request + head.appendChild(script); + }, now: function now() { // Polyfill for window.performance.now() // @license http://opensource.org/licenses/MIT @@ -195,7 +246,7 @@ var this$1 = this; if (Array.isArray(element)) { - element.forEach(function ( each ) { this$1.addClass(each, classname) }); + element.forEach(function (each) { this$1.addClass(each, classname) }); return; } @@ -209,9 +260,9 @@ } }, _addClass: function _addClass(el, c, timeout) { - // use native if available var this$1 = this; + // use native if available if (el.classList) { el.classList.add(c); } else { @@ -232,7 +283,7 @@ var this$1 = this; if (Array.isArray(element)) { - element.forEach(function ( each ) { this$1.removeClass(each, classname, timeout) }); + element.forEach(function (each) { this$1.removeClass(each, classname, timeout) }); return; } @@ -277,7 +328,7 @@ var this$1 = this; if (Array.isArray(element)) { - element.forEach(function ( each ) { this$1.toggleClass(each, classname) }); + element.forEach(function (each) { this$1.toggleClass(each, classname) }); return; } @@ -315,16 +366,17 @@ while(array.length) array.pop(); }, anyMatchInArray: function anyMatchInArray(source, target) { - return source.some(function ( each ) { return target.indexOf(each) >= 0; }); + return source.some(function (each) { return target.indexOf(each) >= 0; }); }, everyMatchInArray: function everyMatchInArray(arr1, arr2) { - return arr2.every(function ( each ) { return arr1.indexOf(each) >= 0; }); + return arr2.every(function (each) { return arr1.indexOf(each) >= 0; }); }, anyItemHasValue: function anyItemHasValue(obj, has) { + var this$1 = this; if ( has === void 0 ) has = false; for(var key in obj) { - if(!this.isEmpty(obj[key])) { + if(!this$1.isEmpty(obj[key])) { has = true; } } @@ -342,7 +394,7 @@ } }, getChildren: function getChildren(node, tag) { - return [].filter.call(node.childNodes, function ( el ) { return tag ? + return [].filter.call(node.childNodes, function (el) { return tag ? el.nodeType == 1 && el.tagName.toLowerCase() == tag : el.nodeType == 1; }); }, template: function template(html, row) { @@ -432,7 +484,7 @@ }; - Photon.prototype.getParameters = function getParameters(options) { + Photon.prototype.getParameters = function getParameters (options) { options.lang = options.lang.toLowerCase(); return { @@ -446,8 +498,8 @@ }; }; - Photon.prototype.handleResponse = function handleResponse(results) { - return results.map(function ( result ) { return ({ + Photon.prototype.handleResponse = function handleResponse (results) { + return results.map(function (result) { return ({ lon: result.geometry.coordinates[0], lat: result.geometry.coordinates[1], address: { @@ -482,7 +534,7 @@ }; }; - OpenStreet.prototype.getParameters = function getParameters(options) { + OpenStreet.prototype.getParameters = function getParameters (options) { return { url: this.settings.url, params: { @@ -496,8 +548,8 @@ }; }; - OpenStreet.prototype.handleResponse = function handleResponse(results) { - return results.map(function ( result ) { return ({ + OpenStreet.prototype.handleResponse = function handleResponse (results) { + return results.map(function (result) { return ({ lon: result.lon, lat: result.lat, address: { @@ -534,7 +586,7 @@ }; }; - MapQuest.prototype.getParameters = function getParameters(options) { + MapQuest.prototype.getParameters = function getParameters (options) { return { url: this.settings.url, params: { @@ -549,8 +601,8 @@ }; }; - MapQuest.prototype.handleResponse = function handleResponse(results) { - return results.map(function ( result ) { return ({ + MapQuest.prototype.handleResponse = function handleResponse (results) { + return results.map(function (result) { return ({ lon: result.lon, lat: result.lat, address: { @@ -583,7 +635,7 @@ }; }; - Pelias.prototype.getParameters = function getParameters(options) { + Pelias.prototype.getParameters = function getParameters (options) { return { url: this.settings.url, params: { @@ -594,8 +646,8 @@ }; }; - Pelias.prototype.handleResponse = function handleResponse(results) { - return results.map(function ( result ) { return ({ + Pelias.prototype.handleResponse = function handleResponse (results) { + return results.map(function (result) { return ({ lon: result.geometry.coordinates[0], lat: result.geometry.coordinates[1], address: { @@ -629,7 +681,7 @@ }; }; - Google.prototype.getParameters = function getParameters(options) { + Google.prototype.getParameters = function getParameters (options) { return { url: this.settings.url, params: { @@ -640,7 +692,7 @@ }; }; - Google.prototype.handleResponse = function handleResponse(results) { + Google.prototype.handleResponse = function handleResponse (results) { var name = [ 'point_of_interest', 'establishment', @@ -661,7 +713,7 @@ /* * @param {Array} details - address_components */ - var getDetails = function ( details ) { + var getDetails = function (details) { var parts = { name: '', road: '', @@ -670,7 +722,7 @@ state: '', country: '' }; - details.forEach(function ( detail ) { + details.forEach(function (detail) { if(utils.anyMatchInArray(detail.types, name)){ parts.name = detail.long_name; } else if(utils.anyMatchInArray(detail.types, road)){ @@ -690,7 +742,7 @@ var array = []; - results.forEach(function ( result ) { + results.forEach(function (result) { var details = getDetails(result.address_components); if(utils.anyItemHasValue(details)){ array.push({ @@ -715,6 +767,50 @@ return array; }; + /** + * @class Bing + */ + var Bing = function Bing() { + this.settings = { + url: '//dev.virtualearth.net/REST/v1/Locations', + callbackName: 'jsonp', + params: { + query: '', + key: '', + includeNeighborhood: 0, + maxResults: 10 + } + }; + }; + + Bing.prototype.getParameters = function getParameters (options) { + return { + url: this.settings.url, + callbackName: this.settings.callbackName, + params: { + query: options.query, + key: options.key, + includeNeighborhood: + options.includeNeighborhood || this.settings.params.includeNeighborhood, + maxResults: options.maxResults || this.settings.params.maxResults + } + }; + }; + + Bing.prototype.handleResponse = function handleResponse (results) { + return results.map(function (result) { return ({ + lon: result.point.coordinates[1], + lat: result.point.coordinates[0], + address: { + name: result.name + }, + original: { + formatted: result.address.formattedAddress, + details: result.address + } + }); }); + }; + /** * @class Nominatim */ @@ -729,7 +825,7 @@ this.options = base.options; this.options.provider = this.options.provider.toLowerCase(); - + this.els = this.createControl(); this.container = this.els.container; this.registered_listeners = { @@ -743,11 +839,12 @@ this.MapQuest = new MapQuest(); this.Pelias = new Pelias(); this.Google = new Google(); + this.Bing = new Bing(); return this; }; - Nominatim.prototype.createControl = function createControl() { + Nominatim.prototype.createControl = function createControl () { var container = utils.createElement([ 'div', { classname: namespace + container_class } ], Nominatim.html); @@ -768,17 +865,17 @@ return elements; }; - Nominatim.prototype.setListeners = function setListeners() { - var this$1 = this; + Nominatim.prototype.setListeners = function setListeners () { + var this$1 = this; - var openSearch = function () { + var openSearch = function () { if(utils.hasClass(this$1.els.control, namespace + expanded_class)) { this$1.collapse(); } else { this$1.expand(); } }, - query = function ( evt ) { + query = function (evt) { if (evt.keyCode == 13) { //enter key evt.preventDefault(); var q = utils.htmlEscape(this$1.els.input_search.value); @@ -789,10 +886,11 @@ this.els.btn_search.addEventListener('click', openSearch, false); }; - Nominatim.prototype.query = function query(q) { - var this$1 = this; + Nominatim.prototype.query = function query (q) { + var this$1 = this; - var this_ = this, + var this_ = this, + ajax = {}, options = this.options, input = this.els.input_search, provider = this.getProvider({ @@ -807,8 +905,16 @@ this.clearResults(); utils.addClass(input, namespace + loading_class); - utils.json(provider.url, provider.params).when({ - ready: function ( response ) { + ajax.url = provider.url; + ajax.data = provider.params; + + if (options.provider === providers.BING) { + ajax.data_type = 'jsonp'; + ajax.callbackName = provider.callbackName; + } + + utils.json(ajax).when({ + ready: function (response) { if (options.debug) { console.info(response); } @@ -837,7 +943,11 @@ break; case providers.GOOGLE: response__ = response.results.length > 0 ? - this$1.Google.handleResponse(response.results) : undefined; + this$1.Google.handleResponse(response.results) : undefined; + break; + case providers.BING: + response__ = response.resourceSets[0].resources.length > 0 ? + this$1.Bing.handleResponse(response.resourceSets[0].resources) : undefined; break; } if(response__){ @@ -854,16 +964,16 @@ }); }; - Nominatim.prototype.createList = function createList(response) { - var this$1 = this; + Nominatim.prototype.createList = function createList (response) { + var this$1 = this; - var ul = this.els.result_container; - response.forEach(function ( row ) { + var ul = this.els.result_container; + response.forEach(function (row) { var address_html = this$1.addressTemplate(row.address), html = '' + address_html + '', li = utils.createElement('li', html); - li.addEventListener('click', function ( evt ) { + li.addEventListener('click', function (evt) { evt.preventDefault(); this$1.chosen(row, address_html, row.address, row.original); }, false); @@ -872,7 +982,7 @@ }); }; - Nominatim.prototype.chosen = function chosen(place, address_html, address_obj, address_original) { + Nominatim.prototype.chosen = function chosen (place, address_html, address_obj, address_original) { var map = this.Base.getMap(); var coord = ol.proj.transform([parseFloat(place.lon), parseFloat(place.lat)], 'EPSG:4326', map.getView().getProjection()); @@ -905,7 +1015,7 @@ } }; - Nominatim.prototype.createFeature = function createFeature(coord) { + Nominatim.prototype.createFeature = function createFeature (coord) { var feature = new ol.Feature(new ol.geom.Point(coord)); this.addLayer(); feature.setStyle(this.options.featureStyle); @@ -913,7 +1023,7 @@ this.getSource().addFeature(feature); }; - Nominatim.prototype.addressTemplate = function addressTemplate(address) { + Nominatim.prototype.addressTemplate = function addressTemplate (address) { var html = []; if (address.name) { html.push( @@ -941,7 +1051,7 @@ return utils.template(html.join('
'), address); }; - Nominatim.prototype.getProvider = function getProvider(options) { + Nominatim.prototype.getProvider = function getProvider (options) { var provider; switch(options.provider) { @@ -960,14 +1070,17 @@ case providers.PELIAS: provider = this.Pelias.getParameters(options); break; + case providers.BING: + provider = this.Bing.getParameters(options); + break; } return provider; }; - Nominatim.prototype.expand = function expand() { - var this$1 = this; + Nominatim.prototype.expand = function expand () { + var this$1 = this; - utils.removeClass(this.els.input_search, namespace + loading_class); + utils.removeClass(this.els.input_search, namespace + loading_class); utils.addClass(this.els.control, namespace + expanded_class); window.setTimeout(function () { this$1.els.input_search.focus(); @@ -975,14 +1088,14 @@ this.listenMapClick(); }; - Nominatim.prototype.collapse = function collapse() { + Nominatim.prototype.collapse = function collapse () { this.els.input_search.value = ''; this.els.input_search.blur(); utils.removeClass(this.els.control, namespace + expanded_class); this.clearResults(); }; - Nominatim.prototype.listenMapClick = function listenMapClick() { + Nominatim.prototype.listenMapClick = function listenMapClick () { if(this.registered_listeners.map_click) { // already registered return; @@ -1002,7 +1115,7 @@ }, false); }; - Nominatim.prototype.clearResults = function clearResults(collapse) { + Nominatim.prototype.clearResults = function clearResults (collapse) { if(collapse) { this.collapse(); } else { @@ -1010,17 +1123,17 @@ } }; - Nominatim.prototype.getSource = function getSource() { + Nominatim.prototype.getSource = function getSource () { return this.layer.getSource(); }; - Nominatim.prototype.addLayer = function addLayer() { - var this$1 = this; + Nominatim.prototype.addLayer = function addLayer () { + var this$1 = this; - var found = false; + var found = false; var map = this.Base.getMap(); - map.getLayers().forEach(function ( layer ) { + map.getLayers().forEach(function (layer) { if (layer === this$1.layer) found = true; }); if (!found) { @@ -1076,20 +1189,21 @@ }); } + if ( superclass ) Base.__proto__ = superclass; Base.prototype = Object.create( superclass && superclass.prototype ); Base.prototype.constructor = Base; /** * @return {ol.layer.Vector} Returns the layer created by this control */ - Base.prototype.getLayer = function getLayer() { + Base.prototype.getLayer = function getLayer () { return Base.Nominatim.layer; }; /** * @return {ol.source.Vector} Returns the source created by this control */ - Base.prototype.getSource = function getSource() { + Base.prototype.getSource = function getSource () { return this.getLayer().getSource(); }; diff --git a/build/ol3-geocoder.css b/build/ol3-geocoder.css index d7a3d7c..92e301a 100644 --- a/build/ol3-geocoder.css +++ b/build/ol3-geocoder.css @@ -1,8 +1,8 @@ /** * A geocoder extension for OpenLayers 3. * https://github.com/jonataswalker/ol3-geocoder - * Version: v2.1.0 - * Built: 2016-06-16T11:50:12-0300 + * Version: v2.2.0 + * Built: 2016-07-29T12:53:37-03:00 */ .ol3-geocoder-container { @@ -75,7 +75,7 @@ ul.ol3-geocoder-result { .ol3-geocoder-road { font-size: 0.875rem; - font-weight: 700; + font-weight: 500; color: #000; } .ol3-geocoder-city { diff --git a/build/ol3-geocoder.js b/build/ol3-geocoder.js index ce70324..f7afdc5 100644 --- a/build/ol3-geocoder.js +++ b/build/ol3-geocoder.js @@ -1,8 +1,8 @@ /** * A geocoder extension for OpenLayers 3. * https://github.com/jonataswalker/ol3-geocoder - * Version: v2.1.0 - * Built: 2016-06-16T11:50:12-0300 + * Version: v2.2.0 + * Built: 2016-07-29T12:53:37-03:00 */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Geocoder=t()}(this,function(){"use strict";var e="ol3-geocoder",t="-container",r="-search",n="-btn-search",s="-loading",a="-result",o="-search-expanded",i="-country",l="-city",c="-road",u="ol-control",p="form-geocoder",d="-input-search",m="gcd-input",h={ADDRESSCHOSEN:"addresschosen"},f=[new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:["data:image/png;base64,","iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAABmJLR0QA/wD/AP+gvaeT","AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AQWCiErd9Z21AAABAJJREFUWMPVm","U1oXFUUx3/3zatJx04SDOgiVUMSgrXJwpqIKy26SrKoLjQgCkIFW7otuCvdllbo1q6Epg","vNQvtx710lEFdihwpSjdikJLGJWEhrM9MyX7nPxbypwzBv5n3cqXpgmOHOuff/mzPn3Pf","ueWDBpqZnrPq1M5EUVitZ+9wPvA0cAgaALqAIbAI3gAWt5HbjvCcGXROdmp4RwDDwBfBW","iKmLwKfAqlbSiwvvJAAeAeaBWyGB8f1uAfNT0zMj/jqdjXQd8Ds+sJsguyrAe1rJb6NGX","MQAPgJ8k7QefPOAd7WSl6OAi4jAk8D3cdKqhRngda3k9bDgUSL9NLAO9GPftoEXtZIPrR","WiXyzHwwAbA8WyoFAUFMsCY0JB9wPHwxalGyH3T4RxHByo8MZEgf4+w/ZfDt9lu9n4I5T","MCeBzP8+tQL8KDAZuA7swOljh4yM5JsaKGAPGA0fABzN5sje7+PJyht/WXNxU8O/1dbK2","9ulPWn05tL/CqWP3GR8tUSgKSmVBpVJ9LxQF46MlTh27z9D+SiKdqNCBFw/jwexUnr4eg","xfwx3oe9PUYZqfyGC+eThzo4SCYTNpweLLQtuCMgcOTBTLp4B8XpBMXuqnfroGxkTIi5M","YpRNV/1yTjCQv9oHmkBXu7vRD1/s/1b2+3h+eJSDpxoa83G0w5HisbLqRCrpKClQ2XlON","F0okL/XXTyQ6sbe1h/Y7bNkWEgPU7Lmtbe3CcaDpxoS8CuaYbfcpj7mqmVXE9Ltq5qxnc","VKBjztexBl0Azgd9uZTt4spimlJZkHKqUa29Ug6UyoIri2mWsl2tNM77OlZvmIaBn4B00","6tiRfDSUIk3JwocerlIzz7DTt7hxi9dLGW7+fX2U7huYJQfAeNayduduDX9Cni/3X5sPI","HnVSPtCK9VDj/OZa3krPVbUx++J+y2FNF6tZI71s+IfhR2gNOWgU9rJXeinBUjnxGBF4A","fgWcsAN8DXgE2OnJGbIC/CHxoAXpOK/lRx1sIvn1mKTVirRO377EFnE0IfFYrudXxvkdD","bvcCvwOZGEvkgOeBB0+kwwTU9tIccClmlC8Bubj9vKQNyAPAzxHX8YCDWsnluLpOAmB84","fmIU+e1kstJ2r42OkVH/S5R2G7S0aSCsaFrHU+tZB44F3LaOa1k/l/pTzfZSQ4APwD7Wr","jmgdeA5STAttKjltsLbdwWkhSf1UjXRfxZ4M8WLs9pJe/a0HIsAeMDnQlwOaOVvPufeFD","UJLcH/H27t6EtcBDYTJrLViNdl9ubwLWG4Wv+uDUTWDb/LLlSNzSilVy1qeFYBsYHvOAP","XdBKrtrK5Y5A19lJqo8kTnZi8U6kRy0YY8BNwNgqwP+1/Q09w5giQWRk7AAAAABJRU5Er","kJggg=="].join("")})})],y={OSM:"osm",MAPQUEST:"mapquest",GOOGLE:"google",PHOTON:"photon",PELIAS:"pelias"},g={provider:y.OSM,placeholder:"Search for an address",featureStyle:f,lang:"en-US",limit:5,keepOpen:!1,preventDefault:!1,debug:!1},v={toQueryString:function(e){var t=this;return Object.keys(e).reduce(function(r,n){return r.push("object"==typeof e[n]?t.toQueryString(e[n]):encodeURIComponent(n)+"="+encodeURIComponent(e[n])),r},[]).join("&")},encodeUrlXhr:function(e,t){if(t&&"object"==typeof t){var r=this.toQueryString(t);e+=(/\?/.test(e)?"&":"?")+r}return e},json:function(e,t){var r=new XMLHttpRequest,n={},s=function(){200===r.status&&n.ready.call(void 0,JSON.parse(r.response))},a=function(){console.info("Cannot XHR "+JSON.stringify(e))};return e=this.encodeUrlXhr(e,t),r.open("GET",e,!0),r.setRequestHeader("Accept","application/json"),r.onload=s,r.onerror=a,r.send(null),{when:function(e){n.ready=e.ready}}},now:function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-e}}return window.performance.now()},flyTo:function(e,t,r,n){n=n||2.388657133911758,r=r||500;var s=e.getView(),a=ol.animation.pan({duration:r,source:s.getCenter()}),o=ol.animation.zoom({duration:r,resolution:s.getResolution()});e.beforeRender(a,o),s.setCenter(t),s.setResolution(n)},randomId:function(e){var t=this.now().toString(36);return e?e+t:t},isNumeric:function(e){return/^\d+$/.test(e)},classRegex:function(e){return new RegExp("(^|\\s+) "+e+" (\\s+|$)")},addClass:function(e,t,r){var n=this;if(Array.isArray(e))return void e.forEach(function(e){n.addClass(e,t)});for(var s=Array.isArray(t)?t:t.split(/\s+/),a=s.length;a--;)n.hasClass(e,s[a])||n._addClass(e,s[a],r)},_addClass:function(e,t,r){var n=this;e.classList?e.classList.add(t):e.className=(e.className+" "+t).trim(),r&&this.isNumeric(r)&&window.setTimeout(function(){n._removeClass(e,t)},r)},removeClass:function(e,t,r){var n=this;if(Array.isArray(e))return void e.forEach(function(e){n.removeClass(e,t,r)});for(var s=Array.isArray(t)?t:t.split(/\s+/),a=s.length;a--;)n.hasClass(e,s[a])&&n._removeClass(e,s[a],r)},_removeClass:function(e,t,r){var n=this;e.classList?e.classList.remove(t):e.className=e.className.replace(this.classRegex(t)," ").trim(),r&&this.isNumeric(r)&&window.setTimeout(function(){n._addClass(e,t)},r)},hasClass:function(e,t){return e.classList?e.classList.contains(t):this.classRegex(t).test(e.className)},toggleClass:function(e,t){var r=this;return Array.isArray(e)?void e.forEach(function(e){r.toggleClass(e,t)}):void(e.classList?e.classList.toggle(t):this.hasClass(e,t)?this._removeClass(e,t):this._addClass(e,t))},$:function(e){return e="#"===e[0]?e.substr(1,e.length):e,document.getElementById(e)},isElement:function(e){return"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&"object"==typeof e&&1===e.nodeType&&!!e.nodeName},getAllChildren:function(e,t){return[].slice.call(e.getElementsByTagName(t))},isEmpty:function(e){return!e||0===e.length},emptyArray:function(e){for(;e.length;)e.pop()},anyMatchInArray:function(e,t){return e.some(function(e){return t.indexOf(e)>=0})},everyMatchInArray:function(e,t){return t.every(function(t){return e.indexOf(t)>=0})},anyItemHasValue:function(e,t){void 0===t&&(t=!1);for(var r in e)this.isEmpty(e[r])||(t=!0);return t},removeAllChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},removeAll:function(e){for(var t;t=e[0];)t.parentNode.removeChild(t)},getChildren:function(e,t){return[].filter.call(e.childNodes,function(e){return t?1==e.nodeType&&e.tagName.toLowerCase()==t:1==e.nodeType})},template:function(e,t){var r=this;return e.replace(/\{ *([\w_-]+) *\}/g,function(e,n){var s=void 0===t[n]?"":t[n];return r.htmlEscape(s)})},htmlEscape:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},mergeOptions:function(e,t){var r={};for(var n in e)r[n]=e[n];for(var s in t)r[s]=t[s];return r},createElement:function(e,t){var r;if(Array.isArray(e)){if(r=document.createElement(e[0]),e[1].id&&(r.id=e[1].id),e[1].classname&&(r.className=e[1].classname),e[1].attr){var n=e[1].attr;if(Array.isArray(n))for(var s=-1;++s-1?e.lang:this.settings.params.lang}}},A.prototype.handleResponse=function(e){return e.map(function(e){return{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}}})};var w=function(){this.settings={url:"//nominatim.openstreetmap.org/search/",params:{q:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}};w.prototype.getParameters=function(e){return{url:this.settings.url,params:{q:e.query,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"]}}},w.prototype.handleResponse=function(e){return e.map(function(e){return{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}}})};var C=function(){this.settings={url:"//open.mapquestapi.com/nominatim/v1/search.php",params:{q:"",key:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}};C.prototype.getParameters=function(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"]}}},C.prototype.handleResponse=function(e){return e.map(function(e){return{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}}})};var S=function(){this.settings={url:"//search.mapzen.com/v1/search",params:{text:"",key:"",size:10}}};S.prototype.getParameters=function(e){return{url:this.settings.url,params:{text:e.query,key:e.key,size:e.limit||this.settings.params.size}}},S.prototype.handleResponse=function(e){return e.map(function(e){return{lon:e.geometry.coordinates[0],lat:e.geometry.coordinates[1],address:{name:e.properties.name,house_number:e.properties.housenumber,postcode:e.properties.postalcode,road:e.properties.street,city:e.properties.city,state:e.properties.region,country:e.properties.country},original:{formatted:e.properties.label,details:e.properties}}})};var E=function(){this.settings={url:"//maps.googleapis.com/maps/api/geocode/json",params:{address:"",key:"",language:"en-US"}}};E.prototype.getParameters=function(e){return{url:this.settings.url,params:{address:e.query,key:e.key,language:e.lang||this.settings.params.language}}},E.prototype.handleResponse=function(e){var t=["point_of_interest","establishment","natural_feature","airport"],r=["street_address","route","sublocality_level_5","intersection"],n=["postal_code"],s=["locality"],a=["administrative_area_level_1"],o=["country"],i=function(e){var i={name:"",road:"",postcode:"",city:"",state:"",country:""};return e.forEach(function(e){v.anyMatchInArray(e.types,t)?i.name=e.long_name:v.anyMatchInArray(e.types,r)?i.road=e.long_name:v.anyMatchInArray(e.types,n)?i.postcode=e.long_name:v.anyMatchInArray(e.types,s)?i.city=e.long_name:v.anyMatchInArray(e.types,a)?i.state=e.long_name:v.anyMatchInArray(e.types,o)&&(i.country=e.long_name)}),i},l=[];return e.forEach(function(e){var t=i(e.address_components);v.anyItemHasValue(t)&&l.push({lon:e.geometry.location.lng,lat:e.geometry.location.lat,address:{name:t.name,postcode:t.postcode,road:t.road,city:t.city,state:t.state,country:t.country},original:{formatted:e.formatted_address,details:e.address_components}})}),l};var b=function(e){return this.Base=e,this.layer_name=v.randomId("geocoder-layer-"),this.layer=new ol.layer.Vector({name:this.layer_name,source:new ol.source.Vector}),this.options=e.options,this.options.provider=this.options.provider.toLowerCase(),this.els=this.createControl(),this.container=this.els.container,this.registered_listeners={map_click:!1},this.setListeners(),this.Photon=new A,this.OpenStreet=new w,this.MapQuest=new C,this.Pelias=new S,this.Google=new E,this};b.prototype.createControl=function(){var s=v.createElement(["div",{classname:e+t}],b.html),o={container:s,control:s.querySelector("."+(e+r)),btn_search:s.querySelector("."+(e+n)),input_search:s.querySelector("."+(e+d)),result_container:s.querySelector("."+(e+a))};return o.input_search.placeholder=this.options.placeholder,o},b.prototype.setListeners=function(){var t=this,r=function(){v.hasClass(t.els.control,e+o)?t.collapse():t.expand()},n=function(e){if(13==e.keyCode){e.preventDefault();var r=v.htmlEscape(t.els.input_search.value);t.query(r)}};this.els.input_search.addEventListener("keydown",n,!1),this.els.btn_search.addEventListener("click",r,!1)},b.prototype.query=function(t){var r=this,n=this.options,a=this.els.input_search,o=this.getProvider({query:t,provider:n.provider,key:n.key,lang:n.lang,countrycodes:n.countrycodes,limit:n.limit});this.clearResults(),v.addClass(a,e+s),v.json(o.url,o.params).when({ready:function(t){n.debug&&console.info(t),v.removeClass(a,e+s);var o;switch(n.provider){case y.OSM:o=t.length>0?r.OpenStreet.handleResponse(t):void 0;break;case y.MAPQUEST:o=t.length>0?r.MapQuest.handleResponse(t):void 0;break;case y.PELIAS:o=t.features.length>0?r.Pelias.handleResponse(t.features):void 0;break;case y.PHOTON:o=t.features.length>0?r.Photon.handleResponse(t.features):void 0;break;case y.GOOGLE:o=t.results.length>0?r.Google.handleResponse(t.results):void 0}o&&(r.createList(o),r.listenMapClick())},error:function(){v.removeClass(a,e+s);var t=v.createElement("li","
Error! No internet connection?
");r.els.result_container.appendChild(t)}})},b.prototype.createList=function(e){var t=this,r=this.els.result_container;e.forEach(function(e){var n=t.addressTemplate(e.address),s=''+n+"",a=v.createElement("li",s);a.addEventListener("click",function(r){r.preventDefault(),t.chosen(e,n,e.address,e.original)},!1),r.appendChild(a)})},b.prototype.chosen=function(e,t,r,n){var s=this.Base.getMap(),a=ol.proj.transform([parseFloat(e.lon),parseFloat(e.lat)],"EPSG:4326",s.getView().getProjection()),o={formatted:t,details:r,original:n};if(this.options.keepOpen===!1&&this.clearResults(!0),this.options.preventDefault===!0)this.Base.dispatchEvent({type:h.ADDRESSCHOSEN,address:o,coordinate:a});else{v.flyTo(s,a);var i=this.createFeature(a,o);this.Base.dispatchEvent({type:h.ADDRESSCHOSEN,address:o,feature:i,coordinate:a})}},b.prototype.createFeature=function(e){var t=new ol.Feature(new ol.geom.Point(e));this.addLayer(),t.setStyle(this.options.featureStyle),t.setId(v.randomId("geocoder-ft-")),this.getSource().addFeature(t)},b.prototype.addressTemplate=function(t){var r=[];return t.name&&r.push('{name}'),(t.road||t.building||t.house_number)&&r.push('{building} {road} {house_number}'),(t.city||t.town||t.village)&&r.push('{postcode} {city} {town} {village}'),(t.state||t.country)&&r.push('{state} {country}'),v.template(r.join("
"),t)},b.prototype.getProvider=function(e){var t;switch(e.provider){case y.OSM:t=this.OpenStreet.getParameters(e);break;case y.MAPQUEST:t=this.MapQuest.getParameters(e);break;case y.PHOTON:t=this.Photon.getParameters(e);break;case y.GOOGLE:t=this.Google.getParameters(e);break;case y.PELIAS:t=this.Pelias.getParameters(e)}return t},b.prototype.expand=function(){var t=this;v.removeClass(this.els.input_search,e+s),v.addClass(this.els.control,e+o),window.setTimeout(function(){t.els.input_search.focus()},100),this.listenMapClick()},b.prototype.collapse=function(){this.els.input_search.value="",this.els.input_search.blur(),v.removeClass(this.els.control,e+o),this.clearResults()},b.prototype.listenMapClick=function(){if(!this.registered_listeners.map_click){var e=this,t=this.Base.getMap().getTargetElement();this.registered_listeners.map_click=!0,t.addEventListener("click",{handleEvent:function(r){e.clearResults(!0),t.removeEventListener(r.type,this,!1),e.registered_listeners.map_click=!1}},!1)}},b.prototype.clearResults=function(e){e?this.collapse():v.removeAllChildren(this.els.result_container)},b.prototype.getSource=function(){return this.layer.getSource()},b.prototype.addLayer=function(){var e=this,t=!1,r=this.Base.getMap();r.getLayers().forEach(function(r){r===e.layer&&(t=!0)}),t||r.addLayer(this.layer)},b.html=['
',"',"",'
',"',"","
",''].join("");var L=function(e){function t(r,n){void 0===r&&(r="nominatim"),void 0===n&&(n={}),v.assert("string"==typeof r,"@param `control_type` should be string type!"),v.assert("object"==typeof n,"@param `opt_options` should be object type!"),this.options=v.mergeOptions(g,n),t.Nominatim=new b(this),e.call(this,{element:t.Nominatim.container})}return t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getLayer=function(){return t.Nominatim.layer},t.prototype.getSource=function(){return this.getLayer().getSource()},t}(ol.control.Control);return L}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Geocoder=t()}(this,function(){"use strict";var e="ol3-geocoder",t="-container",r="-search",s="-btn-search",n="-loading",a="-result",o="-search-expanded",i="-country",l="-city",c="-road",u="ol-control",d="form-geocoder",p="-input-search",m="gcd-input",h={ADDRESSCHOSEN:"addresschosen"},f=[new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:["data:image/png;base64,","iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAABmJLR0QA/wD/AP+gvaeT","AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4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kdD","bvcCvwOZGEvkgOeBB0+kwwTU9tIccClmlC8Bubj9vKQNyAPAzxHX8YCDWsnluLpOAmB84","fmIU+e1kstJ2r42OkVH/S5R2G7S0aSCsaFrHU+tZB44F3LaOa1k/l/pTzfZSQ4APwD7Wr","jmgdeA5STAttKjltsLbdwWkhSf1UjXRfxZ4M8WLs9pJe/a0HIsAeMDnQlwOaOVvPufeFD","UJLcH/H27t6EtcBDYTJrLViNdl9ubwLWG4Wv+uDUTWDb/LLlSNzSilVy1qeFYBsYHvOAP","XdBKrtrK5Y5A19lJqo8kTnZi8U6kRy0YY8BNwNgqwP+1/Q09w5giQWRk7AAAAABJRU5Er","kJggg=="].join("")})})],g={OSM:"osm",MAPQUEST:"mapquest",GOOGLE:"google",PHOTON:"photon",BING:"bing",PELIAS:"pelias"},y={provider:g.OSM,placeholder:"Search for an address",featureStyle:f,lang:"en-US",limit:5,keepOpen:!1,preventDefault:!1,debug:!1},v={toQueryString:function(e){var t=this;return Object.keys(e).reduce(function(r,s){return r.push("object"==typeof e[s]?t.toQueryString(e[s]):encodeURIComponent(s)+"="+encodeURIComponent(e[s])),r},[]).join("&")},encodeUrlXhr:function(e,t){if(t&&"object"==typeof t){var r=this.toQueryString(t);e+=(/\?/.test(e)?"&":"?")+r}return e},json:function(e,t){var r=new XMLHttpRequest,s="",n="",a={},o=function(){200===r.status&&a.ready.call(void 0,JSON.parse(r.response))},i=function(){console.info("Cannot XHR "+JSON.stringify(e))};return"object"==typeof e?(s=e.url,t=e.data,n=e.data_type||"json"):s=e,s=this.encodeUrlXhr(s,t),"jsonp"===n?this.jsonp(s,e.callbackName,function(e){a.ready.call(void 0,e)}):(r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onload=o,r.onerror=i,r.send(null)),{when:function(e){a.ready=e.ready}}},jsonp:function(e,t,r){var s=document.head,n=document.createElement("script"),a="f"+Math.round(Math.random()*Date.now());n.setAttribute("src",e+(e.indexOf("?")>0?"&":"?")+t+"="+a),window[a]=function(e){window[a]=void 0,setTimeout(function(){s.removeChild(n)},0),r(e)},s.appendChild(n)},now:function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-e}}return window.performance.now()},flyTo:function(e,t,r,s){s=s||2.388657133911758,r=r||500;var n=e.getView(),a=ol.animation.pan({duration:r,source:n.getCenter()}),o=ol.animation.zoom({duration:r,resolution:n.getResolution()});e.beforeRender(a,o),n.setCenter(t),n.setResolution(s)},randomId:function(e){var t=this.now().toString(36);return e?e+t:t},isNumeric:function(e){return/^\d+$/.test(e)},classRegex:function(e){return new RegExp("(^|\\s+) "+e+" (\\s+|$)")},addClass:function(e,t,r){var s=this;if(Array.isArray(e))return void e.forEach(function(e){s.addClass(e,t)});for(var n=Array.isArray(t)?t:t.split(/\s+/),a=n.length;a--;)s.hasClass(e,n[a])||s._addClass(e,n[a],r)},_addClass:function(e,t,r){var s=this;e.classList?e.classList.add(t):e.className=(e.className+" "+t).trim(),r&&this.isNumeric(r)&&window.setTimeout(function(){s._removeClass(e,t)},r)},removeClass:function(e,t,r){var s=this;if(Array.isArray(e))return void e.forEach(function(e){s.removeClass(e,t,r)});for(var n=Array.isArray(t)?t:t.split(/\s+/),a=n.length;a--;)s.hasClass(e,n[a])&&s._removeClass(e,n[a],r)},_removeClass:function(e,t,r){var s=this;e.classList?e.classList.remove(t):e.className=e.className.replace(this.classRegex(t)," ").trim(),r&&this.isNumeric(r)&&window.setTimeout(function(){s._addClass(e,t)},r)},hasClass:function(e,t){return e.classList?e.classList.contains(t):this.classRegex(t).test(e.className)},toggleClass:function(e,t){var r=this;return Array.isArray(e)?void e.forEach(function(e){r.toggleClass(e,t)}):void(e.classList?e.classList.toggle(t):this.hasClass(e,t)?this._removeClass(e,t):this._addClass(e,t))},$:function(e){return e="#"===e[0]?e.substr(1,e.length):e,document.getElementById(e)},isElement:function(e){return"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&"object"==typeof e&&1===e.nodeType&&!!e.nodeName},getAllChildren:function(e,t){return[].slice.call(e.getElementsByTagName(t))},isEmpty:function(e){return!e||0===e.length},emptyArray:function(e){for(;e.length;)e.pop()},anyMatchInArray:function(e,t){return e.some(function(e){return t.indexOf(e)>=0})},everyMatchInArray:function(e,t){return t.every(function(t){return e.indexOf(t)>=0})},anyItemHasValue:function(e,t){var r=this;void 0===t&&(t=!1);for(var s in e)r.isEmpty(e[s])||(t=!0);return t},removeAllChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},removeAll:function(e){for(var t;t=e[0];)t.parentNode.removeChild(t)},getChildren:function(e,t){return[].filter.call(e.childNodes,function(e){return t?1==e.nodeType&&e.tagName.toLowerCase()==t:1==e.nodeType})},template:function(e,t){var r=this;return e.replace(/\{ *([\w_-]+) *\}/g,function(e,s){var n=void 0===t[s]?"":t[s];return r.htmlEscape(n)})},htmlEscape:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},mergeOptions:function(e,t){var r={};for(var s in e)r[s]=e[s];for(var n in t)r[n]=t[n];return r},createElement:function(e,t){var r;if(Array.isArray(e)){if(r=document.createElement(e[0]),e[1].id&&(r.id=e[1].id),e[1].classname&&(r.className=e[1].classname),e[1].attr){var s=e[1].attr;if(Array.isArray(s))for(var n=-1;++n-1?e.lang:this.settings.params.lang}}},A.prototype.handleResponse=function(e){return e.map(function(e){return{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}}})};var w=function(){this.settings={url:"//nominatim.openstreetmap.org/search/",params:{q:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}};w.prototype.getParameters=function(e){return{url:this.settings.url,params:{q:e.query,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"]}}},w.prototype.handleResponse=function(e){return e.map(function(e){return{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}}})};var C=function(){this.settings={url:"//open.mapquestapi.com/nominatim/v1/search.php",params:{q:"",key:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}};C.prototype.getParameters=function(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"]}}},C.prototype.handleResponse=function(e){return e.map(function(e){return{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}}})};var b=function(){this.settings={url:"//search.mapzen.com/v1/search",params:{text:"",key:"",size:10}}};b.prototype.getParameters=function(e){return{url:this.settings.url,params:{text:e.query,key:e.key,size:e.limit||this.settings.params.size}}},b.prototype.handleResponse=function(e){return e.map(function(e){return{lon:e.geometry.coordinates[0],lat:e.geometry.coordinates[1],address:{name:e.properties.name,house_number:e.properties.housenumber,postcode:e.properties.postalcode,road:e.properties.street,city:e.properties.city,state:e.properties.region,country:e.properties.country},original:{formatted:e.properties.label,details:e.properties}}})};var S=function(){this.settings={url:"//maps.googleapis.com/maps/api/geocode/json",params:{address:"",key:"",language:"en-US"}}};S.prototype.getParameters=function(e){return{url:this.settings.url,params:{address:e.query,key:e.key,language:e.lang||this.settings.params.language}}},S.prototype.handleResponse=function(e){var t=["point_of_interest","establishment","natural_feature","airport"],r=["street_address","route","sublocality_level_5","intersection"],s=["postal_code"],n=["locality"],a=["administrative_area_level_1"],o=["country"],i=function(e){var i={name:"",road:"",postcode:"",city:"",state:"",country:""};return e.forEach(function(e){v.anyMatchInArray(e.types,t)?i.name=e.long_name:v.anyMatchInArray(e.types,r)?i.road=e.long_name:v.anyMatchInArray(e.types,s)?i.postcode=e.long_name:v.anyMatchInArray(e.types,n)?i.city=e.long_name:v.anyMatchInArray(e.types,a)?i.state=e.long_name:v.anyMatchInArray(e.types,o)&&(i.country=e.long_name)}),i},l=[];return e.forEach(function(e){var t=i(e.address_components);v.anyItemHasValue(t)&&l.push({lon:e.geometry.location.lng,lat:e.geometry.location.lat,address:{name:t.name,postcode:t.postcode,road:t.road,city:t.city,state:t.state,country:t.country},original:{formatted:e.formatted_address,details:e.address_components}})}),l};var E=function(){this.settings={url:"//dev.virtualearth.net/REST/v1/Locations",callbackName:"jsonp",params:{query:"",key:"",includeNeighborhood:0,maxResults:10}}};E.prototype.getParameters=function(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}}},E.prototype.handleResponse=function(e){return e.map(function(e){return{lon:e.point.coordinates[1],lat:e.point.coordinates[0],address:{name:e.name},original:{formatted:e.address.formattedAddress,details:e.address}}})};var k=function(e){return this.Base=e,this.layer_name=v.randomId("geocoder-layer-"),this.layer=new ol.layer.Vector({name:this.layer_name,source:new ol.source.Vector}),this.options=e.options,this.options.provider=this.options.provider.toLowerCase(),this.els=this.createControl(),this.container=this.els.container,this.registered_listeners={map_click:!1},this.setListeners(),this.Photon=new A,this.OpenStreet=new w,this.MapQuest=new C,this.Pelias=new b,this.Google=new S,this.Bing=new E,this};k.prototype.createControl=function(){var n=v.createElement(["div",{classname:e+t}],k.html),o={container:n,control:n.querySelector("."+(e+r)),btn_search:n.querySelector("."+(e+s)),input_search:n.querySelector("."+(e+p)),result_container:n.querySelector("."+(e+a))};return o.input_search.placeholder=this.options.placeholder,o},k.prototype.setListeners=function(){var t=this,r=function(){v.hasClass(t.els.control,e+o)?t.collapse():t.expand()},s=function(e){if(13==e.keyCode){e.preventDefault();var r=v.htmlEscape(t.els.input_search.value);t.query(r)}};this.els.input_search.addEventListener("keydown",s,!1),this.els.btn_search.addEventListener("click",r,!1)},k.prototype.query=function(t){var r=this,s={},a=this.options,o=this.els.input_search,i=this.getProvider({query:t,provider:a.provider,key:a.key,lang:a.lang,countrycodes:a.countrycodes,limit:a.limit});this.clearResults(),v.addClass(o,e+n),s.url=i.url,s.data=i.params,a.provider===g.BING&&(s.data_type="jsonp",s.callbackName=i.callbackName),v.json(s).when({ready:function(t){a.debug&&console.info(t),v.removeClass(o,e+n);var s;switch(a.provider){case g.OSM:s=t.length>0?r.OpenStreet.handleResponse(t):void 0;break;case g.MAPQUEST:s=t.length>0?r.MapQuest.handleResponse(t):void 0;break;case g.PELIAS:s=t.features.length>0?r.Pelias.handleResponse(t.features):void 0;break;case g.PHOTON:s=t.features.length>0?r.Photon.handleResponse(t.features):void 0;break;case g.GOOGLE:s=t.results.length>0?r.Google.handleResponse(t.results):void 0;break;case g.BING:s=t.resourceSets[0].resources.length>0?r.Bing.handleResponse(t.resourceSets[0].resources):void 0}s&&(r.createList(s),r.listenMapClick())},error:function(){v.removeClass(o,e+n);var t=v.createElement("li","
Error! No internet connection?
");r.els.result_container.appendChild(t)}})},k.prototype.createList=function(e){var t=this,r=this.els.result_container;e.forEach(function(e){var s=t.addressTemplate(e.address),n=''+s+"",a=v.createElement("li",n);a.addEventListener("click",function(r){r.preventDefault(),t.chosen(e,s,e.address,e.original)},!1),r.appendChild(a)})},k.prototype.chosen=function(e,t,r,s){var n=this.Base.getMap(),a=ol.proj.transform([parseFloat(e.lon),parseFloat(e.lat)],"EPSG:4326",n.getView().getProjection()),o={formatted:t,details:r,original:s};if(this.options.keepOpen===!1&&this.clearResults(!0),this.options.preventDefault===!0)this.Base.dispatchEvent({type:h.ADDRESSCHOSEN,address:o,coordinate:a});else{v.flyTo(n,a);var i=this.createFeature(a,o);this.Base.dispatchEvent({type:h.ADDRESSCHOSEN,address:o,feature:i,coordinate:a})}},k.prototype.createFeature=function(e){var t=new ol.Feature(new ol.geom.Point(e));this.addLayer(),t.setStyle(this.options.featureStyle),t.setId(v.randomId("geocoder-ft-")),this.getSource().addFeature(t)},k.prototype.addressTemplate=function(t){var r=[];return t.name&&r.push('{name}'),(t.road||t.building||t.house_number)&&r.push('{building} {road} {house_number}'),(t.city||t.town||t.village)&&r.push('{postcode} {city} {town} {village}'),(t.state||t.country)&&r.push('{state} {country}'),v.template(r.join("
"),t)},k.prototype.getProvider=function(e){var t;switch(e.provider){case g.OSM:t=this.OpenStreet.getParameters(e);break;case g.MAPQUEST:t=this.MapQuest.getParameters(e);break;case g.PHOTON:t=this.Photon.getParameters(e);break;case g.GOOGLE:t=this.Google.getParameters(e);break;case g.PELIAS:t=this.Pelias.getParameters(e);break;case g.BING:t=this.Bing.getParameters(e)}return t},k.prototype.expand=function(){var t=this;v.removeClass(this.els.input_search,e+n),v.addClass(this.els.control,e+o),window.setTimeout(function(){t.els.input_search.focus()},100),this.listenMapClick()},k.prototype.collapse=function(){this.els.input_search.value="",this.els.input_search.blur(),v.removeClass(this.els.control,e+o),this.clearResults()},k.prototype.listenMapClick=function(){if(!this.registered_listeners.map_click){var e=this,t=this.Base.getMap().getTargetElement();this.registered_listeners.map_click=!0,t.addEventListener("click",{handleEvent:function(r){e.clearResults(!0),t.removeEventListener(r.type,this,!1),e.registered_listeners.map_click=!1}},!1)}},k.prototype.clearResults=function(e){e?this.collapse():v.removeAllChildren(this.els.result_container)},k.prototype.getSource=function(){return this.layer.getSource()},k.prototype.addLayer=function(){var e=this,t=!1,r=this.Base.getMap();r.getLayers().forEach(function(r){r===e.layer&&(t=!0)}),t||r.addLayer(this.layer)},k.html=['
',"',"",'
',"',"","
",''].join("");var _=function(e){function t(r,s){void 0===r&&(r="nominatim"),void 0===s&&(s={}),v.assert("string"==typeof r,"@param `control_type` should be string type!"),v.assert("object"==typeof s,"@param `opt_options` should be object type!"),this.options=v.mergeOptions(y,s),t.Nominatim=new k(this),e.call(this,{element:t.Nominatim.container})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getLayer=function(){return t.Nominatim.layer},t.prototype.getSource=function(){return this.getLayer().getSource()},t}(ol.control.Control);return _}); diff --git a/build/ol3-geocoder.min.css b/build/ol3-geocoder.min.css index 67a5874..8eae188 100644 --- a/build/ol3-geocoder.min.css +++ b/build/ol3-geocoder.min.css @@ -1,8 +1,8 @@ /** * A geocoder extension for OpenLayers 3. * https://github.com/jonataswalker/ol3-geocoder - * Version: v2.1.0 - * Built: 2016-06-16T11:50:12-0300 + * Version: v2.2.0 + * Built: 2016-07-29T12:53:37-03:00 */ -.ol3-geocoder-container{position:absolute;top:calc(.5em + 65px);left:.5em;box-sizing:border-box}.ol3-geocoder-container *,.ol3-geocoder-container ::after,.ol3-geocoder-container ::before{box-sizing:inherit}.ol3-geocoder-search{width:31px;height:31px;overflow:hidden;-webkit-transition:width .2s,height .2s;transition:width .2s,height .2s}.ol3-geocoder-search-expanded{width:220px;height:35px}.ol3-geocoder-input-search{position:absolute;top:2px;left:32px;width:180px;padding:5px;border:1px solid #ccc;font-family:inherit;font-size:.875rem}.ol3-geocoder-input-search:focus{border-color:#35b5f4}ul.ol3-geocoder-result{position:absolute;top:37px;left:32px;width:260px;max-height:300px;white-space:normal;list-style:none;padding:0;margin:0;background-color:#fff;border-radius:0 0 4px 4px;border-top:none;overflow-x:hidden;overflow-y:auto;box-shadow:0 1px 7px rgba(0,0,0,.8);-webkit-transition:max-height .3s ease-in;transition:max-height .3s ease-in}ul.ol3-geocoder-result>li{width:100%;overflow:hidden;border-bottom:1px solid #eee;padding:0;line-height:.875rem}ul.ol3-geocoder-result>li>a{display:block;text-decoration:none;padding:3px 5px}ul.ol3-geocoder-result>li>a:hover{background-color:#d4d4d4}ul.ol3-geocoder-result>li:nth-child(odd){background-color:#e0ffe0}.ol3-geocoder-road{font-size:.875rem;font-weight:700;color:#000}.ol3-geocoder-city{font-size:.75rem;font-weight:400;color:#000}.ol3-geocoder-country{font-size:.75rem;font-weight:lighter;color:#444}.ol3-geocoder-btn-search{position:absolute;width:25px;height:25px;top:2px;left:2px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAABPUlEQVQoU41SwXHCQAzUHh58eoUOIBWEDkI6oAToIKkg7iAuwakgpAIowXRACcnrzp6BzchjMx4wE/S6kW5XK60gvQghzJIkmVoqSZI9gJ9+/fINS5Cc1HX9QXIlIr/tpwcRyb33b7cIGnAIYQdg4pxbjcfj0nJ1Xc+Px+PGObdN03Q9RIAQwgpAnqbp7FKmjQGgJLlU1d2V7BjjRkQO3vvXIXarkyxVNbsCm2QR2Q0V7XOMMReRmfd+OQQubN6hYgs22ZtbnRcAtiRfLueqqmpJ8ovko6oeBq0KIWQA3gFkzrlmMafTaUEyI/mpqmbhVTRWWbRdbClPbeobQNES5KPRqOxs7DBn8K1DsAOKMZYApiTXqlrcDe4d0XN7jWeCfzt351tVle2iGalTcBd4gGDvvZ/fDe4RmCOFLe8Pr7mvEP2N9PQAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center center}.ol3-geocoder-loading{background-image:url(data:image/gif;base64,R0lGODlhFAAUAKUAAAQCBISChMTCxERCRKSipOTi5GRiZJSSlNTS1LSytPTy9CQiJHRydExOTIyKjMzKzKyqrOzq7JyanNza3Ly6vPz6/CwuLHx6fBwaHExKTGxubFRWVAQGBISGhMTGxERGRKSmpOTm5GRmZJSWlNTW1LS2tPT29CQmJHR2dFRSVIyOjMzOzKyurOzu7JyenNze3Ly+vPz+/DQyNHx+fP7+/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCQA0ACwAAAAAFAAUAAAG80CaUKgw0RAAAIJWqQyftBjEAqIpOBwF7UUpxKBM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AABQAFACFBAIEhIKExMLEREJE5OLkpKKkZGJk1NLU9PL0LCostLK0lJKUdHJ0VFJUzMrM7Ors3Nrc/Pr8NDY0vLq8FBYUjIqMTEpMrKqsbGpsnJqcfHp8xMbE5ObkpKakZGZk1NbU9Pb0NDI0tLa0dHZ0XFpczM7M7O7s3N7c/P78PDo8vL68HBocjI6MTE5MnJ6c/v7+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABvLAl1CIQLxMCoXphYoMn8wCJfOKiETO04SAglZJAEl3MhEKFKXusPkChQCH18ZxVKicKPXFYzxRGC8HH4EiIFUOBC8IIRQDJy8qGE8lSwgqChMRIB0NFAkqXkIPIgoCJ2ovJwEjoYEfRkKvra0RJhIpFhgVqFAoBxsTSbctDCy8T74OKqQnhrNeEbAoEBksrSUHJmogIgwWJHGhD8EqpyAGFgwcLx8uVU4qiSCXmS8CFYYcDBcvImUbBZZEKLGOSRcQATysK1DgSIYLznihyOChghAW1l5cyDDhGBMHGgS0CRDAEIQOEDwKAeGEA8l1mqAEAQA7);background-repeat:no-repeat;background-position:right center} \ No newline at end of file +.ol3-geocoder-container{position:absolute;top:calc(.5em + 65px);left:.5em;box-sizing:border-box}.ol3-geocoder-container *,.ol3-geocoder-container ::after,.ol3-geocoder-container ::before{box-sizing:inherit}.ol3-geocoder-search{width:31px;height:31px;overflow:hidden;-webkit-transition:width .2s,height .2s;transition:width .2s,height .2s}.ol3-geocoder-search-expanded{width:220px;height:35px}.ol3-geocoder-input-search{position:absolute;top:2px;left:32px;width:180px;padding:5px;border:1px solid #ccc;font-family:inherit;font-size:.875rem}.ol3-geocoder-input-search:focus{border-color:#35b5f4}ul.ol3-geocoder-result{position:absolute;top:37px;left:32px;width:260px;max-height:300px;white-space:normal;list-style:none;padding:0;margin:0;background-color:#fff;border-radius:0 0 4px 4px;border-top:none;overflow-x:hidden;overflow-y:auto;box-shadow:0 1px 7px rgba(0,0,0,.8);-webkit-transition:max-height .3s ease-in;transition:max-height .3s ease-in}ul.ol3-geocoder-result>li{width:100%;overflow:hidden;border-bottom:1px solid #eee;padding:0;line-height:.875rem}ul.ol3-geocoder-result>li>a{display:block;text-decoration:none;padding:3px 5px}ul.ol3-geocoder-result>li>a:hover{background-color:#d4d4d4}ul.ol3-geocoder-result>li:nth-child(odd){background-color:#e0ffe0}.ol3-geocoder-road{font-size:.875rem;font-weight:500;color:#000}.ol3-geocoder-city{font-size:.75rem;font-weight:400;color:#000}.ol3-geocoder-country{font-size:.75rem;font-weight:lighter;color:#444}.ol3-geocoder-btn-search{position:absolute;width:25px;height:25px;top:2px;left:2px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAABPUlEQVQoU41SwXHCQAzUHh58eoUOIBWEDkI6oAToIKkg7iAuwakgpAIowXRACcnrzp6BzchjMx4wE/S6kW5XK60gvQghzJIkmVoqSZI9gJ9+/fINS5Cc1HX9QXIlIr/tpwcRyb33b7cIGnAIYQdg4pxbjcfj0nJ1Xc+Px+PGObdN03Q9RIAQwgpAnqbp7FKmjQGgJLlU1d2V7BjjRkQO3vvXIXarkyxVNbsCm2QR2Q0V7XOMMReRmfd+OQQubN6hYgs22ZtbnRcAtiRfLueqqmpJ8ovko6oeBq0KIWQA3gFkzrlmMafTaUEyI/mpqmbhVTRWWbRdbClPbeobQNES5KPRqOxs7DBn8K1DsAOKMZYApiTXqlrcDe4d0XN7jWeCfzt351tVle2iGalTcBd4gGDvvZ/fDe4RmCOFLe8Pr7mvEP2N9PQAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center center}.ol3-geocoder-loading{background-image:url(data:image/gif;base64,R0lGODlhFAAUAKUAAAQCBISChMTCxERCRKSipOTi5GRiZJSSlNTS1LSytPTy9CQiJHRydExOTIyKjMzKzKyqrOzq7JyanNza3Ly6vPz6/CwuLHx6fBwaHExKTGxubFRWVAQGBISGhMTGxERGRKSmpOTm5GRmZJSWl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FxQghLq7MVKTExFgwaTqAuCBwUCSIxCy8XAaZevg4toxOvs6AVry4TDRqzLQIQayMPFxYDdKsfBCAoIZkdFiUfMicmVUYojgooEgRGFBqGHyUSMh48kEFhw5IKLRxV6TLCQAcqJkA80gDCSIVkLhp0iCBEhQohEjQ84DWkggAYnxoaMAQPQbInI4wUMGCASiYvQQAAIfkECQkALwAsAAAAABQAFACFBAIEhIKExMLEREJE5OLkpKKkZGJk1NLU9PL0LCostLK0lJKUdHJ0VFJUzMrM7Ors3Nrc/Pr8NDY0vLq8FBYUjIqMTEpMrKqsbGpsnJqcfHp8xMbE5ObkpKakZGZk1NbU9Pb0NDI0tLa0dHZ0XFpczM7M7O7s3N7c/P78PDo8vL68HBocjI6MTE5MnJ6c/v7+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABvLAl1CIQLxMCoXphYoMn8wCJfOKiETO04SAglZJAEl3MhEKFKXusPkChQCH18ZxVKicKPXFYzxRGC8HH4EiIFUOBC8IIRQDJy8qGE8lSwgqChMRIB0NFAkqXkIPIgoCJ2ovJwEjoYEfRkKvra0RJhIpFhgVqFAoBxsTSbctDCy8T74OKqQnhrNeEbAoEBksrSUHJmogIgwWJHGhD8EqpyAGFgwcLx8uVU4qiSCXmS8CFYYcDBcvImUbBZZEKLGOSRcQATysK1DgSIYLznihyOChghAW1l5cyDDhGBMHGgS0CRDAEIQOEDwKAeGEA8l1mqAEAQA7);background-repeat:no-repeat;background-position:right center} \ No newline at end of file diff --git a/package.json b/package.json index f99ed5e..750460e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ol3-geocoder", - "version": "2.1.0", + "version": "2.2.0", "description": "A geocoder extension for OpenLayers 3.", "author": "Jonatas Walker", "homepage": "https://github.com/jonataswalker/ol3-geocoder", @@ -19,22 +19,22 @@ "url": "https://github.com/jonataswalker/ol3-geocoder/issues" }, "dependencies": { - "openlayers": "^3.14.0" + "openlayers": "^3.17.1" }, "devDependencies": { - "autoprefixer": "^6.3.6", - "casperjs": "^1.1.1", - "clean-css": "^3.4.12", - "eslint": "^2.9.0", - "node-sass": "^3.4.2", - "node-sass-json-importer": "^1.0.6", - "nodemon": "^1.9.1", + "autoprefixer": "^6.3.7", + "casperjs": "^1.1.3", + "clean-css": "^3.4.19", + "eslint": "^3.1.1", + "node-sass": "^3.8.0", + "node-sass-json-importer": "^2.1.1", + "nodemon": "^1.10.0", "parallelshell": "^2.0.0", - "postcss-cli": "^2.5.1", - "rollup": "^0.26.1", - "rollup-plugin-buble": "^0.6.0", - "rollup-plugin-json": "^2.0.0", - "uglify-js": "^2.6.2" + "postcss-cli": "^2.5.2", + "rollup": "^0.34.1", + "rollup-plugin-buble": "^0.12.1", + "rollup-plugin-json": "^2.0.1", + "uglify-js": "^2.7.0" }, "eslintConfig": { "env": { @@ -52,7 +52,7 @@ "no-alert": 2, "no-caller": 2, "no-eval": 2, - "no-proto": 2, + "no-proto": "warn", "no-redeclare": 2, "valid-typeof": 2, "no-unreachable": 2, @@ -64,16 +64,10 @@ "no-undef": 2, "no-use-before-define": 2, "no-unused-vars": 1, - "strict": [ - 1, - "global" - ], + "strict": [1, "global"], "key-spacing": 0, "new-cap": 1, - "quotes": [ - 1, - "single" - ] + "quotes": [1, "single"] } } }