Map4dServices for Flutter
A flutter plugin for integrating Map4D Services in iOS and Android applications.
Requirements
- Android SDK 21+
- iOS 9.3+
Installing
To use this plugin, add map4d_services
as a dependency in your pubspec.yaml
file.
dependencies:
map4d_services: ^1.1.0
Or run command
flutter pub add map4d_services
Setup Services API key
The Services API key is a unique identifier that authenticates requests associated with your project for usage and billing purposes. You must have at least one API key associated with your project.
Get an API key at map.map4d.vn/user/
Android
Provide services api key from android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data
android:name="vn.map4d.services.ACCESS_KEY"
android:value="YOUR_SERVICES_ACCESS_KEY"/>
</application>
</manifest>
iOS
Provide services api key from ios/Runner/Info.plist
<key>Map4dServicesAccessKey</key>
<string>YOUR_SERVICES_ACCESS_KEY</string>
Simple Usage
import 'package:flutter/material.dart';
import 'package:map4d_services/map4d_services.dart';
void getPlaceDetail() async {
MFServices.places
.fetchPlaceDetail('5c88df71d2c05acd14848f9e')
.then((detail) => {print('Place Detail: $detail')})
.onError<MFServiceError>((error, stackTrace) =>
{print('Place Detail Error: ${error.code}, ${error.message}')});
}
See example directory for more examples
Documents
- Guides: docs.map4d.vn/map4d-service/flutter/
- API Reference: pub.dev/documentation/map4d_services/latest/