release: 1.0.13
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ build/
|
|||||||
**/pubspec.lock
|
**/pubspec.lock
|
||||||
.settings/
|
.settings/
|
||||||
.project
|
.project
|
||||||
|
**.cxx
|
||||||
|
@ -8,7 +8,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
classpath 'com.android.tools.build:gradle:3.5.4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,7 +22,8 @@ rootProject.allprojects {
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 34
|
namespace = "com.amap.flutter.map"
|
||||||
|
compileSdkVersion 35
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
@ -34,6 +35,6 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.amap.api:3dmap-location-search:10.1.200_loc6.4.9_sea9.7.4'
|
implementation 'com.amap.api:3dmap-location-search:10.1.200_loc6.4.9_sea9.7.4'
|
||||||
implementation 'androidx.annotation:annotation:1.8.1'
|
implementation 'androidx.annotation:annotation:1.9.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,40 +23,17 @@ public class AMapFlutterMapPlugin implements
|
|||||||
private static final String CLASS_NAME = "AMapFlutterMapPlugin";
|
private static final String CLASS_NAME = "AMapFlutterMapPlugin";
|
||||||
private static final String VIEW_TYPE = "com.amap.flutter.map";
|
private static final String VIEW_TYPE = "com.amap.flutter.map";
|
||||||
private Lifecycle lifecycle;
|
private Lifecycle lifecycle;
|
||||||
|
private FlutterPluginBinding pluginBinding;
|
||||||
|
|
||||||
public AMapFlutterMapPlugin() {
|
public AMapFlutterMapPlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerWith(PluginRegistry.Registrar registrar) {
|
|
||||||
LogUtil.i(CLASS_NAME, "registerWith=====>");
|
|
||||||
|
|
||||||
final Activity activity = registrar.activity();
|
|
||||||
if (activity == null) {
|
|
||||||
LogUtil.w(CLASS_NAME, "activity is null!!!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (activity instanceof LifecycleOwner) {
|
|
||||||
registrar
|
|
||||||
.platformViewRegistry()
|
|
||||||
.registerViewFactory(
|
|
||||||
VIEW_TYPE,
|
|
||||||
new AMapPlatformViewFactory(
|
|
||||||
registrar.messenger(),
|
|
||||||
() -> ((LifecycleOwner) activity).getLifecycle()));
|
|
||||||
} else {
|
|
||||||
registrar
|
|
||||||
.platformViewRegistry()
|
|
||||||
.registerViewFactory(
|
|
||||||
VIEW_TYPE,
|
|
||||||
new AMapPlatformViewFactory(registrar.messenger(), new ProxyLifecycleProvider(activity)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FlutterPlugin
|
// FlutterPlugin
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
|
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
|
||||||
LogUtil.i(CLASS_NAME, "onAttachedToEngine==>");
|
LogUtil.i(CLASS_NAME, "onAttachedToEngine==>");
|
||||||
|
this.pluginBinding = binding;
|
||||||
binding
|
binding
|
||||||
.getPlatformViewRegistry()
|
.getPlatformViewRegistry()
|
||||||
.registerViewFactory(
|
.registerViewFactory(
|
||||||
@ -78,6 +55,13 @@ public class AMapFlutterMapPlugin implements
|
|||||||
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
|
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
|
||||||
LogUtil.i(CLASS_NAME, "onAttachedToActivity==>");
|
LogUtil.i(CLASS_NAME, "onAttachedToActivity==>");
|
||||||
lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(binding);
|
lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(binding);
|
||||||
|
pluginBinding.getPlatformViewRegistry().registerViewFactory(
|
||||||
|
VIEW_TYPE,
|
||||||
|
new AMapPlatformViewFactory(
|
||||||
|
pluginBinding.getBinaryMessenger(),
|
||||||
|
() -> lifecycle
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,7 +30,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.flutter.view.FlutterMain;
|
import io.flutter.embedding.engine.FlutterEngine;
|
||||||
|
import io.flutter.embedding.engine.loader.FlutterLoader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author whm
|
* @author whm
|
||||||
@ -44,6 +45,15 @@ public class ConvertUtil {
|
|||||||
private static final int[] LocationTypeMap = new int[]{MyLocationStyle.LOCATION_TYPE_SHOW, MyLocationStyle.LOCATION_TYPE_FOLLOW, MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE};
|
private static final int[] LocationTypeMap = new int[]{MyLocationStyle.LOCATION_TYPE_SHOW, MyLocationStyle.LOCATION_TYPE_FOLLOW, MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE};
|
||||||
public static float density;
|
public static float density;
|
||||||
private static String apiKey;
|
private static String apiKey;
|
||||||
|
private static FlutterLoader flutterLoader; // For asset loading
|
||||||
|
|
||||||
|
public static void initialize(Context context) {
|
||||||
|
flutterLoader = new FlutterLoader();
|
||||||
|
if (!flutterLoader.initialized()) {
|
||||||
|
flutterLoader.startInitialization(context);
|
||||||
|
flutterLoader.ensureInitializationComplete(context, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void setPrivacyStatement(Context context, Object object) {
|
public static void setPrivacyStatement(Context context, Object object) {
|
||||||
if (null == object) {
|
if (null == object) {
|
||||||
@ -396,15 +406,15 @@ public class ConvertUtil {
|
|||||||
case "fromAsset":
|
case "fromAsset":
|
||||||
if (data.size() == 2) {
|
if (data.size() == 2) {
|
||||||
return BitmapDescriptorFactory.fromAsset(
|
return BitmapDescriptorFactory.fromAsset(
|
||||||
FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
|
flutterLoader.getLookupKeyForAsset(toString(data.get(1))));
|
||||||
} else {
|
} else {
|
||||||
return BitmapDescriptorFactory.fromAsset(
|
return BitmapDescriptorFactory.fromAsset(
|
||||||
FlutterMain.getLookupKeyForAsset(toString(data.get(1)), toString(data.get(2))));
|
flutterLoader.getLookupKeyForAsset(toString(data.get(1)), toString(data.get(2))));
|
||||||
}
|
}
|
||||||
case "fromAssetImage":
|
case "fromAssetImage":
|
||||||
if (data.size() == 3) {
|
if (data.size() == 3) {
|
||||||
return BitmapDescriptorFactory.fromAsset(
|
return BitmapDescriptorFactory.fromAsset(
|
||||||
FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
|
flutterLoader.getLookupKeyForAsset(toString(data.get(1))));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"'fromAssetImage' Expected exactly 3 arguments, got: " + data.size());
|
"'fromAssetImage' Expected exactly 3 arguments, got: " + data.size());
|
||||||
|
@ -26,7 +26,8 @@ if (flutterVersionName == null) {
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 34
|
namespace = "com.amap.flutter.amap_map_example"
|
||||||
|
compileSdkVersion 35
|
||||||
|
|
||||||
lint {
|
lint {
|
||||||
disable 'InvalidPackage'
|
disable 'InvalidPackage'
|
||||||
@ -36,7 +37,7 @@ android {
|
|||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.amap.flutter.amap_map_example"
|
applicationId "com.amap.flutter.amap_map_example"
|
||||||
minSdkVersion flutter.minSdkVersion
|
minSdkVersion flutter.minSdkVersion
|
||||||
targetSdkVersion 33
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
@ -69,7 +70,7 @@ android {
|
|||||||
jniLibs.srcDirs = ['libs']
|
jniLibs.srcDirs = ['libs']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ndkVersion '25.1.8937393'
|
ndkVersion '27.0.12077973'
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowNativeHeapPointerTagging="false"
|
android:allowNativeHeapPointerTagging="false"
|
||||||
|
android:enableOnBackInvokedCallback="true"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="amap_map_example">
|
android:label="amap_map_example">
|
||||||
|
15
example/android/gradle.properties
Normal file
15
example/android/gradle.properties
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
## For more details on how to configure your build environment visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
#
|
||||||
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
|
# Default value: -Xmx1024m -XX:MaxPermSize=256m
|
||||||
|
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
|
#
|
||||||
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
|
# This option should only be used with decoupled projects. For more details, visit
|
||||||
|
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||||
|
# org.gradle.parallel=true
|
||||||
|
#Tue Mar 11 22:34:19 CST 2025
|
||||||
|
android.enableJetifier=true
|
||||||
|
android.useAndroidX=true
|
@ -11,7 +11,7 @@
|
|||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
|
||||||
/// 高德地图Flutter插件入口文件
|
/// 高德地图Flutter插件入口文件
|
||||||
library amap_map;
|
library;
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: amap_map
|
name: amap_map
|
||||||
description: Amap SDK Flutter plugin for integrating AMapSDK in iOS and Android applications.
|
description: Amap SDK Flutter plugin for integrating AMapSDK in iOS and Android applications.
|
||||||
version: 1.0.12
|
version: 1.0.13
|
||||||
homepage: https://github.com/kuloud/amap_map
|
homepage: https://github.com/kuloud/amap_map
|
||||||
issue_tracker: https://github.com/kuloud/amap_map/issues
|
issue_tracker: https://github.com/kuloud/amap_map/issues
|
||||||
platforms:
|
platforms:
|
||||||
|
Reference in New Issue
Block a user