AnsweredAssumed Answered

Error Dialog for no Geocode Candidates

Question asked by bdebus on Jan 18, 2012
Latest reply on Jan 19, 2012 by bdebus
I want an error box to show when someone tries to type in "asfgsdfgtwergbfbgcfx" in my locator, well I can't figure out why this isn't working, it should:
if (candidates.length === 0){           alert('no candidates');   }   else if (candidate.score >= 65) {    var graphic = new esri.Graphic(geom, symbol);    //add a graphic to the map at the geocoded location    map.graphics.add(graphic);    //add a text symbol to the map listing the location of the matched address.    var displayText = candidate.address;    var font = new esri.symbol.Font("12pt",esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,"Helvetica");    var textSymbol = new esri.symbol.TextSymbol(displayText,font,new dojo.Color("black"));    textSymbol.setOffset(0,16);    map.graphics.add(new esri.Graphic(geom, textSymbol));    geoQuery(geom);   }    else if (candidate.score <=64){    showError();   }      else {    esri.hide(dojo.byId('loadingImg'));   }


Any ideas?

Outcomes