Skip to content

Commit

Permalink
update v5.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfeng committed Jul 18, 2024
1 parent 5ad8eee commit d2fee65
Show file tree
Hide file tree
Showing 29 changed files with 35 additions and 1,456 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DJI Mobile SDK for Android V5 Latest Version 5.9.1
# DJI Mobile SDK for Android V5 Latest Version 5.9.2

[中文版](README_CN.md)

Expand Down Expand Up @@ -83,7 +83,7 @@ For further detail on how to integrate the DJI Android SDK into your Android Stu

## AAR Explanation

> **Notice:** sdkVersion = 5.9.1
> **Notice:** sdkVersion = 5.9.2
| SDK package | Explanation | How to use|
| :---------------: | :-----------------: | :---------------: |
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DJI Mobile SDK for Android V5 最新版本 V5.9.1
# DJI Mobile SDK for Android V5 最新版本 V5.9.2
[English Version](README.md)

## DJI Mobile SDK V5 是什么?
Expand Down Expand Up @@ -84,7 +84,7 @@ Sample模块:

## AAR说明

> **注意:** sdkVersion = 5.9.1
> **注意:** sdkVersion = 5.9.2
| SDK包| 说明| 使用方式|
| :---------------: | :-----------------: | :---------------: |
Expand Down
9 changes: 4 additions & 5 deletions SampleCode-V5/android-sdk-v5-as/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ext {
deps = [:]
//DJI MSDK V5包
deps.aircraft = "com.dji:dji-sdk-v5-aircraft:5.9.1"
deps.aircraftProvided = "com.dji:dji-sdk-v5-aircraft-provided:5.9.1"
deps.networkImp = "com.dji:dji-sdk-v5-networkImp:5.9.1"
deps.aircraft = "com.dji:dji-sdk-v5-aircraft:5.9.2"
deps.aircraftProvided = "com.dji:dji-sdk-v5-aircraft-provided:5.9.2"
deps.networkImp = "com.dji:dji-sdk-v5-networkImp:5.9.2"

//三方依赖库
deps.gson = 'com.google.code.gson:gson:2.9.1'
Expand All @@ -12,8 +12,7 @@ ext {
deps.rx3Kt = 'io.reactivex.rxjava3:rxkotlin:3.0.0'
deps.sqlcipher = 'net.zetetic:android-database-sqlcipher:4.5.0'
deps.wire = 'com.squareup.wire:wire-runtime:2.2.0'
deps.amap3DMap = 'com.amap.api:3dmap:7.3.0'
deps.amapSearch = 'com.amap.api:search:7.3.0'

deps.okhttp3 = 'com.squareup.okhttp3:okhttp:3.14.9'
deps.leakcanary = 'com.squareup.leakcanary:leakcanary-android:2.11'
deps.xcrash = 'com.iqiyi.xcrash:xcrash-android-lib:3.1.0'
Expand Down
3 changes: 1 addition & 2 deletions SampleCode-V5/android-sdk-v5-as/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ KOTLIN_VERSION = 1.7.21
AIRCRAFT_API_KEY = Please add your app key here.

#map key
AMAP_API_KEY = ENTER YOUR AMAP API KEY
GMAP_API_KEY = ENTER YOUR Google Map API KEY
MAPLIBRE_TOKEN = "ENTER YOUR MapLibre TOKEN"
MAPLIBRE_TOKEN = ENTER YOUR MapLibre TOKEN


#签名信息,临时文件,测试用
Expand Down
4 changes: 1 addition & 3 deletions SampleCode-V5/android-sdk-v5-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
versionCode 1
versionName "1.0"
manifestPlaceholders["API_KEY"] = project.AIRCRAFT_API_KEY
manifestPlaceholders["AMAP_API_KEY"] = project.AMAP_API_KEY
manifestPlaceholders["GMAP_API_KEY"] = project.GMAP_API_KEY
manifestPlaceholders["MAPLIBRE_TOKEN"] = project.MAPLIBRE_TOKEN
ndk {
abiFilters 'arm64-v8a'
}
Expand All @@ -35,12 +35,10 @@ android {
minifyEnabled true
shrinkResources false
signingConfig signingConfigs.release
buildConfigField "String", "MAPLIBRE_TOKEN", MAPLIBRE_TOKEN
}
debug {
minifyEnabled false
shrinkResources false
buildConfigField "String", "MAPLIBRE_TOKEN", MAPLIBRE_TOKEN
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
android:name="com.google.android.geo.API_KEY"
android:value="${GMAP_API_KEY}" />

<!-- AMaps -->
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="${AMAP_API_KEY}" />



<uses-feature
Expand All @@ -43,6 +40,10 @@
android:name="com.dji.sdk.API_KEY"
android:value="${API_KEY}"/>

<!-- Maplibre Token-->
<meta-data
android:name="com.dji.mapkit.maplibre.apikey"
android:value="${MAPLIBRE_TOKEN}" />
<activity
android:name="dji.sampleV5.aircraft.DJIAircraftMainActivity"
android:theme="@style/full_screen_theme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ class FlySafeFragment : DJIFragment() {
map.setMapType(DJIMap.MapType.NORMAL)
}


map_widget.initAMap(onMapReadyListener)

map_widget.initMapLibreMap(requireContext() , onMapReadyListener)
map_widget.onCreate(savedInstanceState) //需要再init后调用否则Amap无法显示
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import kotlinx.android.synthetic.main.view_mission_setting_home.*

import android.widget.EditText
import com.dji.wpmzsdk.common.data.HeightMode
import dji.sampleV5.aircraft.BuildConfig
import dji.sdk.keyvalue.key.FlightControllerKey
import dji.sdk.keyvalue.key.KeyTools
import dji.sdk.keyvalue.value.common.LocationCoordinate2D
Expand Down Expand Up @@ -681,29 +682,10 @@ class WayPointV3Fragment : DJIFragment() {
}
}



@IntDef(
MapProvider.MAP_AUTO,
MapProvider.AMAP_PROVIDER,
MapProvider.MAPLIBRE_PROVIDER,
MapProvider.GOOGLE_PROVIDER
)
annotation class MapProvider {
companion object {
const val MAP_AUTO = 0
const val AMAP_PROVIDER = 1
const val MAPLIBRE_PROVIDER = 2
const val GOOGLE_PROVIDER = 3
}
}

private fun createMapView(savedInstanceState: Bundle?) {
val onMapReadyListener = MapWidget.OnMapReadyListener { map ->
map.setMapType(DJIMap.MapType.NORMAL)
map_widget.initMapLibreMap(requireContext()){
it.setMapType(DJIMap.MapType.NORMAL)
}
map_widget.initAMap(onMapReadyListener)

map_widget.onCreate(savedInstanceState) //需要再init后调用否则Amap无法显示
}

Expand Down
3 changes: 1 addition & 2 deletions SampleCode-V5/android-sdk-v5-uxsdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ dependencies {
api deps.maplibreAnotation
api deps.maplibreTurf
api deps.maplibreSdk
api deps.amap3DMap
api deps.amapSearch


api deps.playservicesplaces
api deps.playservicesmaps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import dji.v5.ux.core.util.RxUtil;
import dji.v5.ux.core.util.SettingDefinitions;
import dji.v5.ux.core.util.ViewUtil;
import dji.v5.ux.mapkit.amap.provider.AMapProvider;
import dji.v5.ux.mapkit.core.Mapkit;
import dji.v5.ux.mapkit.core.camera.DJICameraUpdate;
import dji.v5.ux.mapkit.core.camera.DJICameraUpdateFactory;
Expand Down Expand Up @@ -374,11 +373,8 @@ private void setMapProvider(SettingDefinitions.MapProvider provider, String acce
case HERE:
// removed
break;
case AMAP:
initAMap(null);
break;
case MAPLIBRE:
initMapLibreMap(accessToken, null);
initMapLibreMap(getContext(), null);
break;
case GOOGLE:
initGoogleMap(null);
Expand Down Expand Up @@ -861,31 +857,17 @@ public void initGoogleMap(@Nullable final OnMapReadyListener listener) {
});
}

/**
* Initializes the MapWidget with AMaps.
*
* @param listener The OnMapReadyListener which will invoke the onMapReady method when the map has finished
* initializing.
*/
public void initAMap(@Nullable final OnMapReadyListener listener) {
mapView = new AMapProvider().dispatchMapViewRequest(getContext(), null);
addView((ViewGroup) mapView, 0);
mapView.getDJIMapAsync(map -> {
MapWidget.this.map = map;
postInit(listener);
flyZoneHelper.initializeMap(map);
});
}


/**
* Initializes the MapWidget with Mapbox.
*
* @param listener The OnMapReadyListener which will invoke the onMapReady method when the map has finished
* initializing.
* @param mapboxAccessToken The API access token from Mapbox.
* @param context The API access context from Mapbox.
*/
public void initMapLibreMap(@NonNull String mapboxAccessToken, @Nullable final OnMapReadyListener listener) {
Mapkit.mapboxAccessToken(mapboxAccessToken);
public void initMapLibreMap(@NonNull Context context, @Nullable final OnMapReadyListener listener) {
Mapkit.init(context);
mapView = new MaplibreProvider().dispatchMapViewRequest(getContext(), null);
addView((ViewGroup) mapView, 0);
mapView.getDJIMapAsync(map -> {
Expand Down

This file was deleted.

Loading

0 comments on commit d2fee65

Please sign in to comment.