Most parts of the address return null when using the OneLine Search in SKMaps

61 Views Asked by At

When I use the oneline search in SKMaps most parts of the address will return null. In android I use the below code:

SKSearchResult result = results.get(i);
SKAddress address = result.getAddress();
String houseNumber = address.getHouseNumber();
String street = address.getStreet();
String town = address.getCity();
String zipCode = address.getZipCode();
String formatted = houseNumber + " " + street + " " + town + " " + zipCode;

When I print out the formatted address it will say

null null city null

How do I get the components of the address without them being null?

2

There are 2 best solutions below

0
KevinZ On BEST ANSWER

Apparently the SKMaps Library is unable to get some components from Open Street Map even though they are available on the Open Street Map website. There is no solution to get these components through the SKMaps Library but you can change the search from Open Street Map to Google by doing:

onelineSearchSettings.setOnlineGeocoder(SKOnelineSearchSettings.SKGeocoderType.MAP_SEARCH_GOOGLE);
0
Cristian P. On

If some component of the address is null that means there is no information about that component and there is no other way to get the value of that component through the SKMaps library.