A Flutter plugin that provides a Map4dMap widget.
- Flutter 3.44.8 and Dart 3.12.0 or later.
- Map4d Access Key, get at https://map.map4d.vn/developer/key
- Android SDK 21 or higher
Set minSdkVersion in android/app/build.gradle
android {
defaultConfig {
minSdkVersion 21
}
}- iOS 13.0 or later
Swift Package Manager is enabled by default. Build the app to migrate its Xcode project. See the Flutter SwiftPM integration guide.
The 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 https://map.map4d.vn/developer/key
Provide access 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.map.ACCESS_KEY"
android:value="YOUR_KEY_HERE"/>
</application>
</manifest>- Replace
YOUR_KEY_HEREby your access key
Provide access key from ios/Runner/Info.plist
<key>Map4dMapAccessKey</key>
<string>YOUR_KEY_HERE</string>- Replace
YOUR_KEY_HEREby your access key
import 'package:flutter/material.dart';
import 'package:map4d_map/map4d_map.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Map4D Map',
home: MFMapView(),
);
}
}See example directory for more examples
- Guides: https://docs.map4d.vn/map4d-map/flutter/
- API Reference: https://pub.dev/documentation/map4d_map/latest/