diff --git a/build/Locators/ABXDPALocator.js b/build/Locators/ABXDPALocator.js index 86dc15e..d817ffd 100644 --- a/build/Locators/ABXDPALocator.js +++ b/build/Locators/ABXDPALocator.js @@ -1 +1 @@ -define(["dojo/_base/declare","./_LocatorBase","./PickListItem"],function(a,b,c){return a([b],{locatorType:"ABXDPA",resultsPickList:null,streetGrouping:["DPA_DEP_THOROUGHFARE","DPA_THOROUGHFARE","DPA_DEP_LOCALITY","DPA_LOCALITY","DPA_POST_TOWN"],premiseGrouping:["DPA_BUILDING_NAME","DPA_BUILDING_NUMBER"],streetFields:{STREET_DESCRIPTOR:"DPA_THOROUGHFARE",LOCALITY_NAME:"DPA_LOCALITY",TOWN_NAME:"DPA_POST_TOWN",ADMINISTRATIVE_AREA:"DPA_DEP_LOCALITY"},paoFields:{PAO_TEXT:"DPA_BUILDING_NAME",PAO_START_NUMBER:"DPA_BUILDING_NUMBER",PAO_START_SUFFIX:"",PAO_END_NUMBER:"",PAO_END_SUFFIX:""},saoFields:{SAO_TEXT:"DPA_SUB_BUILDING_NAME",SAO_START_NUMBER:"DPA_BUILDING_NUMBER",SAO_START_SUFFIX:"DPA_BUILDING_NAME",SAO_END_NUMBER:"",SAO_END_SUFFIX:""},_buildPicklistItem:function(a,b){return new c({SortDescription:this._getSortDescription(this._getSAOText(a,!0)),Description:this._getListLevelDescription(1,a),Addresses:[b],Level:1})}})}); \ No newline at end of file +define(["dojo/_base/declare","./_LocatorBase","./PickListItem"],function(a,b,c){return a([b],{locatorType:"ABXDPA",resultsPickList:null,streetGrouping:["DPA_DEP_THOROUGHFARE","DPA_THOROUGHFARE","DPA_DBL_DEP_LOCALITY","DPA_DEP_LOCALITY","DPA_POST_TOWN"],premiseGrouping:["DPA_BUILDING_NAME","DPA_BUILDING_NUMBER"],streetFields:{STREET_DESCRIPTOR:"DPA_THOROUGHFARE",LOCALITY_NAME:"DPA_DBL_DEP_LOCALITY",TOWN_NAME:"DPA_POST_TOWN",ADMINISTRATIVE_AREA:"DPA_DEP_LOCALITY"},paoFields:{PAO_TEXT:"DPA_BUILDING_NAME",PAO_START_NUMBER:"DPA_BUILDING_NUMBER",PAO_START_SUFFIX:"",PAO_END_NUMBER:"",PAO_END_SUFFIX:""},saoFields:{SAO_TEXT:"DPA_SUB_BUILDING_NAME",SAO_START_NUMBER:"DPA_BUILDING_NUMBER",SAO_START_SUFFIX:"DPA_BUILDING_NAME",SAO_END_NUMBER:"",SAO_END_SUFFIX:""},_buildPicklistItem:function(a,b){return new c({SortDescription:this._getSortDescription(this._getSAOText(a,!0)),Description:this._getListLevelDescription(1,a),Addresses:[b],Level:1})}})}); \ No newline at end of file diff --git a/dist/Drilldown.min.js b/dist/Drilldown.min.js index 78c426f..8acc4fa 100644 --- a/dist/Drilldown.min.js +++ b/dist/Drilldown.min.js @@ -1 +1 @@ -require({ cache: { "esriuk/dijit/Locators/PickListItem": function () {define(["dojo/_base/declare"],function(a){return a(null,{Description:"",Addresses:[],Level:0,SortDescription:"",constructor:function(b){this.Description="",this.Addresses=[],this.Level=0,this.SortDescription="",a.safeMixin(this,b)},addCandidate:function(a){this.Addresses.push(a)}})});},"esriuk/dijit/Locators/PickList": function () {define(["dojo/_base/declare"],function(a){return a(null,{PickListItems:[],constructor:function(){this.PickListItems=[]},addItem:function(a){this.PickListItems.push(a)}})});},"esriuk/dijit/Locators/_LocatorBase": function () {String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),Array.prototype.filter||(Array.prototype.filter=function(a){"use strict";var b,c,d,e,f,g=0;if(void 0===this||null===this)throw new TypeError;if(b=Object(this),c=b.length>>>0,"function"!=typeof a)throw new TypeError;for(d=[],e=arguments.length>=2?arguments[1]:void 0,g=0;c>g;g++)g in b&&(f=b[g],a.call(e,f,g,b)&&d.push(f));return d}),Object.keys||(Object.keys=function(a){var b,c=[];for(b in a)a.hasOwnProperty(b)&&c.push(b);return c});var _isNullOrEmpty=function(a){return void 0===a||null===a||""===a},_paoSaoNumberRange=function(a,b,c,d){var e="",f="";return _isNullOrEmpty(a)||(e=a+"".trim()),_isNullOrEmpty(b)||(e+=b+"".trim()),_isNullOrEmpty(c)||(f=c+"".trim()),_isNullOrEmpty(d)||(f+=d+"".trim()),_isNullOrEmpty(e)||_isNullOrEmpty(f)?e+f:e+"-"+f};define(["dojo/_base/declare","esri/tasks/locator","./PickList","./PickListItem","dojo/Deferred"],function(a,b,c,d,e){var f=function(a,b){var c,d,e=0,f=a.length,g="",h=[];for(e=0;f>e;e+=1)c=a[e],d=b[c],_isNullOrEmpty(d)||h.push(d);return h.length>0&&(g=h.join(", ")),g},g=function(a,b,c){var e,g,h,i=0,j=0;for(i=0,j=a.length;j>i;i+=1)e=a[i],g=e.attributes,h=f(c,g),h.length>0&&(b.hasOwnProperty(h)?b[h].addCandidate(e):b[h]=new d({SortDescription:h,Description:h,Addresses:[e],Level:2}))},h=function(a,b){function c(a){for(var b,c,d=new Array,e=0,f=-1,g=0;b=(c=a.charAt(e++)).charCodeAt(0);){var h=46==b||b>=48&&57>=b;h!==g&&(d[++f]="",g=h),d[f]+=c}return d}var d=c(a.toLowerCase()),e=c(b.toLowerCase());for(x=0;d[x]&&e[x];x++)if(d[x]!==e[x]){var f=Number(d[x]),g=Number(e[x]);return f==d[x]&&g==e[x]?f-g:d[x]>e[x]?1:-1}return d.length-e.length};return a([b],{locatorType:"None",streetGrouping:[],premiseGrouping:[],paoFields:{PAO_TEXT:"",PAO_START_NUMBER:"",PAO_START_SUFFIX:"",PAO_END_NUMBER:"",PAO_END_SUFFIX:""},saoFields:{SAO_TEXT:"",SAO_START_NUMBER:"",SAO_START_SUFFIX:"",SAO_END_NUMBER:"",SAO_END_SUFFIX:""},_getPAOText:function(a,b){var c="",d="",e=this.paoFields;return _isNullOrEmpty(a[e.PAO_TEXT])!==!1||b||(c=a[e.PAO_TEXT].trim()),d=_paoSaoNumberRange(a[e.PAO_START_NUMBER],a[e.PAO_START_SUFFIX],a[e.PAO_END_NUMBER],a[e.PAO_END_SUFFIX]),_isNullOrEmpty(d)===!1&&(c+=" "+d),c.trim()},_getSAOText:function(a,b){var c="",d="",e=this.saoFields;return _isNullOrEmpty(a[e.SAO_TEXT])!==!1||b||(c=a[e.SAO_TEXT].trim()),d=_paoSaoNumberRange(a[e.SAO_START_NUMBER],a[e.SAO_START_SUFFIX],a[e.SAO_END_NUMBER],a[e.SAO_END_SUFFIX]),_isNullOrEmpty(d)===!1&&(c+=" "+d),c.trim()},_geocodeHandler:function(a,b,d,e,f){var g=this;try{this.resultsPickList=new c,this._buildPickList(a).then(function(){g._successHandler([g.resultsPickList],"onAddressToLocationsComplete",d,f)})}catch(h){this._errorHandler(h,e,f)}},_getListLevelDescription:function(a,b){var c="",d=this.streetFields;switch(a){case 1:c=[this._getPAOText(b,!1),b[d.STREET_DESCRIPTOR],b[d.LOCALITY_NAME],b[d.TOWN_NAME],b[d.ADMINISTRATIVE_AREA]].filter(Boolean).join(", ");break;case 2:c=[b[d.STREET_DESCRIPTOR],b[d.LOCALITY_NAME],b[d.TOWN_NAME],b[d.ADMINISTRATIVE_AREA]].filter(Boolean).join(", ")}return c},_getSortDescription:function(a,b){var c,d=a;return _isNullOrEmpty(d)&&!_isNullOrEmpty(b)&&(d=b),c=parseInt(d),isNaN(c)?d:d.toString()},_buildPicklistItem:function(a,b){return new d({SortDescription:this._getSortDescription(this._getPAOText(a,!0),this._getPAOText(a,!1)),Description:this._getListLevelDescription(1,a),Addresses:[b],Level:1})},_buildPickList:function(a){var b,i,j,k,l,m,n,o,p=new e,q={},r={},s=0,t=0,u=new c,v=this.streetGrouping,w=this.premiseGrouping,x=function(a,b){return h(a.SortDescription,b.SortDescription)};if(!_isNullOrEmpty(a.candidates)&&a.candidates.length>0){if(b=a.candidates,g(b,q,v),0===Object.keys(q).length)for(var y=0;y1){for(r={},k=new d({Description:j,SortDescription:q[j].SortDescription}),l=q[j].Addresses,s=0,t=l.length;t>s;s+=1)o=l[s].attributes,i=f(w,o),n=null,i.length>0&&(n=l[s],n.SortDescription=this._getSortDescription(this._getSAOText(o,!1)),r.hasOwnProperty(i)?r[i].addCandidate(n):r[i]=this._buildPicklistItem(o,n));for(m in r)r.hasOwnProperty(m)&&(r[m].Addresses.sort(x),k.addCandidate(r[m]));k.Addresses.sort(x),u.addItem(k)}else u.addItem(q[j]);u.PickListItems.sort(x),this.resultsPickList=u,p.resolve()}else this.resultsPickList=u,p.resolve();return p.promise}})});},"esriuk/dijit/Locators/AGSLLPGLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"AGS_LLPG",resultsPickList:null,streetGrouping:["StreetDescriptor","LocalityName","Town","AdminArea"],premiseGrouping:["PAOText","PAONumberRange"],streetFields:{STREET_DESCRIPTOR:"StreetDescriptor",LOCALITY_NAME:"LocalityName",TOWN_NAME:"Town",ADMINISTRATIVE_AREA:"AdminArea"},paoFields:{PAO_TEXT:"PAOText",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX",PAONumberRange:"PAONumberRange"},saoFields:{SAO_TEXT:"SAOText",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX",SAONumberRange:"SAONumberRange"},constructor:function(){this.inherited(arguments)},_getPAOText:function(a,b){var c="",d="";return _isNullOrEmpty(a[this.paoFields.PAO_TEXT])!==!1||b||(c=a[this.paoFields.PAO_TEXT].trim()),d=a[this.paoFields.PAONumberRange].trim(),_isNullOrEmpty(d)===!1&&(c+=d),c.trim()},_getSAOText:function(a,b){var c="",d="";return _isNullOrEmpty(a[this.saoFields.SAO_TEXT])!==!1||b||(c=a[this.saoFields.SAO_TEXT].trim()),d=a[this.saoFields.SAONumberRange].trim(),_isNullOrEmpty(d)===!1&&(c+=d),c.trim()}})});},"esriuk/dijit/Locators/LLPGLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"LLPG",resultsPickList:null,streetGrouping:["STREET_DESCRIPTOR","LOCALITY_NAME","TOWN_NAME","ADMINISTRATIVE_AREA"],premiseGrouping:["PAO_TEXT","PAO_END_SUFFIX","PAO_END_NUMBER","PAO_START_SUFFIX","PAO_START_NUMBER"],streetFields:{STREET_DESCRIPTOR:"STREET_DESCRIPTOR",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"ADMINISTRATIVE_AREA"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX"}})});},"esriuk/dijit/Locators/ABXLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"ABX",resultsPickList:null,streetGrouping:["STREET_DESCRIPTION","LOCALITY","TOWN_NAME","ADMINISTRATIVE_AREA"],premiseGrouping:["PAO_TEXT","PAO_END_SUFFIX","PAO_END_NUMBER","PAO_START_SUFFIX","PAO_START_NUMBER"],streetFields:{STREET_DESCRIPTOR:"STREET_DESCRIPTION",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"ADMINISTRATIVE_AREA"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX"}})});},"esriuk/dijit/Locators/ABXDPALocator": function () {define(["dojo/_base/declare","./_LocatorBase","./PickListItem"],function(a,b,c){return a([b],{locatorType:"ABXDPA",resultsPickList:null,streetGrouping:["DPA_DEP_THOROUGHFARE","DPA_THOROUGHFARE","DPA_DEP_LOCALITY","DPA_LOCALITY","DPA_POST_TOWN"],premiseGrouping:["DPA_BUILDING_NAME","DPA_BUILDING_NUMBER"],streetFields:{STREET_DESCRIPTOR:"DPA_THOROUGHFARE",LOCALITY_NAME:"DPA_LOCALITY",TOWN_NAME:"DPA_POST_TOWN",ADMINISTRATIVE_AREA:"DPA_DEP_LOCALITY"},paoFields:{PAO_TEXT:"DPA_BUILDING_NAME",PAO_START_NUMBER:"DPA_BUILDING_NUMBER",PAO_START_SUFFIX:"",PAO_END_NUMBER:"",PAO_END_SUFFIX:""},saoFields:{SAO_TEXT:"DPA_SUB_BUILDING_NAME",SAO_START_NUMBER:"DPA_BUILDING_NUMBER",SAO_START_SUFFIX:"DPA_BUILDING_NAME",SAO_END_NUMBER:"",SAO_END_SUFFIX:""},_buildPicklistItem:function(a,b){return new c({SortDescription:this._getSortDescription(this._getSAOText(a,!0)),Description:this._getListLevelDescription(1,a),Addresses:[b],Level:1})}})});},"esriuk/dijit/Locators/GMSLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"GMS",resultsPickList:null,streetGrouping:["STREET_NAME","LOCALITY_NAME","TOWN_NAME","COUNTY_NAME"],premiseGrouping:["PAO_TEXT","PAO_END_SFX","PAO_END_NO","PAO_START_SFX","PAO_START_NO"],streetFields:{STREET_DESCRIPTOR:"STREET_NAME",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"COUNTY_NAME"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NO",PAO_START_SUFFIX:"PAO_START_SFX",PAO_END_NUMBER:"PAO_END_NO",PAO_END_SUFFIX:"PAO_END_SFX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NO",SAO_START_SUFFIX:"SAO_START_SFX",SAO_END_NUMBER:"SAO_END_NO",SAO_END_SUFFIX:"SAO_END_SFX"}})});},"esriuk/dijit/Locators/OSGLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"OSG",resultsPickList:null,streetGrouping:["STREET_DESCRIPTOR","LOCALITY","TOWN","ADMINISTRATIVE_AREA"],premiseGrouping:["PAO_TEXT","PAO_END_SUFFIX","PAO_END_NUMBER","PAO_START_SUFFIX","PAO_START_NUMBER"],streetFields:{STREET_DESCRIPTOR:"STREET_DESCRIPTOR",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"ADMINISTRATIVE_AREA"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX"}})});},"esriuk/dijit/Drilldown": function () {Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(d.prototype=this.prototype),e.prototype=new d,e}),define(["dojo/_base/declare","dojo/_base/lang","dijit/_Widget","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","esri/dijit/Search","dojo/dom-construct","dijit/layout/ContentPane","dijit/TitlePane","dojox/widget/TitleGroup","dojo/on","dojo/Deferred","dojo/query","dojo/dom-style","dojo/keys","dojo/NodeList-data"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=function(a){return void 0===a||null===a||""===a},q=function(a,c,d){var e=g.toDom(""+a+"");return m(e).data("result",b.mixin(c,{sourceIndex:d})),e},r=function(a,b){return!p(a)&&a.length>0&&b?""+a.length+"":""},s=function(a,b,c,d){var e=0,f=0,g=new j,k=a.Addresses;for(e=0,f=k.length;f>e;e+=1)g.addChild(new h({content:["",q(k[e].address,k[e],d)],tabindex:0}));b.addChild(new i({title:r(k,c)+""+a.Description+"",content:g,open:!1,tabindex:0}))},t=function(a){return!p(a)&&a.length>1},u=function(a,b,c){var d,e,f=0,g=0,i=new j;if(t(a.Addresses)){for(d=a.Addresses,f=0,g=d.length;g>f;f++)t(d[f].Addresses)?s(d[f],i,b,c):(e=p(d[f].address)?q(d[f].Addresses[0].address,d[f].Addresses[0],c):q(d[f].address,d[f],c),i.addChild(new h({content:["",e],tabindex:0})));i.startup()}else p(a.Addresses[0].address)?t(a.Addresses[0].Addresses)&&s(a.Addresses[0],i,b,c):i=new h({content:q(a.Addresses[0].address,a.Addresses[0],c),tabindex:0});return i},v=function(a,b){var c=0,d=0,e=new j,f=new j;for(c=0,d=a.length;d>c;c++)f.addChild(new h({content:["",q(a[c].address,a[c],b)],tabindex:0}));return e.addChild(new i({title:"Results found: "+d,content:f,open:!0,tabindex:0})),e.startup(),e},w=function(a,b,c){this.get("contentSet")===!1&&(this.set("content",u(a,b,c)),this.set("contentSet",!0))},x=function(a){var b=!1;return 1===a.length&&1===a[0].Addresses.length&&(p(a[0].Addresses[0].Addresses)&&(b=!0),p(a[0].Addresses[0].Addresses)||1!==a[0].Addresses[0].Addresses.length||(b=!0)),b};return a([c,d,e,f],{baseClass:"drilldown",widgetsInTemplate:!0,resultsElement:null,_titleGroups:[],_tabIndex:0,showCounts:!1,flatMatch:!1,erros:null,constructor:function(b){var c=this;a.safeMixin(this,b),k(this,"search-results",function(a){p(a)||p(a.errors)||(c.errors=a.errors)})},destroy:function(){this._clearPicklist(),this.inherited(arguments)},search:function(){var a=this,b=new l;return this.errors=null,this.inherited(arguments).then(function(c){a._buildPickListUi(c),b.resolve()}),b.promise},clear:function(){this._clearPicklist(),this.inherited(arguments),this.errors=null},_hydrateResults:function(a){return a.PickListItems?a:this.flatMatch?a:this.inherited(arguments)},_formatResults:function(a,b,c){var d={activeSourceIndex:b,value:c,numResults:0,numErrors:0,errors:null,results:null},e={},f={},g=0;if(a&&!p(a[0].PickListItems)){if(b===this._allIndex){for(g=0;g0){for(a=0,b=this._titleGroups.length;b>a;a++)this._titleGroups[a].destroy();this._titleGroups=[],p(this.resultsElement)||n.set(this.resultsElement,"height",0)}},_noResults:function(a){var b,c="";if(p(this.errors)||p(this.errors[this.activeSourceIndex]))this.inherited(arguments);else{switch(this.errors[this.activeSourceIndex].details[0]){case"NoMatchTooVague":c=this.value+": No match, too vague"}b=g.create("div",{className:this.css.searchNoResultsBody}),g.create("div",{className:this.css.searchNoResultsHeader,textContent:"No Results"},b),g.create("div",{className:this.css.searchNoResultsText,textContent:c},b),g.place(b,this.noResultsMenuNode,"only")}},_showNoResults:function(){this._noResults(this.value),this._showNoResultsMenu()},_isSingleResult:function(a){var b,c,d,e=0;for(d in a)a.hasOwnProperty(d)&&(e++,c=d);return 1!==e||p(a[c].PickListItems)?1===e&&this.flatMatch?1===a[c].length:!1:(b=a[c].PickListItems,x(b))},_createPremise:function(a,b,c,d,e){var f=new i({title:r(a.Addresses,b)+""+a.Description+"",open:!1,contentSet:!1});return d?(f.set("open",!0),f.set("contentSet",!0),f.set("content",u(a,b,e))):f.own(f.on("click",c.bind(f,a,b,e))),f},_createResultsContainer:function(a,b,c){var d,e,f,h;return a?(f=g.create("div",{id:b+this.sources[b].name},c,"last"),e=g.create("div",{id:b},f,"last"),h=new j(null,e),this._titleGroups.push(h),d=new j,h.addChild(new i({title:this.sources[b].name,open:!1,content:d}))):(e=g.create("div",{id:b},c,"last"),d=new j(null,e)),d},_buildPickListUi:function(a){var b,c,d,e,f=this,h=0,i=0,j=!1,n=!1,q=new l,r=function(a){e=f._hydrateResult(a.result,a.result.sourceIndex,!1),f.select(e),f._clearPicklist()};if(this._clearPicklist(),p(this.resultsElement)||g.destroy(this.resultsElement),this.resultsElement=g.create("div",{"class":"arcgisSearch searchGroup picklistResults"},this.domNode,"last"),f.activeSourceIndex!==this._allIndex&&this._isSingleResult(a))e=this.flatMatch?this._hydrateResult(a[f.activeSourceIndex][0],f.activeSourceIndex,!1):this._hydrateResult(a[f.activeSourceIndex].PickListItems[0].Addresses[0],f.activeSourceIndex,!1),this.select(e);else{if(p(a))j=!0;else{for(d in a)if(a.hasOwnProperty(d))if(p(a[d])||p(a[d].PickListItems))this.flatMatch&&!p(a[d])&&a[d].length>0?(i=a[d].length,c=this._createResultsContainer("all"===this.activeSourceIndex,d,this.resultsElement),this._titleGroups.push(c),c.addChild(v(a[d],d)),j=!1):j=a[d].length>0&&!p(this.activeSource.locator)&&!p(this.activeSource.locator.declaredClass)&&"esri.tasks.locator"===this.activeSource.locator.declaredClass.toLowerCase()?!1:!0;else if(b=a[d].PickListItems,i=b.length,i>0)for(c=this._createResultsContainer("all"===this.activeSourceIndex,d,this.resultsElement),this._titleGroups.push(c),n=!0,h=0;i>h;h+=1)c.addChild(this._createPremise(b[h],this.showCounts,w,1===i,d)),j=!1;else j=!0;q.resolve()}this.enableSuggestions||!j||n||this._showNoResults(),p(this.resultsElement)||this.enableSuggestions||(k(this.resultsElement,".drilldownResult:click",function(){var a=m(this).data()[0];r(a)}),k(this.resultsElement,"keydown",function(a){var b,c=a.charCode||a.keyCode;switch(c){case o.ENTER:case o.NUMPAD_ENTER:b=m(".drilldownResult",a.target).data()[0],r(b);break;default:return!1}}))}return q.promise}})});} } }); \ No newline at end of file +require({ cache: { "esriuk/dijit/Locators/PickListItem": function () {define(["dojo/_base/declare"],function(a){return a(null,{Description:"",Addresses:[],Level:0,SortDescription:"",constructor:function(b){this.Description="",this.Addresses=[],this.Level=0,this.SortDescription="",a.safeMixin(this,b)},addCandidate:function(a){this.Addresses.push(a)}})});},"esriuk/dijit/Locators/PickList": function () {define(["dojo/_base/declare"],function(a){return a(null,{PickListItems:[],constructor:function(){this.PickListItems=[]},addItem:function(a){this.PickListItems.push(a)}})});},"esriuk/dijit/Locators/_LocatorBase": function () {String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),Array.prototype.filter||(Array.prototype.filter=function(a){"use strict";var b,c,d,e,f,g=0;if(void 0===this||null===this)throw new TypeError;if(b=Object(this),c=b.length>>>0,"function"!=typeof a)throw new TypeError;for(d=[],e=arguments.length>=2?arguments[1]:void 0,g=0;c>g;g++)g in b&&(f=b[g],a.call(e,f,g,b)&&d.push(f));return d}),Object.keys||(Object.keys=function(a){var b,c=[];for(b in a)a.hasOwnProperty(b)&&c.push(b);return c});var _isNullOrEmpty=function(a){return void 0===a||null===a||""===a},_paoSaoNumberRange=function(a,b,c,d){var e="",f="";return _isNullOrEmpty(a)||(e=a+"".trim()),_isNullOrEmpty(b)||(e+=b+"".trim()),_isNullOrEmpty(c)||(f=c+"".trim()),_isNullOrEmpty(d)||(f+=d+"".trim()),_isNullOrEmpty(e)||_isNullOrEmpty(f)?e+f:e+"-"+f};define(["dojo/_base/declare","esri/tasks/locator","./PickList","./PickListItem","dojo/Deferred"],function(a,b,c,d,e){var f=function(a,b){var c,d,e=0,f=a.length,g="",h=[];for(e=0;f>e;e+=1)c=a[e],d=b[c],_isNullOrEmpty(d)||h.push(d);return h.length>0&&(g=h.join(", ")),g},g=function(a,b,c){var e,g,h,i=0,j=0;for(i=0,j=a.length;j>i;i+=1)e=a[i],g=e.attributes,h=f(c,g),h.length>0&&(b.hasOwnProperty(h)?b[h].addCandidate(e):b[h]=new d({SortDescription:h,Description:h,Addresses:[e],Level:2}))},h=function(a,b){function c(a){for(var b,c,d=new Array,e=0,f=-1,g=0;b=(c=a.charAt(e++)).charCodeAt(0);){var h=46==b||b>=48&&57>=b;h!==g&&(d[++f]="",g=h),d[f]+=c}return d}var d=c(a.toLowerCase()),e=c(b.toLowerCase());for(x=0;d[x]&&e[x];x++)if(d[x]!==e[x]){var f=Number(d[x]),g=Number(e[x]);return f==d[x]&&g==e[x]?f-g:d[x]>e[x]?1:-1}return d.length-e.length};return a([b],{locatorType:"None",streetGrouping:[],premiseGrouping:[],paoFields:{PAO_TEXT:"",PAO_START_NUMBER:"",PAO_START_SUFFIX:"",PAO_END_NUMBER:"",PAO_END_SUFFIX:""},saoFields:{SAO_TEXT:"",SAO_START_NUMBER:"",SAO_START_SUFFIX:"",SAO_END_NUMBER:"",SAO_END_SUFFIX:""},_getPAOText:function(a,b){var c="",d="",e=this.paoFields;return _isNullOrEmpty(a[e.PAO_TEXT])!==!1||b||(c=a[e.PAO_TEXT].trim()),d=_paoSaoNumberRange(a[e.PAO_START_NUMBER],a[e.PAO_START_SUFFIX],a[e.PAO_END_NUMBER],a[e.PAO_END_SUFFIX]),_isNullOrEmpty(d)===!1&&(c+=" "+d),c.trim()},_getSAOText:function(a,b){var c="",d="",e=this.saoFields;return _isNullOrEmpty(a[e.SAO_TEXT])!==!1||b||(c=a[e.SAO_TEXT].trim()),d=_paoSaoNumberRange(a[e.SAO_START_NUMBER],a[e.SAO_START_SUFFIX],a[e.SAO_END_NUMBER],a[e.SAO_END_SUFFIX]),_isNullOrEmpty(d)===!1&&(c+=" "+d),c.trim()},_geocodeHandler:function(a,b,d,e,f){var g=this;try{this.resultsPickList=new c,this._buildPickList(a).then(function(){g._successHandler([g.resultsPickList],"onAddressToLocationsComplete",d,f)})}catch(h){this._errorHandler(h,e,f)}},_getListLevelDescription:function(a,b){var c="",d=this.streetFields;switch(a){case 1:c=[this._getPAOText(b,!1),b[d.STREET_DESCRIPTOR],b[d.LOCALITY_NAME],b[d.TOWN_NAME],b[d.ADMINISTRATIVE_AREA]].filter(Boolean).join(", ");break;case 2:c=[b[d.STREET_DESCRIPTOR],b[d.LOCALITY_NAME],b[d.TOWN_NAME],b[d.ADMINISTRATIVE_AREA]].filter(Boolean).join(", ")}return c},_getSortDescription:function(a,b){var c,d=a;return _isNullOrEmpty(d)&&!_isNullOrEmpty(b)&&(d=b),c=parseInt(d),isNaN(c)?d:d.toString()},_buildPicklistItem:function(a,b){return new d({SortDescription:this._getSortDescription(this._getPAOText(a,!0),this._getPAOText(a,!1)),Description:this._getListLevelDescription(1,a),Addresses:[b],Level:1})},_buildPickList:function(a){var b,i,j,k,l,m,n,o,p=new e,q={},r={},s=0,t=0,u=new c,v=this.streetGrouping,w=this.premiseGrouping,x=function(a,b){return h(a.SortDescription,b.SortDescription)};if(!_isNullOrEmpty(a.candidates)&&a.candidates.length>0){if(b=a.candidates,g(b,q,v),0===Object.keys(q).length)for(var y=0;y1){for(r={},k=new d({Description:j,SortDescription:q[j].SortDescription}),l=q[j].Addresses,s=0,t=l.length;t>s;s+=1)o=l[s].attributes,i=f(w,o),n=null,i.length>0&&(n=l[s],n.SortDescription=this._getSortDescription(this._getSAOText(o,!1)),r.hasOwnProperty(i)?r[i].addCandidate(n):r[i]=this._buildPicklistItem(o,n));for(m in r)r.hasOwnProperty(m)&&(r[m].Addresses.sort(x),k.addCandidate(r[m]));k.Addresses.sort(x),u.addItem(k)}else u.addItem(q[j]);u.PickListItems.sort(x),this.resultsPickList=u,p.resolve()}else this.resultsPickList=u,p.resolve();return p.promise}})});},"esriuk/dijit/Locators/AGSLLPGLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"AGS_LLPG",resultsPickList:null,streetGrouping:["StreetDescriptor","LocalityName","Town","AdminArea"],premiseGrouping:["PAOText","PAONumberRange"],streetFields:{STREET_DESCRIPTOR:"StreetDescriptor",LOCALITY_NAME:"LocalityName",TOWN_NAME:"Town",ADMINISTRATIVE_AREA:"AdminArea"},paoFields:{PAO_TEXT:"PAOText",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX",PAONumberRange:"PAONumberRange"},saoFields:{SAO_TEXT:"SAOText",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX",SAONumberRange:"SAONumberRange"},constructor:function(){this.inherited(arguments)},_getPAOText:function(a,b){var c="",d="";return _isNullOrEmpty(a[this.paoFields.PAO_TEXT])!==!1||b||(c=a[this.paoFields.PAO_TEXT].trim()),d=a[this.paoFields.PAONumberRange].trim(),_isNullOrEmpty(d)===!1&&(c+=d),c.trim()},_getSAOText:function(a,b){var c="",d="";return _isNullOrEmpty(a[this.saoFields.SAO_TEXT])!==!1||b||(c=a[this.saoFields.SAO_TEXT].trim()),d=a[this.saoFields.SAONumberRange].trim(),_isNullOrEmpty(d)===!1&&(c+=d),c.trim()}})});},"esriuk/dijit/Locators/LLPGLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"LLPG",resultsPickList:null,streetGrouping:["STREET_DESCRIPTOR","LOCALITY_NAME","TOWN_NAME","ADMINISTRATIVE_AREA"],premiseGrouping:["PAO_TEXT","PAO_END_SUFFIX","PAO_END_NUMBER","PAO_START_SUFFIX","PAO_START_NUMBER"],streetFields:{STREET_DESCRIPTOR:"STREET_DESCRIPTOR",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"ADMINISTRATIVE_AREA"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX"}})});},"esriuk/dijit/Locators/ABXLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"ABX",resultsPickList:null,streetGrouping:["STREET_DESCRIPTION","LOCALITY","TOWN_NAME","ADMINISTRATIVE_AREA"],premiseGrouping:["PAO_TEXT","PAO_END_SUFFIX","PAO_END_NUMBER","PAO_START_SUFFIX","PAO_START_NUMBER"],streetFields:{STREET_DESCRIPTOR:"STREET_DESCRIPTION",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"ADMINISTRATIVE_AREA"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX"}})});},"esriuk/dijit/Locators/ABXDPALocator": function () {define(["dojo/_base/declare","./_LocatorBase","./PickListItem"],function(a,b,c){return a([b],{locatorType:"ABXDPA",resultsPickList:null,streetGrouping:["DPA_DEP_THOROUGHFARE","DPA_THOROUGHFARE","DPA_DBL_DEP_LOCALITY","DPA_DEP_LOCALITY","DPA_POST_TOWN"],premiseGrouping:["DPA_BUILDING_NAME","DPA_BUILDING_NUMBER"],streetFields:{STREET_DESCRIPTOR:"DPA_THOROUGHFARE",LOCALITY_NAME:"DPA_DBL_DEP_LOCALITY",TOWN_NAME:"DPA_POST_TOWN",ADMINISTRATIVE_AREA:"DPA_DEP_LOCALITY"},paoFields:{PAO_TEXT:"DPA_BUILDING_NAME",PAO_START_NUMBER:"DPA_BUILDING_NUMBER",PAO_START_SUFFIX:"",PAO_END_NUMBER:"",PAO_END_SUFFIX:""},saoFields:{SAO_TEXT:"DPA_SUB_BUILDING_NAME",SAO_START_NUMBER:"DPA_BUILDING_NUMBER",SAO_START_SUFFIX:"DPA_BUILDING_NAME",SAO_END_NUMBER:"",SAO_END_SUFFIX:""},_buildPicklistItem:function(a,b){return new c({SortDescription:this._getSortDescription(this._getSAOText(a,!0)),Description:this._getListLevelDescription(1,a),Addresses:[b],Level:1})}})});},"esriuk/dijit/Locators/GMSLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"GMS",resultsPickList:null,streetGrouping:["STREET_NAME","LOCALITY_NAME","TOWN_NAME","COUNTY_NAME"],premiseGrouping:["PAO_TEXT","PAO_END_SFX","PAO_END_NO","PAO_START_SFX","PAO_START_NO"],streetFields:{STREET_DESCRIPTOR:"STREET_NAME",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"COUNTY_NAME"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NO",PAO_START_SUFFIX:"PAO_START_SFX",PAO_END_NUMBER:"PAO_END_NO",PAO_END_SUFFIX:"PAO_END_SFX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NO",SAO_START_SUFFIX:"SAO_START_SFX",SAO_END_NUMBER:"SAO_END_NO",SAO_END_SUFFIX:"SAO_END_SFX"}})});},"esriuk/dijit/Locators/OSGLocator": function () {define(["dojo/_base/declare","./_LocatorBase"],function(a,b){return a([b],{locatorType:"OSG",resultsPickList:null,streetGrouping:["STREET_DESCRIPTOR","LOCALITY","TOWN","ADMINISTRATIVE_AREA"],premiseGrouping:["PAO_TEXT","PAO_END_SUFFIX","PAO_END_NUMBER","PAO_START_SUFFIX","PAO_START_NUMBER"],streetFields:{STREET_DESCRIPTOR:"STREET_DESCRIPTOR",LOCALITY_NAME:"LOCALITY_NAME",TOWN_NAME:"TOWN_NAME",ADMINISTRATIVE_AREA:"ADMINISTRATIVE_AREA"},paoFields:{PAO_TEXT:"PAO_TEXT",PAO_START_NUMBER:"PAO_START_NUMBER",PAO_START_SUFFIX:"PAO_START_SUFFIX",PAO_END_NUMBER:"PAO_END_NUMBER",PAO_END_SUFFIX:"PAO_END_SUFFIX"},saoFields:{SAO_TEXT:"SAO_TEXT",SAO_START_NUMBER:"SAO_START_NUMBER",SAO_START_SUFFIX:"SAO_START_SUFFIX",SAO_END_NUMBER:"SAO_END_NUMBER",SAO_END_SUFFIX:"SAO_END_SUFFIX"}})});},"esriuk/dijit/Drilldown": function () {Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(d.prototype=this.prototype),e.prototype=new d,e}),define(["dojo/_base/declare","dojo/_base/lang","dijit/_Widget","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","esri/dijit/Search","dojo/dom-construct","dijit/layout/ContentPane","dijit/TitlePane","dojox/widget/TitleGroup","dojo/on","dojo/Deferred","dojo/query","dojo/dom-style","dojo/keys","dojo/NodeList-data"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=function(a){return void 0===a||null===a||""===a},q=function(a,c,d){var e=g.toDom(""+a+"");return m(e).data("result",b.mixin(c,{sourceIndex:d})),e},r=function(a,b){return!p(a)&&a.length>0&&b?""+a.length+"":""},s=function(a,b,c,d){var e=0,f=0,g=new j,k=a.Addresses;for(e=0,f=k.length;f>e;e+=1)g.addChild(new h({content:["",q(k[e].address,k[e],d)],tabindex:0}));b.addChild(new i({title:r(k,c)+""+a.Description+"",content:g,open:!1,tabindex:0}))},t=function(a){return!p(a)&&a.length>1},u=function(a,b,c){var d,e,f=0,g=0,i=new j;if(t(a.Addresses)){for(d=a.Addresses,f=0,g=d.length;g>f;f++)t(d[f].Addresses)?s(d[f],i,b,c):(e=p(d[f].address)?q(d[f].Addresses[0].address,d[f].Addresses[0],c):q(d[f].address,d[f],c),i.addChild(new h({content:["",e],tabindex:0})));i.startup()}else p(a.Addresses[0].address)?t(a.Addresses[0].Addresses)&&s(a.Addresses[0],i,b,c):i=new h({content:q(a.Addresses[0].address,a.Addresses[0],c),tabindex:0});return i},v=function(a,b){var c=0,d=0,e=new j,f=new j;for(c=0,d=a.length;d>c;c++)f.addChild(new h({content:["",q(a[c].address,a[c],b)],tabindex:0}));return e.addChild(new i({title:"Results found: "+d,content:f,open:!0,tabindex:0})),e.startup(),e},w=function(a,b,c){this.get("contentSet")===!1&&(this.set("content",u(a,b,c)),this.set("contentSet",!0))},x=function(a){var b=!1;return 1===a.length&&1===a[0].Addresses.length&&(p(a[0].Addresses[0].Addresses)&&(b=!0),p(a[0].Addresses[0].Addresses)||1!==a[0].Addresses[0].Addresses.length||(b=!0)),b};return a([c,d,e,f],{baseClass:"drilldown",widgetsInTemplate:!0,resultsElement:null,_titleGroups:[],_tabIndex:0,showCounts:!1,flatMatch:!1,erros:null,constructor:function(b){var c=this;a.safeMixin(this,b),k(this,"search-results",function(a){p(a)||p(a.errors)||(c.errors=a.errors)})},destroy:function(){this._clearPicklist(),this.inherited(arguments)},search:function(){var a=this,b=new l;return this.errors=null,this.inherited(arguments).then(function(c){a._buildPickListUi(c),b.resolve()}),b.promise},clear:function(){this._clearPicklist(),this.inherited(arguments),this.errors=null},_hydrateResults:function(a){return a.PickListItems?a:this.flatMatch?a:this.inherited(arguments)},_formatResults:function(a,b,c){var d={activeSourceIndex:b,value:c,numResults:0,numErrors:0,errors:null,results:null},e={},f={},g=0;if(a&&!p(a[0].PickListItems)){if(b===this._allIndex){for(g=0;g0){for(a=0,b=this._titleGroups.length;b>a;a++)this._titleGroups[a].destroy();this._titleGroups=[],p(this.resultsElement)||n.set(this.resultsElement,"height",0)}},_noResults:function(a){var b,c="";if(p(this.errors)||p(this.errors[this.activeSourceIndex]))this.inherited(arguments);else{switch(this.errors[this.activeSourceIndex].details[0]){case"NoMatchTooVague":c=this.value+": No match, too vague"}b=g.create("div",{className:this.css.searchNoResultsBody}),g.create("div",{className:this.css.searchNoResultsHeader,textContent:"No Results"},b),g.create("div",{className:this.css.searchNoResultsText,textContent:c},b),g.place(b,this.noResultsMenuNode,"only")}},_showNoResults:function(){this._noResults(this.value),this._showNoResultsMenu()},_isSingleResult:function(a){var b,c,d,e=0;for(d in a)a.hasOwnProperty(d)&&(e++,c=d);return 1!==e||p(a[c].PickListItems)?1===e&&this.flatMatch?1===a[c].length:!1:(b=a[c].PickListItems,x(b))},_createPremise:function(a,b,c,d,e){var f=new i({title:r(a.Addresses,b)+""+a.Description+"",open:!1,contentSet:!1});return d?(f.set("open",!0),f.set("contentSet",!0),f.set("content",u(a,b,e))):f.own(f.on("click",c.bind(f,a,b,e))),f},_createResultsContainer:function(a,b,c){var d,e,f,h;return a?(f=g.create("div",{id:b+this.sources[b].name},c,"last"),e=g.create("div",{id:b},f,"last"),h=new j(null,e),this._titleGroups.push(h),d=new j,h.addChild(new i({title:this.sources[b].name,open:!1,content:d}))):(e=g.create("div",{id:b},c,"last"),d=new j(null,e)),d},_buildPickListUi:function(a){var b,c,d,e,f=this,h=0,i=0,j=!1,n=!1,q=new l,r=function(a){e=f._hydrateResult(a.result,a.result.sourceIndex,!1),f.select(e),f._clearPicklist()};if(this._clearPicklist(),p(this.resultsElement)||g.destroy(this.resultsElement),this.resultsElement=g.create("div",{"class":"arcgisSearch searchGroup picklistResults"},this.domNode,"last"),f.activeSourceIndex!==this._allIndex&&this._isSingleResult(a))e=this.flatMatch?this._hydrateResult(a[f.activeSourceIndex][0],f.activeSourceIndex,!1):this._hydrateResult(a[f.activeSourceIndex].PickListItems[0].Addresses[0],f.activeSourceIndex,!1),this.select(e);else{if(p(a))j=!0;else{for(d in a)if(a.hasOwnProperty(d))if(p(a[d])||p(a[d].PickListItems))this.flatMatch&&!p(a[d])&&a[d].length>0?(i=a[d].length,c=this._createResultsContainer("all"===this.activeSourceIndex,d,this.resultsElement),this._titleGroups.push(c),c.addChild(v(a[d],d)),j=!1):j=a[d].length>0&&!p(this.activeSource.locator)&&!p(this.activeSource.locator.declaredClass)&&"esri.tasks.locator"===this.activeSource.locator.declaredClass.toLowerCase()?!1:!0;else if(b=a[d].PickListItems,i=b.length,i>0)for(c=this._createResultsContainer("all"===this.activeSourceIndex,d,this.resultsElement),this._titleGroups.push(c),n=!0,h=0;i>h;h+=1)c.addChild(this._createPremise(b[h],this.showCounts,w,1===i,d)),j=!1;else j=!0;q.resolve()}this.enableSuggestions||!j||n||this._showNoResults(),p(this.resultsElement)||this.enableSuggestions||(k(this.resultsElement,".drilldownResult:click",function(){var a=m(this).data()[0];r(a)}),k(this.resultsElement,"keydown",function(a){var b,c=a.charCode||a.keyCode;switch(c){case o.ENTER:case o.NUMPAD_ENTER:b=m(".drilldownResult",a.target).data()[0],r(b);break;default:return!1}}))}return q.promise}})});} } }); \ No newline at end of file diff --git a/js/Locators/ABXDPALocator.js b/js/Locators/ABXDPALocator.js index 40a250c..ec9cfb7 100644 --- a/js/Locators/ABXDPALocator.js +++ b/js/Locators/ABXDPALocator.js @@ -43,7 +43,7 @@ function (declare, _LocatorBase, PickListItem) { // streetGrouping: Array // An array of the street level field names to use for grouping. - streetGrouping: ["DPA_DEP_THOROUGHFARE", "DPA_THOROUGHFARE", "DPA_DEP_LOCALITY", "DPA_LOCALITY", "DPA_POST_TOWN"], + streetGrouping: ["DPA_DEP_THOROUGHFARE", "DPA_THOROUGHFARE", "DPA_DBL_DEP_LOCALITY", "DPA_DEP_LOCALITY", "DPA_POST_TOWN"], // premiseGrouping: Array // An array of the premise level field names to use for grouping. @@ -54,7 +54,7 @@ function (declare, _LocatorBase, PickListItem) { // constructing the street description. streetFields: { STREET_DESCRIPTOR: "DPA_THOROUGHFARE", - LOCALITY_NAME: "DPA_LOCALITY", + LOCALITY_NAME: "DPA_DBL_DEP_LOCALITY", TOWN_NAME: "DPA_POST_TOWN", ADMINISTRATIVE_AREA: "DPA_DEP_LOCALITY" },