> For the complete documentation index, see [llms.txt](https://docs.mapsindoors.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mapsindoors.com/sdks-and-frameworks/android/directions/directions-renderer/users-location-as-point-of-origin.md).

# User's Location as Point of Origin

To query for a route, create a `MPPoint` from the Latitude, longitude and the z-index of the user, and use that on the `DirectionsService.query` function, like this:

```kotlin
val directionsService = MPDirectionsService(mContext)
//Create an Origin MPPoint with the users latitude, longitude and Z-index. If no Z-index is available just use 0.0
val origin = MPPoint(userLatitude, userLongitude, userZIndex)
val destination = destinationLocation.getPoint()
directionsService.setRouteResultListener { route, error ->
  //Handle the route result here
}
directionsService.query(origin, destination)
```

`userLatitude`, `userLongitude`. `userZIndex` and `destinationLocation` are all placeholder variable names where you insert your data.

Further details on how user positioning works, and how to display it, can be found [here](https://docs.mapsindoors.com/blue-dot/).

This results in directions queries originating from the user's current location.a
