Solved! Go to Solution.
locateResult.title = addrCandidate.address ? replaceMuniCodes(String(addrCandidate.address)) : widgetTitle; function replaceMuniCodes(addStr:String):String { var retVal:String = addStr; var muniCodeArr:Array = addStr.split(", "); if(muniCodeArr.length == 4){ retVal = muniCodeArr[0] + ", "; switch(muniCodeArr[3]) { case "36201": { retVal += "West Goshen Township"; break; }; case "36203": { retVal += "East Goshen Township"; break; }; } } return retVal; }
locateResult.title = addrCandidate.address ? replaceMuniCodes(String(addrCandidate.address)) : widgetTitle; function replaceMuniCodes(addStr:String):String { var retVal:String = addStr; var muniCodeArr:Array = addStr.split(", "); if(muniCodeArr.length == 2){ retVal = muniCodeArr[0] + ", "; switch(muniCodeArr[0]) { case "52": { retVal += "West Goshen Township"; break; }; case "53": { retVal += "East Goshen Township"; break; }; } } return retVal; }