Skip to main content
This takes you from an empty app 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 package

Point to the package by path or git.
pubspec.yaml
Then run the platform setup for Android and iOS.
2

Initialise, only if you use frames

The map works without a key. If you preload frames, initialise the SDK once with your API key, for example in main. Create the key in your LOCI dashboard under Developers → New key; see Authentication.
lib/main.dart
3

Drop in the widget

Give it what the user may draw and the work areas. The map works out of the box.
lib/survey_map.dart
4

Run it

terminal
Tap Draw, tap inside a visible work area, then Save. onSave receives a DataFromMap — see what you get back.

The example app

The package ships an example app whose first screen is the preload step. Run it from example. Nothing you type is saved: the frames key stays in memory and is gone when the app closes. The map screen shows only what was preloaded.
run on iOS or Android
The --dart-define value is optional: leave it out and type the frames key on the first screen. Do not commit the key. A release build of the Android example:
release APK