Search code examples
androidskmapsskobbler-maps

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


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?


Solution

  • 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);