Aus öffentlichen Paketdaten erstellte Orientierung.
Yandex MapKit ist ein Flutter-Plugin, das die nahtlose Integration von Yandex Karten in Android- und iOS-Anwendungen ermöglicht. Es bietet über eine konsistente Dart-API Zugriff auf Kartendarstellung, Markierungen, Routen und Geokodierungsfunktionen. Das Plugin unterstützt beide Plattformen mit native Leistung und wird von der Community gepflegt. Entwickler können die Kartengestaltung anpassen, Benutzerinteraktionen verarbeiten und Yandex' Kartendaten für ortsbasierte Dienste nutzen. Es ist ideal für Anwendungen, die detaillierte Karten und Navigationswerkzeuge benötigen, insbesondere in Regionen, in denen Yandex Maps weit verbreitet sind.
Anwendungsfälle
Integration von Yandex Maps in mobilen Apps
Benutzerdefinierte Marker und Überlagerungen anzeigen
Eingeschränkte Dokumentation im Vergleich zu anderen Plugins
Abhängig von der regionalen Abdeckung von Yandex
Erforderliche API-Schlüsselkonfiguration
Kann zusätzliche Berechtigungen unter Android erfordern
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
yandex_mapkit
A flutter plugin for displaying yandex maps on iOS and Android.
Android
iOS
Support
SDK 26+
iOS 15+
Disclaimer: This project uses Yandex Mapkit which belongs to Yandex
When using Mapkit refer to these terms of use
Features
[X] Working with Placemarks/Polylines/Polygons/Circles - adding, updating, removing, tap events, styling
[X] Working with collections of map objects and clusters
[X] Setting map bounds and limiting user interactions
[X] Showing current user location
[X] Address suggestions
[X] Basic driving/bicycle/pedestrian routing
[X] Basic address direct/reverse search
[X] Working with geo objects
[X] Support for both lite and full variants
Getting Started
Generate your API Key
Go to https://developer.tech.yandex.ru/services/
Create a MapKit Mobile SDK key
Setup for iOS
Specify your API key and locale in ios/Runner/AppDelegate.swift. It should be similar to the following
import UIKit
import Flutter
import YandexMapsMobile
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
YMKMapKit.setLocale("YOUR_LOCALE") // Your preferred language. Not required, defaults to system language
YMKMapKit.setApiKey("YOUR_API_KEY") // Your generated API key
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Specify your desired variant of native library using environment variable YANDEX_MAPKIT_VARIANT
Available options: lite and full. navikit variant is currently not supported.
Defaults to lite.
After changing YANDEX_MAPKIT_VARIANT you need to invalidate Xcode cache using
rm -rf ~/Library/Developer/Xcode/DerivedData
Setup for Android
Specify your desired variant of native library.
Available options: lite and full. navikit variant is currently not supported.
Defaults to lite.
Add the following line to android/gradle.properties
yandexMapkit.variant=<YOUR_DESIRED_VARIANT>
Add dependency implementation 'com.yandex.android:maps.mobile:4.39.1-<YOUR_DESIRED_VARIANT>' to android/app/build.gradle
Specify your API key and locale in your custom application class.
If you don't have one the you can create it like so
android/app/src/main/.../MainApplication.java
import android.app.Application;
import com.yandex.mapkit.MapKitFactory;
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
MapKitFactory.setLocale("YOUR_LOCALE"); // Your preferred language. Not required, defaults to system language
MapKitFactory.setApiKey("YOUR_API_KEY"); // Your generated API key
}
}
android/app/src/main/.../MainApplication.kt
import android.app.Application
import com.yandex.mapkit.MapKitFactory
class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
MapKitFactory.setLocale("YOUR_LOCALE") // Your preferred language. Not required, defaults to system language
MapKitFactory.setApiKey("YOUR_API_KEY") // Your generated API key
}
}
In your android/app/src/main/AndroidManifest.xml
Add permissions <uses-permission android:name="android.permission.INTERNET"/> and <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Find application tag and replace android:name to the name of your custom application class prefixed by a dot ..
In the end it should look like the following
YandexMapkit always works with one language only.
Due to native constraints after the application is launched it can't be changed.
Android. Hybrid Composition
By default android views are rendered using Hybrid Composition.
To render the YandexMap widget on Android using Virtual Display(old composition), set AndroidYandexMap.useAndroidViewSurface to false.
Place this anywhere in your code, before using YandexMap widget.