reverseGeocode and forwardGeocode in the native geocoder are always giving single entry as result even though i have set maxResults as 5 in the options.
Sample code I am using:
Blockquote
let options : any = {
useLocale: true,
maxResults: 5
};
this.nativeGeocoder.forwardGeocode(searchStr, options).then(
(coordinates: NativeGeocoderForwardResult) => {
let optionsWithOneResult : any = {
useLocale: true,
maxResults: 5
};
coordinates.forEach((coordinate)=>{
this.getAddressFormCoordinates(parseFloat(coordinate.latitude), parseFloat(coordinate.longitude), optionsWithOneResult);
console.log("Inside for loop " + this.geoLocationsList);
});
}
).catch(
(error: any) => console.log(error)
);
Blockquote
It always returns me with an array of only one entry.
Please help me if I am missing something here.