tompi / jeoquery

jQuery wrapper for easily calling geonames.org jsonp services
http://tompi.github.com/jeoquery/
78 stars 15 forks source link

Multiple country codes #8

Closed vr55 closed 8 years ago

vr55 commented 8 years ago

Hello. How can i use multiple contry code in 'search' request? i.e. "country=US&country=RU"

tompi commented 8 years ago

Hi. Just assign an array to "country" param, like this:

jeoquery.getGeoNames('countryInfo', { country: ['GB', 'NO'] }, function(countries) {
    console.log(countries.length); 
});

Latest version uses jquery ajax param "traditional=true" so this serializes to "country=GB&country=NO" instead of "country[]=GB&country[]=NO".