Fired when selected country changes.
Pass two objects: selectedCountry and relatedCountries. Selected country is an country
object for new selected country, relatedCountries are country objects for countries related to new
selected country.
Usage:
// use the onCountryPicked() to set callback when clicked country changed
controller.onCountryPicked( callback );
// defined a callback function, as a demo, this function simply output selectedCountry, relatedCountries which are passed parameters into console
function callback ( selectedCountry, relatedCountries ) {
console.log(selectedCountry);
console.log(relatedCountries);
}
controller.onCountryPicked( callback );
// defined a callback function, as a demo, this function simply output selectedCountry, relatedCountries which are passed parameters into console
function callback ( selectedCountry, relatedCountries ) {
console.log(selectedCountry);
console.log(relatedCountries);
}
CountryObject
CountryObject is a JSON object as defined below (the values of attribute varies):
{
ISOCode: "AU"
center: THREE.vector
lat: -27
lon: 133
name: "AUSTRALIA"
}
ISOCode: "AU"
center: THREE.vector
lat: -27
lon: 133
name: "AUSTRALIA"
}
Parameter | Description |
---|---|
ISOCode | ISO code of country |
center | THREE.vector object in the scene of country |
lat | latitude of country |
lon | longitude of country |
name | country name |