Skip to main content

Getting Started

To implement Barikoi map in you android app, we recommend using Flutter Maplibre GL as it is quick and easy to install and use with Barikoi maps.

Prerequisite

For this example you will need:

  1. A Barikoi API key, which you can get in Developer Dashboard
  2. Knowledge in Flutter, Dart
  3. Barikoi map style

Get Dependencies

Add maplibre_gl to your project by running this command:

flutter pub add maplibre_gl

or add it directly as a dependency to your pubspec.yaml file:

dependencies:
maplibre_gl: ^0.19.0

Web

Include the following JavaScript and CSS files in the head of the web/index.html file.

<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />

Location Features

Android

Add the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in the application manifest android/app/src/main/AndroidManifest.xml to enable location features in an Android application:

<manifest ...
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Starting from Android API level 23 you also need to request it at runtime. This plugin does not handle this for you. The example app uses the flutter 'location' plugin for this.

iOS

To enable location features in an iOS application:

If you access your users' location, you should also add the following key to ios/Runner/Info.plist to explain why you need access to their location data:

    <key>NSLocationWhenInUseUsageDescription</key>
<string>[Your explanation here]</string>

A possible explanation could be: "Shows your location on the map".

You can check out the various functionalities in the sample code snippets listed in ths documentation. To have a more detailed understanding of the classes and functionalities, check out this Documentation