I am trying to get latitude and longitude using autosuggest API on MapMyndia but it returns to null
private void callAutoSuggestApi(String searchString) {
MapmyIndiaAutoSuggest.builder()
.query(searchString)
.build()
.enqueueCall(new Callback<AutoSuggestAtlasResponse>() {
@Override
public void onResponse(@NonNull Call<AutoSuggestAtlasResponse> call,
@NonNull Response<AutoSuggestAtlasResponse> response) {
if (response.code() == 200) {
if (response.body() != null) {
ArrayList<ELocation> suggestedList = response.body().getSuggestedLocations();
if (suggestedList.size() > 0) {
recyclerView.setVisibility(View.VISIBLE);
AutoSuggestAdapter autoSuggestAdapter = new AutoSuggestAdapter(suggestedList, eLocation -> {
Log.e(TAG, "onResponse: " + eLocation.toString());
selectedPlace(eLocation);
recyclerView.setVisibility(View.GONE);
});
recyclerView.setAdapter(autoSuggestAdapter);
}
} else {
showToast("Not able to get value, Try again.");
}
}
}
@Override
public void onFailure(@NonNull Call<AutoSuggestAtlasResponse> call, @NonNull Throwable t) {
showToast(t.toString());
}
});
}
The output I'm getting
ELocation{poiId='GA9HE8', placeAddress='Chamarajanagar District, Karnataka', latitude='null', longitude='null', level=0, type='SUB_DISTRICT', typeX=0, placeName='Yelandur', entryLatitude=null, entryLongitude=null, explore=-1, photoCount=0, user='null', source='null', time=0, index=0, alternateName='', keywords=[], addressTokens=null, p=0, orderIndex=7}