Sorry, you need to enable JavaScript to visit this website.

Parse location

Parse location

To create parser you just need to instantiate LocationParser:

val parser = LocationParser()

Optionally, you can create & use custom parsing strategy:

To do so, you have to implement the ParseStrategy interface and add it as a first or last one to the parser.
If you specify that your custom strategy is the 'First' then every time it will succeed
it will NOT execute other strategies.

val customStrategy = ...
parser.addStrategyFirst(customStrategy)

To start parsing process

val parseData = ParseDataFactory.fromGoogleMapsIntentData(locationData)

parser.parse(parseData, status = { status ->
        [...]
        when (status) {
            is Success -> doSomethingWith(status.result)
            else -> [...]
        }
        [...]
})

The status is an instance of ParseStatus and the status.result is instance of ParseResult class.

Inside result class you can find data about coordinates and if available the description of the place.



image

Google Maps app

image

Share location dialog

image

Parsing in progress

image

Parsed location at map of Maps SDK for Android

You are here