Skip to main content
This takes you from an empty activity to a map a user can draw on. The map itself needs no key; if you want to fill it with LOCI frames instead of your own boundaries, Frames is the next step.
1

Add the library

Add the dependency to your app module.
app/build.gradle.kts
Add the location permission as described in platform setup. To use LOCI frames, see Frames.
2

Put the map on screen

Create a LociMapView, add it to your layout, and set the options and the work areas on it.
SurveyActivity.kt
3

Run it

Tap Draw, tap inside a visible work area, then Save. onSave receives a DataFromMap — see what you get back.Geofencing applies: the user must be inside a work area. On an emulator, set the location inside it. To switch the check off while testing, see Geofencing.

The example screen

A complete screen: the map, a work area, three layers, callbacks and the saved result. Set the location inside the work area and run it. The Layers option switches the layer Draw creates shapes in.
DemoActivity.kt
Tap Draw, tap inside the work area, then Save.