diff --git a/dist/extensions/citySearch.min.js b/dist/extensions/citySearch.min.js new file mode 100644 index 0000000..aa3a31c --- /dev/null +++ b/dist/extensions/citySearch.min.js @@ -0,0 +1 @@ +(function(e){function r(e){return e.match(/^\s*$/)}function i(e){return typeof e=="string"}function s(e){return typeof e=="function"}function o(e,t){if(r(e.query))return t.resolve([]);nokia.places.search.manager.findPlaces({searchTerm:e.query,useGeoLocation:e.useGeoLocation,onComplete:function(n,r){if(r!=="OK")return t.reject();var i=u(n,e),s=[];i.forEach(function(e){var n=e.position;n.onComplete=function(r,o){o==="OK"?s.push(a(r)):(delete n.onComplete,s.push(e)),s.length===i.length&&t.resolve(s)},nokia.places.search.manager.reverseGeoCode(n)})}})}function u(e,n){return e.results.items.filter(function(e){return e.category.categoryId===t}).slice(0,n.resultsLimit)}function a(e){return e.location}function f(e){if(!e||i(e))e={query:e};var t={};for(var r in n)n.hasOwnProperty(r)&&(t[r]=e[r]||n[r]);return t}var t="city-town-village",n={query:"",resultsLimit:10,useGeoLocation:!0};e.jHERE.searchCities=function(t,n,r){var i=e.Deferred(),u=i.promise();return n=s(n)?n:e.noop,r=s(r)?r:e.noop,e.jHERE._JSLALoader.load().is.done(function(){o(f(t),i)}),e.when(u).then(function(e){n(e)},function(e){r(e)}),u}})(jQuery); \ No newline at end of file diff --git a/dist/extensions/markers.min.js b/dist/extensions/markers.min.js index e7de781..078ddbd 100644 --- a/dist/extensions/markers.min.js +++ b/dist/extensions/markers.min.js @@ -1 +1 @@ -(function(e){function v(e){var t=e.target,n=t[e.type];g(n)&&n.call(this.element,m(e,t.coordinate))}function m(t,n){return e.Event(t.type,{originalEvent:t,geo:{latitude:n.latitude,longitude:n.longitude},target:t.target})}function g(e){return typeof e=="function"}var t,n,r,i,s={text:"",textColor:"#333333",fill:"#ff6347",stroke:"#333333",shape:"balloon",icon:undefined,group:"_"},o=e.proxy,u="mouse",a="click",f="drag",l="touch",c="start",h="end",p="move",d=[a,"dbl"+a,u+"up",u+"down",u+p,u+"over",u+"out",u+"enter",u+"leave","longpress",f+c,f,f+h,"resize",l+c,l+h,l+p];n=function(n,r){var i={},u=o(v,this),a=this._mc,f="Marker",l,c;this.groups=this.groups||{},c=this.groups,t=t||nokia.maps,e.each(d,function(e,t){i[t]=[u,!1,null]}),r=e.extend({},s,r),r.textPen=r.textPen||{strokeColor:r.textColor},r.pen=r.pen||{strokeColor:r.stroke},r.brush=r.brush||{color:r.fill},r.eventListener=i,r.icon||(f="Standard"+f),l=new t.map[f](n,r),c[r.group]=c[r.group]||[],c[r.group].visible=c[r.group].length===0?!0:c[r.group].visible,c[r.group].push(l),c[r.group].visible&&a.objects.add(l)},i=function(t,n){var r=this._mc,i=r.objects,s;this.groups=this.groups||{},s=this.groups,t=t instanceof Array?t:[t],e.each(t,function(e,t){n?i.addAll(s[t]||[]):i.removeAll(s[t]||[]),s[t].visible=!!n})},r=function(){this._mc.objects.clear(),this.groups={}},e.jHERE.extend("marker",n),e.jHERE.extend("markergroups",i),e.jHERE.extend("nomarkers",r)})(jQuery); \ No newline at end of file +(function(e){function m(e){var t=e.target,n=t[e.type];y(n)&&n.call(this.element,g(e,t.coordinate))}function g(t,n){return e.Event(t.type,{originalEvent:t,geo:{latitude:n.latitude,longitude:n.longitude},target:t.target})}function y(e){return typeof e=="function"}var t,n,r,i,s,o={text:"",textColor:"#333333",fill:"#ff6347",stroke:"#333333",shape:"balloon",icon:undefined,group:"_"},u=e.proxy,a="mouse",f="click",l="drag",c="touch",h="start",p="end",d="move",v=[f,"dbl"+f,a+"up",a+"down",a+d,a+"over",a+"out",a+"enter",a+"leave","longpress",l+h,l,l+p,"resize",c+h,c+p,c+d];n=function(n,r){var i={},s=u(m,this),a=this._mc,f="Marker",l,c;this.groups=this.groups||{},c=this.groups,t=t||nokia.maps,e.each(v,function(e,t){i[t]=[s,!1,null]}),r=e.extend({},o,r),r.textPen=r.textPen||{strokeColor:r.textColor},r.pen=r.pen||{strokeColor:r.stroke},r.brush=r.brush||{color:r.fill},r.eventListener=i,r.icon||(f="Standard"+f),l=new t.map[f](n,r),c[r.group]=c[r.group]||[],c[r.group].visible=c[r.group].length===0?!0:c[r.group].visible,c[r.group].push(l),c[r.group].visible&&a.objects.add(l)},i=function(t,n){var r=this._mc,i=r.objects,s;this.groups=this.groups||{},s=this.groups,t=t instanceof Array?t:[t],e.each(t,function(e,t){n?i.addAll(s[t]||[]):i.removeAll(s[t]||[]),s[t].visible=!!n})},r=function(){console.log(this.map),this._mc.objects.clear(),this.groups={}},s=function(e){if(this._mc.objects.getLength()>1){var t=this._mc.getBoundingBox();this.map.zoomTo(t,e||!1)}},e.jHERE.extend("marker",n),e.jHERE.extend("markergroups",i),e.jHERE.extend("nomarkers",r),e.jHERE.extend("zoomToMarkers",s)})(jQuery); \ No newline at end of file