I'm using the jqueryUI autocomplete functionality (http://jqueryui.com/demos/autocomplete/#remote-jsonp) to search surrounding shops of cities in germany and austria. my code is the following:
$.ajax({
url: "http://ws.geonames.org/searchJSON?lang=de&country=DE&country=AT&isNameRequired=true&featureClass=A&featureCode=ADM3&featureCode=ADM4&featureCode=ADM1",
dataType: "jsonp",
data: {
featureClass: "P",
style: "full",
maxRows: 12,
name_startsWith: request.term
}...
the problem now is, for austria, i need all the administrative devisions ADM3, ADM1... to get all of the cities. For Germany ADM4 would be enough. But because of the other codes, I get Berlin for example three times, because its ADM3, ADM1 and ADM4.
How can i remove the duplicates of certain cities to autosuggest it only once?