├── .gitignore ├── CHANGELOG.md ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── amap │ └── maps │ └── amapmapsflutter │ ├── AMapController.java │ ├── AMapFactory.java │ ├── AmapMapsFlutterPlugin.java │ └── Convert.java ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── amap │ │ │ │ └── maps │ │ │ │ └── amapmapsflutterexample │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Flutter.podspec │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── AMapController.h │ ├── AMapController.m │ ├── AMapFactory.h │ ├── AMapFactory.m │ ├── AmapMapsFlutterPlugin.h │ ├── AmapMapsFlutterPlugin.m │ ├── Constants.h │ └── Constants.m └── amap_maps_flutter.podspec ├── lib ├── amap_maps_flutter.dart └── src │ ├── AMap.dart │ ├── AMapController.dart │ ├── BitmapDescriptor.dart │ ├── Callbacks.dart │ ├── CameraPosition.dart │ ├── LatLng.dart │ └── Marker.dart └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | .DS_Store 5 | .dart_tool/ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | .packages 10 | .pub/ 11 | pubspec.lock 12 | 13 | # Java class files 14 | *.class 15 | 16 | # Generated files 17 | bin/ 18 | gen/ 19 | out/ 20 | 21 | # Gradle files 22 | .gradle/ 23 | build/ 24 | 25 | # Local configuration file (sdk path, etc) 26 | local.properties 27 | 28 | # Proguard folder generated by Eclipse 29 | proguard/ 30 | 31 | # Log Files 32 | *.log 33 | 34 | # Android Studio Navigation editor temp files 35 | .navigation/ 36 | 37 | # Android Studio captures folder 38 | captures/ 39 | 40 | # IntelliJ 41 | *.iml 42 | .idea/workspace.xml 43 | .idea/tasks.xml 44 | .idea/gradle.xml 45 | .idea/assetWizardSettings.xml 46 | .idea/dictionaries 47 | .idea/libraries 48 | .idea/caches 49 | 50 | # Keystore files 51 | # Uncomment the following line if you do not want to check your keystore files in. 52 | #*.jks 53 | 54 | # External native build folder generated in Android Studio 2.2 and later 55 | .externalNativeBuild 56 | 57 | # Google Services (e.g. APIs or Firebase) 58 | google-services.json 59 | 60 | # Freeline 61 | freeline.py 62 | freeline/ 63 | freeline_project_description.json 64 | 65 | # fastlane 66 | fastlane/report.xml 67 | fastlane/Preview.html 68 | fastlane/screenshots 69 | fastlane/test_output 70 | fastlane/readme.md 71 | 72 | .idea/ 73 | 74 | example/.flutter-plugins-dependencies 75 | example/ios/Flutter/.last_build_id 76 | example/ios/Flutter/flutter_export_environment.sh 77 | 78 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # amap-maps-flutter 2 | Flutter 使用高德地图SDK示例 3 | 4 | 5 | 6 | 7 | 8 | iOS 使用注意事项 9 | 10 | ~~~ 11 | Trying to embed a platform view but the PrerollContext does not support embedding 12 | ~~~ 13 | 14 | Info.plist io.flutter.embedded_views_preview YES -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.amap.maps.amapmapsflutter' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 27 26 | 27 | defaultConfig { 28 | minSdkVersion 16 29 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 30 | } 31 | lintOptions { 32 | disable 'InvalidPackage' 33 | } 34 | } 35 | 36 | 37 | dependencies { 38 | compile 'com.amap.api:3dmap:latest.integration' 39 | } 40 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'amap_maps_flutter' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/com/amap/maps/amapmapsflutter/AMapController.java: -------------------------------------------------------------------------------- 1 | package com.amap.maps.amapmapsflutter; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.Activity; 5 | import android.app.Application; 6 | import android.content.Context; 7 | import android.os.Build; 8 | import android.os.Bundle; 9 | import android.view.View; 10 | 11 | import com.amap.api.maps.AMap; 12 | import com.amap.api.maps.CameraUpdateFactory; 13 | import com.amap.api.maps.MapView; 14 | import com.amap.api.maps.model.CameraPosition; 15 | import com.amap.api.maps.model.Marker; 16 | import com.amap.api.maps.model.MarkerOptions; 17 | 18 | import java.util.HashMap; 19 | import java.util.List; 20 | import java.util.Map; 21 | import java.util.concurrent.atomic.AtomicInteger; 22 | 23 | import io.flutter.plugin.common.MethodCall; 24 | import io.flutter.plugin.common.MethodChannel; 25 | import io.flutter.plugin.common.PluginRegistry; 26 | import io.flutter.plugin.platform.PlatformView; 27 | 28 | /** 29 | * @author zxy 30 | * @data 2018/12/8 31 | */ 32 | 33 | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) 34 | public class AMapController implements Application.ActivityLifecycleCallbacks, PlatformView, MethodChannel.MethodCallHandler, AMap.OnMapLoadedListener, AMap.OnCameraChangeListener, AMap.OnMarkerClickListener { 35 | 36 | public static final String CHANNEL = "plugins.flutter.maps.amap.com/amap_maps_flutter"; 37 | public static final String METHOD_NAME_CALLBACK_AMAP_ON_MAP_LOADED = "amap#onMapLoaded"; 38 | public static final String METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE = "amap#onCameraChange"; 39 | public static final String MEHTOD_NAME_AMAP_CHANGE_CAMERA = "amap#changeCamera"; 40 | public static final String MEHTOD_NAME_AMAP_ADD_MARKER = "amap#addMarker"; 41 | public static final String MEHTOD_NAME_AMAP_UPDATE_MARKER = "amap#updateMarker"; 42 | 43 | private final Context context; 44 | private final AtomicInteger activityState; 45 | private final PluginRegistry.Registrar registrar; 46 | private final MethodChannel methodChannel; 47 | 48 | private MapView mapView; 49 | private AMap aMap; 50 | 51 | private boolean disposed = false; 52 | 53 | private final int registrarActivityHashCode; 54 | 55 | 56 | private final Map markers; 57 | 58 | AMapController(int id, Context context, 59 | AtomicInteger activityState, 60 | PluginRegistry.Registrar registrar) { 61 | this.context = context; 62 | this.activityState = activityState; 63 | this.registrar = registrar; 64 | this.registrarActivityHashCode = registrar.activity().hashCode(); 65 | 66 | registrar.activity().getApplication().registerActivityLifecycleCallbacks(this); 67 | 68 | methodChannel = 69 | new MethodChannel(registrar.messenger(), CHANNEL + id); 70 | methodChannel.setMethodCallHandler(this); 71 | 72 | 73 | mapView = new MapView(context); 74 | mapView.onCreate(null); 75 | 76 | aMap = mapView.getMap(); 77 | 78 | this.markers = new HashMap(); 79 | 80 | initListener(); 81 | 82 | 83 | } 84 | 85 | 86 | 87 | @Override 88 | public View getView() { 89 | return mapView; 90 | } 91 | 92 | @Override 93 | public void dispose() { 94 | if (disposed) { 95 | return; 96 | } 97 | disposed = true; 98 | mapView.onDestroy(); 99 | registrar.activity().getApplication().unregisterActivityLifecycleCallbacks(this); 100 | } 101 | 102 | @Override 103 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 104 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 105 | return; 106 | } 107 | mapView.onCreate(savedInstanceState); 108 | } 109 | 110 | @Override 111 | public void onActivityStarted(Activity activity) { 112 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 113 | return; 114 | } 115 | // mapView.onStart(); 116 | } 117 | 118 | @Override 119 | public void onActivityResumed(Activity activity) { 120 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 121 | return; 122 | } 123 | mapView.onResume(); 124 | } 125 | 126 | @Override 127 | public void onActivityPaused(Activity activity) { 128 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 129 | return; 130 | } 131 | mapView.onPause(); 132 | } 133 | 134 | @Override 135 | public void onActivityStopped(Activity activity) { 136 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 137 | return; 138 | } 139 | // mapView.onStop(); 140 | } 141 | 142 | @Override 143 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) { 144 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 145 | return; 146 | } 147 | mapView.onSaveInstanceState(outState); 148 | } 149 | 150 | @Override 151 | public void onActivityDestroyed(Activity activity) { 152 | if (disposed || activity.hashCode() != registrarActivityHashCode) { 153 | return; 154 | } 155 | mapView.onDestroy(); 156 | } 157 | 158 | /** 159 | * 方法会从flutter中调用 160 | * @param methodCall 161 | * @param result 162 | */ 163 | @Override 164 | public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) { 165 | 166 | Marker marker = null; 167 | MarkerOptions markerOptions = null; 168 | 169 | switch (methodCall.method) { 170 | case MEHTOD_NAME_AMAP_CHANGE_CAMERA: 171 | // setText(methodCall, result); 172 | 173 | List arguments = (List) methodCall.arguments; 174 | CameraPosition cameraPosition = Convert.toCameraPosition(arguments.get(0)); 175 | boolean isAnimate = (boolean) arguments.get(1); 176 | 177 | 178 | changeCamera(cameraPosition, isAnimate); 179 | 180 | result.success(null); 181 | break; 182 | case MEHTOD_NAME_AMAP_ADD_MARKER: 183 | 184 | markerOptions = Convert.toMarkerOptions(methodCall.argument("options")); 185 | marker = aMap.addMarker(markerOptions); 186 | 187 | markers.put(marker.getId(), marker); 188 | 189 | // 将marker唯一标识传递回去 190 | result.success(marker.getId()); 191 | break; 192 | 193 | case MEHTOD_NAME_AMAP_UPDATE_MARKER: 194 | final String markerId = methodCall.argument("marker"); 195 | 196 | marker = markers.get(markerId); 197 | markerOptions = Convert.toMarkerOptions(methodCall.argument("options")); 198 | marker.setMarkerOptions(markerOptions); 199 | 200 | // 将marker唯一标识传递回去 201 | result.success(null); 202 | break; 203 | default: 204 | result.notImplemented(); 205 | } 206 | } 207 | 208 | 209 | 210 | public void changeCamera(CameraPosition cameraPosition, boolean isAnimate) { 211 | if(cameraPosition != null) { 212 | if (isAnimate) { 213 | aMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); 214 | } else { 215 | aMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); 216 | } 217 | } 218 | } 219 | 220 | 221 | 222 | /** 223 | * 注册回调监听 224 | */ 225 | private void initListener() { 226 | aMap.setOnMapLoadedListener(this); 227 | aMap.setOnCameraChangeListener(this); 228 | 229 | //覆盖物 230 | aMap.setOnMarkerClickListener(this); 231 | } 232 | 233 | 234 | @Override 235 | public void onMapLoaded() { 236 | if(methodChannel != null) { 237 | final Map arguments = new HashMap<>(2); 238 | methodChannel.invokeMethod(METHOD_NAME_CALLBACK_AMAP_ON_MAP_LOADED, arguments); 239 | } 240 | } 241 | 242 | @Override 243 | public void onCameraChange(CameraPosition position) { 244 | if(methodChannel != null) { 245 | final Map arguments = new HashMap<>(2); 246 | arguments.put("position", Convert.toJson(position)); 247 | arguments.put("isFinish", false); 248 | methodChannel.invokeMethod(METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE, arguments); 249 | } 250 | } 251 | 252 | @Override 253 | public void onCameraChangeFinish(CameraPosition position) { 254 | final Map arguments = new HashMap<>(2); 255 | arguments.put("position", Convert.toJson(position)); 256 | arguments.put("isFinish", true); 257 | methodChannel.invokeMethod(METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE, arguments); 258 | } 259 | 260 | @Override 261 | public boolean onMarkerClick(Marker marker) { 262 | return false; 263 | } 264 | } 265 | -------------------------------------------------------------------------------- /android/src/main/java/com/amap/maps/amapmapsflutter/AMapFactory.java: -------------------------------------------------------------------------------- 1 | package com.amap.maps.amapmapsflutter; 2 | 3 | import android.content.Context; 4 | 5 | import io.flutter.plugin.common.PluginRegistry; 6 | import io.flutter.plugin.common.StandardMessageCodec; 7 | import io.flutter.plugin.platform.PlatformView; 8 | import io.flutter.plugin.platform.PlatformViewFactory; 9 | import java.util.Map; 10 | import java.util.concurrent.atomic.AtomicInteger; 11 | 12 | public class AMapFactory extends PlatformViewFactory { 13 | 14 | private final AtomicInteger mActivityState; 15 | private final PluginRegistry.Registrar mPluginRegistrar; 16 | 17 | public AMapFactory(AtomicInteger state, PluginRegistry.Registrar registrar) { 18 | super(StandardMessageCodec.INSTANCE); 19 | mActivityState = state; 20 | mPluginRegistrar = registrar; 21 | } 22 | 23 | @Override 24 | public PlatformView create(Context context, int id, Object args) { 25 | Map params = (Map) args; 26 | // params 可以传递部分初始化需要的参数 27 | AMapController aMapController = new AMapController(id, context, mActivityState, mPluginRegistrar); 28 | return aMapController; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/amap/maps/amapmapsflutter/AmapMapsFlutterPlugin.java: -------------------------------------------------------------------------------- 1 | package com.amap.maps.amapmapsflutter; 2 | 3 | import io.flutter.plugin.common.MethodCall; 4 | import io.flutter.plugin.common.MethodChannel; 5 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 6 | import io.flutter.plugin.common.MethodChannel.Result; 7 | import io.flutter.plugin.common.PluginRegistry; 8 | import io.flutter.plugin.common.PluginRegistry.Registrar; 9 | import android.graphics.Point; 10 | 11 | import android.app.Activity; 12 | import android.app.Application; 13 | import android.os.Bundle; 14 | import java.util.concurrent.atomic.AtomicInteger; 15 | import com.amap.maps.amapmapsflutter.AMapController; 16 | 17 | import com.amap.api.maps.model.BitmapDescriptor; 18 | import com.amap.api.maps.CameraUpdate; 19 | import com.amap.api.maps.CameraUpdateFactory; 20 | import com.amap.api.maps.model.BitmapDescriptorFactory; 21 | import com.amap.api.maps.model.CameraPosition; 22 | import com.amap.api.maps.model.LatLng; 23 | import com.amap.api.maps.model.LatLngBounds; 24 | import io.flutter.view.FlutterMain; 25 | import java.util.Arrays; 26 | import java.util.HashMap; 27 | import java.util.List; 28 | import java.util.Map; 29 | 30 | /** AmapMapsFlutterPlugin */ 31 | public class AmapMapsFlutterPlugin implements Application.ActivityLifecycleCallbacks{ 32 | 33 | static final int CREATED = 1; 34 | static final int STARTED = 2; 35 | static final int RESUMED = 3; 36 | static final int PAUSED = 4; 37 | static final int STOPPED = 5; 38 | static final int DESTROYED = 6; 39 | private final AtomicInteger state = new AtomicInteger(0); 40 | private final int registrarActivityHashCode; 41 | 42 | public static void registerWith(PluginRegistry.Registrar registrar) { 43 | final AmapMapsFlutterPlugin plugin = new AmapMapsFlutterPlugin(registrar); 44 | registrar.activity().getApplication().registerActivityLifecycleCallbacks(plugin); 45 | registrar 46 | .platformViewRegistry() 47 | .registerViewFactory( 48 | AMapController.CHANNEL, new AMapFactory(plugin.state, registrar)); 49 | } 50 | 51 | @Override 52 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 53 | if (activity.hashCode() != registrarActivityHashCode) { 54 | return; 55 | } 56 | state.set(CREATED); 57 | } 58 | 59 | @Override 60 | public void onActivityStarted(Activity activity) { 61 | if (activity.hashCode() != registrarActivityHashCode) { 62 | return; 63 | } 64 | state.set(STARTED); 65 | } 66 | 67 | @Override 68 | public void onActivityResumed(Activity activity) { 69 | if (activity.hashCode() != registrarActivityHashCode) { 70 | return; 71 | } 72 | state.set(RESUMED); 73 | } 74 | 75 | @Override 76 | public void onActivityPaused(Activity activity) { 77 | if (activity.hashCode() != registrarActivityHashCode) { 78 | return; 79 | } 80 | state.set(PAUSED); 81 | } 82 | 83 | @Override 84 | public void onActivityStopped(Activity activity) { 85 | if (activity.hashCode() != registrarActivityHashCode) { 86 | return; 87 | } 88 | state.set(STOPPED); 89 | } 90 | 91 | @Override 92 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) {} 93 | 94 | @Override 95 | public void onActivityDestroyed(Activity activity) { 96 | if (activity.hashCode() != registrarActivityHashCode) { 97 | return; 98 | } 99 | state.set(DESTROYED); 100 | } 101 | 102 | private AmapMapsFlutterPlugin(PluginRegistry.Registrar registrar) { 103 | this.registrarActivityHashCode = registrar.activity().hashCode(); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /android/src/main/java/com/amap/maps/amapmapsflutter/Convert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package com.amap.maps.amapmapsflutter; 6 | 7 | import android.graphics.Point; 8 | 9 | import com.amap.api.maps.model.BitmapDescriptor; 10 | import com.amap.api.maps.CameraUpdate; 11 | import com.amap.api.maps.CameraUpdateFactory; 12 | import com.amap.api.maps.model.BitmapDescriptorFactory; 13 | import com.amap.api.maps.model.CameraPosition; 14 | import com.amap.api.maps.model.LatLng; 15 | import com.amap.api.maps.model.LatLngBounds; 16 | import com.amap.api.maps.model.MarkerOptions; 17 | 18 | import io.flutter.view.FlutterMain; 19 | import java.util.Arrays; 20 | import java.util.HashMap; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | /** Conversions between JSON-like values and GoogleMaps data types. */ 25 | class Convert { 26 | private static BitmapDescriptor toBitmapDescriptor(Object o) { 27 | final List data = toList(o); 28 | switch (toString(data.get(0))) { 29 | case "defaultMarker": 30 | if (data.size() == 1) { 31 | return BitmapDescriptorFactory.defaultMarker(); 32 | } else { 33 | return BitmapDescriptorFactory.defaultMarker(toFloat(data.get(1))); 34 | } 35 | case "fromAsset": 36 | if (data.size() == 2) { 37 | return BitmapDescriptorFactory.fromAsset( 38 | FlutterMain.getLookupKeyForAsset(toString(data.get(1)))); 39 | } else { 40 | return BitmapDescriptorFactory.fromAsset( 41 | FlutterMain.getLookupKeyForAsset(toString(data.get(1)), toString(data.get(2)))); 42 | } 43 | default: 44 | throw new IllegalArgumentException("Cannot interpret " + o + " as BitmapDescriptor"); 45 | } 46 | } 47 | 48 | private static boolean toBoolean(Object o) { 49 | return (Boolean) o; 50 | } 51 | 52 | static CameraPosition toCameraPosition(Object o) { 53 | final Map data = toMap(o); 54 | final CameraPosition.Builder builder = CameraPosition.builder(); 55 | builder.bearing(toFloat(data.get("bearing"))); 56 | builder.target(toLatLng(data.get("target"))); 57 | builder.tilt(toFloat(data.get("tilt"))); 58 | builder.zoom(toFloat(data.get("zoom"))); 59 | return builder.build(); 60 | } 61 | 62 | static CameraUpdate toCameraUpdate(Object o, float density) { 63 | final List data = toList(o); 64 | switch (toString(data.get(0))) { 65 | case "newCameraPosition": 66 | return CameraUpdateFactory.newCameraPosition(toCameraPosition(data.get(1))); 67 | case "newLatLng": 68 | return CameraUpdateFactory.newLatLng(toLatLng(data.get(1))); 69 | case "newLatLngBounds": 70 | return CameraUpdateFactory.newLatLngBounds( 71 | toLatLngBounds(data.get(1)), toPixels(data.get(2), density)); 72 | case "newLatLngZoom": 73 | return CameraUpdateFactory.newLatLngZoom(toLatLng(data.get(1)), toFloat(data.get(2))); 74 | case "scrollBy": 75 | return CameraUpdateFactory.scrollBy( // 76 | toFractionalPixels(data.get(1), density), // 77 | toFractionalPixels(data.get(2), density)); 78 | case "zoomBy": 79 | if (data.size() == 2) { 80 | return CameraUpdateFactory.zoomBy(toFloat(data.get(1))); 81 | } else { 82 | return CameraUpdateFactory.zoomBy(toFloat(data.get(1)), toPoint(data.get(2), density)); 83 | } 84 | case "zoomIn": 85 | return CameraUpdateFactory.zoomIn(); 86 | case "zoomOut": 87 | return CameraUpdateFactory.zoomOut(); 88 | case "zoomTo": 89 | return CameraUpdateFactory.zoomTo(toFloat(data.get(1))); 90 | default: 91 | throw new IllegalArgumentException("Cannot interpret " + o + " as CameraUpdate"); 92 | } 93 | } 94 | 95 | private static double toDouble(Object o) { 96 | return ((Number) o).doubleValue(); 97 | } 98 | 99 | private static float toFloat(Object o) { 100 | return ((Number) o).floatValue(); 101 | } 102 | 103 | private static Float toFloatWrapper(Object o) { 104 | return (o == null) ? null : toFloat(o); 105 | } 106 | 107 | static int toInt(Object o) { 108 | return ((Number) o).intValue(); 109 | } 110 | 111 | static Object toJson(CameraPosition position) { 112 | if (position == null) { 113 | return null; 114 | } 115 | final Map data = new HashMap<>(); 116 | data.put("bearing", position.bearing); 117 | data.put("target", toJson(position.target)); 118 | data.put("tilt", position.tilt); 119 | data.put("zoom", position.zoom); 120 | return data; 121 | } 122 | 123 | private static Object toJson(LatLng latLng) { 124 | return Arrays.asList(latLng.latitude, latLng.longitude); 125 | } 126 | 127 | private static LatLng toLatLng(Object o) { 128 | final List data = toList(o); 129 | return new LatLng(toDouble(data.get(0)), toDouble(data.get(1))); 130 | } 131 | 132 | private static LatLngBounds toLatLngBounds(Object o) { 133 | if (o == null) { 134 | return null; 135 | } 136 | final List data = toList(o); 137 | return new LatLngBounds(toLatLng(data.get(0)), toLatLng(data.get(1))); 138 | } 139 | 140 | private static List toList(Object o) { 141 | return (List) o; 142 | } 143 | 144 | static long toLong(Object o) { 145 | return ((Number) o).longValue(); 146 | } 147 | 148 | static Map toMap(Object o) { 149 | return (Map) o; 150 | } 151 | 152 | private static float toFractionalPixels(Object o, float density) { 153 | return toFloat(o) * density; 154 | } 155 | 156 | static int toPixels(Object o, float density) { 157 | return (int) toFractionalPixels(o, density); 158 | } 159 | 160 | private static Point toPoint(Object o, float density) { 161 | final List data = toList(o); 162 | return new Point(toPixels(data.get(0), density), toPixels(data.get(1), density)); 163 | } 164 | 165 | private static String toString(Object o) { 166 | return (String) o; 167 | } 168 | 169 | 170 | /** 171 | * 根据flutter传递的数据生成markeroptions 172 | * @param o 173 | * @return 174 | */ 175 | static MarkerOptions toMarkerOptions(Object o) { 176 | MarkerOptions options = new MarkerOptions(); 177 | final Map data = toMap(o); 178 | final Object alpha = data.get("alpha"); 179 | if (alpha != null) { 180 | options.alpha(toFloat(alpha)); 181 | } 182 | final Object anchorU = data.get("anchorU"); 183 | final Object anchorV = data.get("anchorV"); 184 | if (anchorU != null && anchorV != null) { 185 | options.anchor(toFloat(anchorU), toFloat(anchorV)); 186 | } 187 | final Object draggable = data.get("draggable"); 188 | if (draggable != null) { 189 | options.draggable(toBoolean(draggable)); 190 | } 191 | final Object flat = data.get("flat"); 192 | if (flat != null) { 193 | options.setFlat(toBoolean(flat)); 194 | } 195 | final Object icon = data.get("icon"); 196 | if (icon != null) { 197 | options.icon(toBitmapDescriptor(icon)); 198 | } 199 | final Object position = data.get("position"); 200 | if (position != null) { 201 | options.position(toLatLng(position)); 202 | } 203 | final Object rotation = data.get("rotation"); 204 | if (rotation != null) { 205 | options.rotateAngle(toFloat(rotation)); 206 | } 207 | final Object visible = data.get("visible"); 208 | if (visible != null) { 209 | options.visible(toBoolean(visible)); 210 | } 211 | final Object zIndex = data.get("zIndex"); 212 | if (zIndex != null) { 213 | options.zIndex(toFloat(zIndex)); 214 | } 215 | return options; 216 | } 217 | 218 | 219 | } 220 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # amap_maps_flutter_example 2 | 3 | Demonstrates how to use the amap_maps_flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.io/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.amap.maps.amapmapsflutterexample" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/amap/maps/amapmapsflutterexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.amap.maps.amapmapsflutterexample; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'Flutter' 7 | s.version = '1.0.0' 8 | s.summary = 'High-performance, high-fidelity mobile apps.' 9 | s.description = <<-DESC 10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. 11 | DESC 12 | s.homepage = 'https://flutter.io' 13 | s.license = { :type => 'MIT' } 14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 16 | s.ios.deployment_target = '8.0' 17 | s.vendored_frameworks = 'Flutter.framework' 18 | end 19 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 32 | end 33 | 34 | post_install do |installer| 35 | installer.pods_project.targets.each do |target| 36 | flutter_additional_ios_build_settings(target) 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 09C2714B66C85EF5994392B3 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D254D03AC731FFE41BCB83E /* libPods-Runner.a */; }; 11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 14 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 15 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 16 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 17 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 18 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXCopyFilesBuildPhase section */ 22 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 23 | isa = PBXCopyFilesBuildPhase; 24 | buildActionMask = 2147483647; 25 | dstPath = ""; 26 | dstSubfolderSpec = 10; 27 | files = ( 28 | ); 29 | name = "Embed Frameworks"; 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXCopyFilesBuildPhase section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 0ABFE3D7FC2D5D6322D176CD /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 36 | 0D254D03AC731FFE41BCB83E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 38 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 39 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 40 | 6D95FC2427D5AC3850D0F9B9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 41 | 7996F1A3A8C4A3D35C1272DB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 42 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 43 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 44 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 47 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 09C2714B66C85EF5994392B3 /* libPods-Runner.a in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 21338DD08D0CD13CB9F36A36 /* Pods */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 7996F1A3A8C4A3D35C1272DB /* Pods-Runner.debug.xcconfig */, 71 | 0ABFE3D7FC2D5D6322D176CD /* Pods-Runner.release.xcconfig */, 72 | 6D95FC2427D5AC3850D0F9B9 /* Pods-Runner.profile.xcconfig */, 73 | ); 74 | name = Pods; 75 | sourceTree = ""; 76 | }; 77 | 92E78F576106AD2801FB810B /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 0D254D03AC731FFE41BCB83E /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 9740EEB11CF90186004384FC /* Flutter */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 89 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 90 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 91 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 92 | ); 93 | name = Flutter; 94 | sourceTree = ""; 95 | }; 96 | 97C146E51CF9000F007C117D = { 97 | isa = PBXGroup; 98 | children = ( 99 | 9740EEB11CF90186004384FC /* Flutter */, 100 | 97C146F01CF9000F007C117D /* Runner */, 101 | 97C146EF1CF9000F007C117D /* Products */, 102 | 21338DD08D0CD13CB9F36A36 /* Pods */, 103 | 92E78F576106AD2801FB810B /* Frameworks */, 104 | ); 105 | sourceTree = ""; 106 | }; 107 | 97C146EF1CF9000F007C117D /* Products */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 97C146EE1CF9000F007C117D /* Runner.app */, 111 | ); 112 | name = Products; 113 | sourceTree = ""; 114 | }; 115 | 97C146F01CF9000F007C117D /* Runner */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 119 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 120 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 121 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 122 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 123 | 97C147021CF9000F007C117D /* Info.plist */, 124 | 97C146F11CF9000F007C117D /* Supporting Files */, 125 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 126 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 127 | ); 128 | path = Runner; 129 | sourceTree = ""; 130 | }; 131 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 97C146F21CF9000F007C117D /* main.m */, 135 | ); 136 | name = "Supporting Files"; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 97C146ED1CF9000F007C117D /* Runner */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 145 | buildPhases = ( 146 | 35330B9EE01B8062ABE08D50 /* [CP] Check Pods Manifest.lock */, 147 | 9740EEB61CF901F6004384FC /* Run Script */, 148 | 97C146EA1CF9000F007C117D /* Sources */, 149 | 97C146EB1CF9000F007C117D /* Frameworks */, 150 | 97C146EC1CF9000F007C117D /* Resources */, 151 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 152 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 153 | D5E7CE0E16237A0B78AAC1C6 /* [CP] Embed Pods Frameworks */, 154 | 1FDD2EF7C950A5BD695261D4 /* [CP] Copy Pods Resources */, 155 | ); 156 | buildRules = ( 157 | ); 158 | dependencies = ( 159 | ); 160 | name = Runner; 161 | productName = Runner; 162 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 163 | productType = "com.apple.product-type.application"; 164 | }; 165 | /* End PBXNativeTarget section */ 166 | 167 | /* Begin PBXProject section */ 168 | 97C146E61CF9000F007C117D /* Project object */ = { 169 | isa = PBXProject; 170 | attributes = { 171 | LastUpgradeCheck = 0910; 172 | ORGANIZATIONNAME = "The Chromium Authors"; 173 | TargetAttributes = { 174 | 97C146ED1CF9000F007C117D = { 175 | CreatedOnToolsVersion = 7.3.1; 176 | DevelopmentTeam = YMJ372W38W; 177 | ProvisioningStyle = Manual; 178 | }; 179 | }; 180 | }; 181 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 182 | compatibilityVersion = "Xcode 3.2"; 183 | developmentRegion = English; 184 | hasScannedForEncodings = 0; 185 | knownRegions = ( 186 | English, 187 | en, 188 | Base, 189 | ); 190 | mainGroup = 97C146E51CF9000F007C117D; 191 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 192 | projectDirPath = ""; 193 | projectRoot = ""; 194 | targets = ( 195 | 97C146ED1CF9000F007C117D /* Runner */, 196 | ); 197 | }; 198 | /* End PBXProject section */ 199 | 200 | /* Begin PBXResourcesBuildPhase section */ 201 | 97C146EC1CF9000F007C117D /* Resources */ = { 202 | isa = PBXResourcesBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 206 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 207 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 208 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 209 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | /* End PBXResourcesBuildPhase section */ 214 | 215 | /* Begin PBXShellScriptBuildPhase section */ 216 | 1FDD2EF7C950A5BD695261D4 /* [CP] Copy Pods Resources */ = { 217 | isa = PBXShellScriptBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | ); 221 | inputPaths = ( 222 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", 223 | "${PODS_ROOT}/AMap3DMap/MAMapKit.framework/AMap.bundle", 224 | ); 225 | name = "[CP] Copy Pods Resources"; 226 | outputPaths = ( 227 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AMap.bundle", 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | shellPath = /bin/sh; 231 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; 232 | showEnvVarsInLog = 0; 233 | }; 234 | 35330B9EE01B8062ABE08D50 /* [CP] Check Pods Manifest.lock */ = { 235 | isa = PBXShellScriptBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | inputPaths = ( 240 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 241 | "${PODS_ROOT}/Manifest.lock", 242 | ); 243 | name = "[CP] Check Pods Manifest.lock"; 244 | outputPaths = ( 245 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | shellPath = /bin/sh; 249 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 250 | showEnvVarsInLog = 0; 251 | }; 252 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 253 | isa = PBXShellScriptBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | inputPaths = ( 258 | ); 259 | name = "Thin Binary"; 260 | outputPaths = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 265 | }; 266 | 9740EEB61CF901F6004384FC /* Run Script */ = { 267 | isa = PBXShellScriptBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | inputPaths = ( 272 | ); 273 | name = "Run Script"; 274 | outputPaths = ( 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | shellPath = /bin/sh; 278 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 279 | }; 280 | D5E7CE0E16237A0B78AAC1C6 /* [CP] Embed Pods Frameworks */ = { 281 | isa = PBXShellScriptBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | ); 285 | inputPaths = ( 286 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 287 | "${PODS_ROOT}/../Flutter/Flutter.framework", 288 | ); 289 | name = "[CP] Embed Pods Frameworks"; 290 | outputPaths = ( 291 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | shellPath = /bin/sh; 295 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 296 | showEnvVarsInLog = 0; 297 | }; 298 | /* End PBXShellScriptBuildPhase section */ 299 | 300 | /* Begin PBXSourcesBuildPhase section */ 301 | 97C146EA1CF9000F007C117D /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 306 | 97C146F31CF9000F007C117D /* main.m in Sources */, 307 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | }; 311 | /* End PBXSourcesBuildPhase section */ 312 | 313 | /* Begin PBXVariantGroup section */ 314 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 97C146FB1CF9000F007C117D /* Base */, 318 | ); 319 | name = Main.storyboard; 320 | sourceTree = ""; 321 | }; 322 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 323 | isa = PBXVariantGroup; 324 | children = ( 325 | 97C147001CF9000F007C117D /* Base */, 326 | ); 327 | name = LaunchScreen.storyboard; 328 | sourceTree = ""; 329 | }; 330 | /* End PBXVariantGroup section */ 331 | 332 | /* Begin XCBuildConfiguration section */ 333 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 362 | ENABLE_NS_ASSERTIONS = NO; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 367 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 368 | GCC_WARN_UNDECLARED_SELECTOR = YES; 369 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 370 | GCC_WARN_UNUSED_FUNCTION = YES; 371 | GCC_WARN_UNUSED_VARIABLE = YES; 372 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 373 | MTL_ENABLE_DEBUG_INFO = NO; 374 | SDKROOT = iphoneos; 375 | TARGETED_DEVICE_FAMILY = "1,2"; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Profile; 379 | }; 380 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 381 | isa = XCBuildConfiguration; 382 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 383 | buildSettings = { 384 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 385 | CODE_SIGN_IDENTITY = "iPhone Developer"; 386 | CODE_SIGN_STYLE = Manual; 387 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 388 | DEVELOPMENT_TEAM = YMJ372W38W; 389 | ENABLE_BITCODE = NO; 390 | FRAMEWORK_SEARCH_PATHS = ( 391 | "$(inherited)", 392 | "$(PROJECT_DIR)/Flutter", 393 | ); 394 | INFOPLIST_FILE = Runner/Info.plist; 395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 396 | LIBRARY_SEARCH_PATHS = ( 397 | "$(inherited)", 398 | "$(PROJECT_DIR)/Flutter", 399 | ); 400 | PRODUCT_BUNDLE_IDENTIFIER = com.amap.maps.amapMapsFlutterExample; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | PROVISIONING_PROFILE_SPECIFIER = OpenPlatform_Dev; 403 | VERSIONING_SYSTEM = "apple-generic"; 404 | }; 405 | name = Profile; 406 | }; 407 | 97C147031CF9000F007C117D /* Debug */ = { 408 | isa = XCBuildConfiguration; 409 | buildSettings = { 410 | ALWAYS_SEARCH_USER_PATHS = NO; 411 | CLANG_ANALYZER_NONNULL = YES; 412 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 413 | CLANG_CXX_LIBRARY = "libc++"; 414 | CLANG_ENABLE_MODULES = YES; 415 | CLANG_ENABLE_OBJC_ARC = YES; 416 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 417 | CLANG_WARN_BOOL_CONVERSION = YES; 418 | CLANG_WARN_COMMA = YES; 419 | CLANG_WARN_CONSTANT_CONVERSION = YES; 420 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 421 | CLANG_WARN_EMPTY_BODY = YES; 422 | CLANG_WARN_ENUM_CONVERSION = YES; 423 | CLANG_WARN_INFINITE_RECURSION = YES; 424 | CLANG_WARN_INT_CONVERSION = YES; 425 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 426 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 427 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 428 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 429 | CLANG_WARN_STRICT_PROTOTYPES = YES; 430 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 431 | CLANG_WARN_UNREACHABLE_CODE = YES; 432 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 433 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 434 | COPY_PHASE_STRIP = NO; 435 | DEBUG_INFORMATION_FORMAT = dwarf; 436 | ENABLE_STRICT_OBJC_MSGSEND = YES; 437 | ENABLE_TESTABILITY = YES; 438 | GCC_C_LANGUAGE_STANDARD = gnu99; 439 | GCC_DYNAMIC_NO_PIC = NO; 440 | GCC_NO_COMMON_BLOCKS = YES; 441 | GCC_OPTIMIZATION_LEVEL = 0; 442 | GCC_PREPROCESSOR_DEFINITIONS = ( 443 | "DEBUG=1", 444 | "$(inherited)", 445 | ); 446 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 447 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 448 | GCC_WARN_UNDECLARED_SELECTOR = YES; 449 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 450 | GCC_WARN_UNUSED_FUNCTION = YES; 451 | GCC_WARN_UNUSED_VARIABLE = YES; 452 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 453 | MTL_ENABLE_DEBUG_INFO = YES; 454 | ONLY_ACTIVE_ARCH = YES; 455 | SDKROOT = iphoneos; 456 | TARGETED_DEVICE_FAMILY = "1,2"; 457 | }; 458 | name = Debug; 459 | }; 460 | 97C147041CF9000F007C117D /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | ALWAYS_SEARCH_USER_PATHS = NO; 464 | CLANG_ANALYZER_NONNULL = YES; 465 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 466 | CLANG_CXX_LIBRARY = "libc++"; 467 | CLANG_ENABLE_MODULES = YES; 468 | CLANG_ENABLE_OBJC_ARC = YES; 469 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 470 | CLANG_WARN_BOOL_CONVERSION = YES; 471 | CLANG_WARN_COMMA = YES; 472 | CLANG_WARN_CONSTANT_CONVERSION = YES; 473 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INFINITE_RECURSION = YES; 477 | CLANG_WARN_INT_CONVERSION = YES; 478 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 479 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 480 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 481 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 482 | CLANG_WARN_STRICT_PROTOTYPES = YES; 483 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 484 | CLANG_WARN_UNREACHABLE_CODE = YES; 485 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 486 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 487 | COPY_PHASE_STRIP = NO; 488 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 489 | ENABLE_NS_ASSERTIONS = NO; 490 | ENABLE_STRICT_OBJC_MSGSEND = YES; 491 | GCC_C_LANGUAGE_STANDARD = gnu99; 492 | GCC_NO_COMMON_BLOCKS = YES; 493 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 494 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 495 | GCC_WARN_UNDECLARED_SELECTOR = YES; 496 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 497 | GCC_WARN_UNUSED_FUNCTION = YES; 498 | GCC_WARN_UNUSED_VARIABLE = YES; 499 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 500 | MTL_ENABLE_DEBUG_INFO = NO; 501 | SDKROOT = iphoneos; 502 | TARGETED_DEVICE_FAMILY = "1,2"; 503 | VALIDATE_PRODUCT = YES; 504 | }; 505 | name = Release; 506 | }; 507 | 97C147061CF9000F007C117D /* Debug */ = { 508 | isa = XCBuildConfiguration; 509 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 510 | buildSettings = { 511 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 512 | CODE_SIGN_IDENTITY = "iPhone Developer"; 513 | CODE_SIGN_STYLE = Manual; 514 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 515 | DEVELOPMENT_TEAM = YMJ372W38W; 516 | ENABLE_BITCODE = NO; 517 | FRAMEWORK_SEARCH_PATHS = ( 518 | "$(inherited)", 519 | "$(PROJECT_DIR)/Flutter", 520 | ); 521 | INFOPLIST_FILE = Runner/Info.plist; 522 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 523 | LIBRARY_SEARCH_PATHS = ( 524 | "$(inherited)", 525 | "$(PROJECT_DIR)/Flutter", 526 | ); 527 | PRODUCT_BUNDLE_IDENTIFIER = com.amap.maps.amapMapsFlutterExample; 528 | PRODUCT_NAME = "$(TARGET_NAME)"; 529 | PROVISIONING_PROFILE_SPECIFIER = OpenPlatform_Dev; 530 | VERSIONING_SYSTEM = "apple-generic"; 531 | }; 532 | name = Debug; 533 | }; 534 | 97C147071CF9000F007C117D /* Release */ = { 535 | isa = XCBuildConfiguration; 536 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 537 | buildSettings = { 538 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 539 | CODE_SIGN_IDENTITY = "iPhone Developer"; 540 | CODE_SIGN_STYLE = Manual; 541 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 542 | DEVELOPMENT_TEAM = YMJ372W38W; 543 | ENABLE_BITCODE = NO; 544 | FRAMEWORK_SEARCH_PATHS = ( 545 | "$(inherited)", 546 | "$(PROJECT_DIR)/Flutter", 547 | ); 548 | INFOPLIST_FILE = Runner/Info.plist; 549 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 550 | LIBRARY_SEARCH_PATHS = ( 551 | "$(inherited)", 552 | "$(PROJECT_DIR)/Flutter", 553 | ); 554 | PRODUCT_BUNDLE_IDENTIFIER = com.amap.maps.amapMapsFlutterExample; 555 | PRODUCT_NAME = "$(TARGET_NAME)"; 556 | PROVISIONING_PROFILE_SPECIFIER = OpenPlatform_Dev; 557 | VERSIONING_SYSTEM = "apple-generic"; 558 | }; 559 | name = Release; 560 | }; 561 | /* End XCBuildConfiguration section */ 562 | 563 | /* Begin XCConfigurationList section */ 564 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 565 | isa = XCConfigurationList; 566 | buildConfigurations = ( 567 | 97C147031CF9000F007C117D /* Debug */, 568 | 97C147041CF9000F007C117D /* Release */, 569 | 249021D3217E4FDB00AE95B9 /* Profile */, 570 | ); 571 | defaultConfigurationIsVisible = 0; 572 | defaultConfigurationName = Release; 573 | }; 574 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 575 | isa = XCConfigurationList; 576 | buildConfigurations = ( 577 | 97C147061CF9000F007C117D /* Debug */, 578 | 97C147071CF9000F007C117D /* Release */, 579 | 249021D4217E4FDB00AE95B9 /* Profile */, 580 | ); 581 | defaultConfigurationIsVisible = 0; 582 | defaultConfigurationName = Release; 583 | }; 584 | /* End XCConfigurationList section */ 585 | }; 586 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 587 | } 588 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | amap_maps_flutter_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | io.flutter.embedded_views_preview 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:amap_maps_flutter/amap_maps_flutter.dart'; 4 | 5 | void main() => runApp(MyApp()); 6 | 7 | class MyApp extends StatelessWidget { 8 | // This widget is the root of your application. 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | title: 'Flutter AMap Demo', 13 | theme: ThemeData( 14 | primarySwatch: Colors.blue, 15 | ), 16 | home: MyHomePage(title: 'Flutter AMap Demo Home Page'), 17 | ); 18 | } 19 | } 20 | 21 | class MyHomePage extends StatefulWidget { 22 | MyHomePage({Key key, this.title}) : super(key: key); 23 | 24 | final String title; 25 | 26 | @override 27 | _MyHomePageState createState() => _MyHomePageState(); 28 | } 29 | 30 | 31 | class _MyHomePageState extends State { 32 | 33 | 34 | AMapController mapController; 35 | 36 | Marker currentMarker; 37 | 38 | bool _isAnimation = true; 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | appBar: AppBar( 44 | title: Text(widget.title), 45 | ), 46 | body: Column(children: [ 47 | Center( 48 | child: Container( 49 | padding: EdgeInsets.symmetric(vertical: 30.0), 50 | width: 400.0, 51 | height: 400.0, 52 | child: AMap( 53 | onMapCreated: onMapCreated, 54 | ))), 55 | Row(children: [ 56 | FlatButton( 57 | child: Text("移动到北京"), 58 | onPressed: () { 59 | if (mapController != null) { 60 | mapController.changeCamera(CameraPosition( 61 | target: LatLng(39.893927, 116.405972), 62 | zoom: 10 63 | ), _isAnimation); 64 | } 65 | },), 66 | _isAnimationButton(), 67 | ],), 68 | Row(children: [ 69 | FlatButton( 70 | child: Text("添加Marker"), 71 | onPressed: () { 72 | if (mapController != null) { 73 | MarkerOptions options = MarkerOptions.defaultOptions; 74 | 75 | mapController.addMarker(options).then( 76 | (marker) { 77 | setState(() { 78 | currentMarker = marker; 79 | } 80 | ); 81 | } 82 | ); 83 | } 84 | },), 85 | FlatButton( 86 | child: Text("修改位置"), 87 | onPressed: () { 88 | if (mapController != null) { 89 | if (currentMarker != null) { 90 | //fixme 如果默认值不一样如何更新 91 | MarkerOptions markerOptions = MarkerOptions( 92 | position: LatLng( 93 | currentMarker.options.position.latitude, 94 | currentMarker.options.position.longitude + 0.001)); 95 | mapController.updateMarker(currentMarker, markerOptions); 96 | } else { 97 | print("currentMarker is null"); 98 | } 99 | } 100 | },), 101 | ],), 102 | Row(children: [ 103 | FlatButton( 104 | child: Text("添加Polyline"), 105 | onPressed: () { 106 | if (mapController != null) { 107 | MarkerOptions options = MarkerOptions.defaultOptions; 108 | mapController.addMarker(options); 109 | } 110 | },), 111 | ],), 112 | 113 | ])); 114 | } 115 | 116 | Widget _isAnimationButton() { 117 | return FlatButton( 118 | child: Text('${_isAnimation ? '关闭' : '开启'} 动画'), 119 | onPressed: () { 120 | setState(() { 121 | _isAnimation = !_isAnimation; 122 | }); 123 | }, 124 | ); 125 | } 126 | 127 | 128 | void onMapCreated(AMapController controller) { 129 | print("onMapCreated"); 130 | mapController = controller; 131 | 132 | // 注册监听 133 | mapController.onMapLoaded.add(onMapLoaded); 134 | mapController.onCameraChanged.add(onCameraChanged); 135 | } 136 | 137 | 138 | void onMapLoaded(argument) { 139 | print("onMapLoaded"); 140 | } 141 | 142 | void onCameraChanged(CameraPosition cameraPostion) { 143 | print("onCameraChanged " + onCameraChanged.toString()); 144 | } 145 | 146 | 147 | } 148 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: amap_maps_flutter_example 2 | description: Demonstrates how to use the amap_maps_flutter plugin. 3 | publish_to: 'none' 4 | version: 0.0.1 5 | 6 | environment: 7 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | # The following adds the Cupertino Icons font to your application. 14 | # Use with the CupertinoIcons class for iOS style icons. 15 | cupertino_icons: ^0.1.2 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | amap_maps_flutter: 22 | path: ../ 23 | 24 | # For information on the generic Dart part of this file, see the 25 | # following page: https://www.dartlang.org/tools/pub/pubspec 26 | 27 | # The following section is specific to Flutter. 28 | flutter: 29 | 30 | # The following line ensures that the Material Icons font is 31 | # included with your application, so that you can use the icons in 32 | # the material Icons class. 33 | uses-material-design: true 34 | 35 | # To add assets to your application, add an assets section, like this: 36 | # assets: 37 | # - images/a_dot_burr.jpeg 38 | # - images/a_dot_ham.jpeg 39 | 40 | # An image asset can refer to one or more resolution-specific "variants", see 41 | # https://flutter.io/assets-and-images/#resolution-aware. 42 | 43 | # For details regarding adding assets from package dependencies, see 44 | # https://flutter.io/assets-and-images/#from-packages 45 | 46 | # To add custom fonts to your application, add a fonts section here, 47 | # in this "flutter" section. Each entry in this list should have a 48 | # "family" key with the font family name, and a "fonts" key with a 49 | # list giving the asset and other descriptors for the font. For 50 | # example: 51 | # fonts: 52 | # - family: Schyler 53 | # fonts: 54 | # - asset: fonts/Schyler-Regular.ttf 55 | # - asset: fonts/Schyler-Italic.ttf 56 | # style: italic 57 | # - family: Trajan Pro 58 | # fonts: 59 | # - asset: fonts/TrajanPro.ttf 60 | # - asset: fonts/TrajanPro_Bold.ttf 61 | # weight: 700 62 | # 63 | # For details regarding fonts from package dependencies, 64 | # see https://flutter.io/custom-fonts/#from-packages 65 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:amap_maps_flutter_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/amap_maps_flutter/d45bb53c05885f22ee50cfc14819caa13e8d0a64/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/AMapController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMapController.h 3 | // Pods 4 | // 5 | // Created by zxy on 2018/12/15. 6 | // 7 | 8 | #import 9 | 10 | @interface AMapController : NSObject 11 | 12 | - (instancetype)initWithFrame:(CGRect)frame 13 | viewIdentifier:(int64_t)viewId 14 | arguments:(id _Nullable)args 15 | registrar:(NSObject*)registrar; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/Classes/AMapController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMapController.m 3 | // amap_maps_flutter 4 | // 5 | // Created by zxy on 2018/12/15. 6 | // 7 | 8 | #import 9 | #import "AMapController.h" 10 | #import 11 | #import 12 | #import "Constants.h" 13 | 14 | static bool toBool(id json); 15 | static int toInt(id json); 16 | static double toDouble(id json); 17 | static float toFloat(id json); 18 | static double toDouble(id json); 19 | static CLLocationCoordinate2D toLocation(id json); 20 | static MAMapStatus* toMapStatus(id json); 21 | 22 | 23 | @implementation AMapController { 24 | 25 | MAMapView * _mapView; 26 | FlutterMethodChannel* _channel; 27 | 28 | NSObject* _registrar; 29 | 30 | // 覆盖物记录 31 | NSMutableDictionary* _annotations; 32 | } 33 | 34 | - (instancetype)initWithFrame:(CGRect)frame 35 | viewIdentifier:(int64_t)viewId 36 | arguments:(id)args 37 | registrar:(NSObject *)registrar { 38 | if ([super init]) { 39 | 40 | NSString* channelName = [NSString stringWithFormat:@"%@%lld", CHANNEL,viewId]; 41 | _channel = [FlutterMethodChannel methodChannelWithName:channelName 42 | binaryMessenger:registrar.messenger]; 43 | __weak __typeof__(self) weakSelf = self; 44 | [_channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { 45 | if (weakSelf) { 46 | [weakSelf onMethodCall:call result:result]; 47 | } 48 | }]; 49 | _mapView = [[MAMapView alloc] initWithFrame:frame]; 50 | _registrar = registrar; 51 | 52 | _annotations =[[NSMutableDictionary alloc] init]; 53 | } 54 | return self; 55 | } 56 | 57 | - (void)onMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 58 | // NSLog(@"AMapController onMethodCall %s" , call.method); 59 | 60 | if ([call.method isEqualToString:MEHTOD_NAME_AMAP_CHANGE_CAMERA]) { 61 | MAMapStatus* mapStauts = toMapStatus(call.arguments[0]); 62 | BOOL isAnimate = toBool(call.arguments[1]); 63 | [self changeCamera:mapStauts animated:isAnimate]; 64 | result(nil); 65 | } else if ([call.method isEqualToString:MEHTOD_NAME_AMAP_ADD_MARKER]) { 66 | NSDictionary* options = call.arguments[@"options"]; 67 | MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init]; 68 | pointAnnotation.coordinate = toLocation(options[@"position"]); 69 | 70 | [_mapView addAnnotation:pointAnnotation]; 71 | 72 | NSString* markerId = @"1"; 73 | 74 | [_annotations setObject:pointAnnotation forKey:markerId]; 75 | 76 | result(markerId); 77 | } else if ([call.method isEqualToString:MEHTOD_NAME_AMAP_UPDATE_MARKER]) { 78 | NSDictionary* options = call.arguments[@"options"]; 79 | NSString* markerId = call.arguments[@"marker"]; 80 | 81 | MAPointAnnotation *pointAnnotation = _annotations[markerId]; 82 | if (pointAnnotation != nil) { 83 | 84 | [pointAnnotation setCoordinate:CLLocationCoordinate2DMake( 85 | [pointAnnotation coordinate].latitude, [pointAnnotation coordinate].longitude + 0.01 86 | )]; 87 | } 88 | 89 | result(nil); 90 | } else { 91 | result(FlutterMethodNotImplemented); 92 | } 93 | 94 | } 95 | 96 | -(UIView *)view { 97 | return _mapView; 98 | } 99 | 100 | //// 操作地图的方法 101 | 102 | - (void)changeCamera:(MAMapStatus *)cameraPosition animated: (BOOL)isAnimate { 103 | if(cameraPosition != nil) { 104 | [_mapView setMapStatus:cameraPosition animated:isAnimate]; 105 | } 106 | } 107 | 108 | @end 109 | 110 | 111 | 112 | static bool toBool(id json) { 113 | NSNumber* data = json; 114 | return data.boolValue; 115 | } 116 | 117 | static int toInt(id json) { 118 | NSNumber* data = json; 119 | return data.intValue; 120 | } 121 | 122 | static double toDouble(id json) { 123 | NSNumber* data = json; 124 | return data.doubleValue; 125 | } 126 | 127 | static float toFloat(id json) { 128 | NSNumber* data = json; 129 | return data.floatValue; 130 | } 131 | 132 | static CLLocationCoordinate2D toLocation(id json) { 133 | NSArray* data = json; 134 | return CLLocationCoordinate2DMake(toDouble(data[0]), toDouble(data[1])); 135 | } 136 | 137 | static CGPoint toPoint(id json) { 138 | NSArray* data = json; 139 | return CGPointMake(toDouble(data[0]), toDouble(data[1])); 140 | } 141 | 142 | static MAMapStatus* toMapStatus(id json) { 143 | NSDictionary* data = json; 144 | return [MAMapStatus statusWithCenterCoordinate:toLocation(data[@"target"]) zoomLevel:toFloat(data[@"zoom"]) rotationDegree:toFloat(data[@"bearing"]) cameraDegree:toFloat(data[@"tilt"]) screenAnchor:CGPointMake(0.5,0.5)]; 145 | } 146 | -------------------------------------------------------------------------------- /ios/Classes/AMapFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AMapFactory.h 3 | // amap_maps_flutter 4 | // 5 | // Created by zxy on 2018/12/15. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface AMapFactory : NSObject 12 | - (instancetype)initWithRegistrar:(NSObject*)registrar; 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Classes/AMapFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AMapFactory.m 3 | // amap_maps_flutter 4 | // 5 | // Created by zxy on 2018/12/15. 6 | // 7 | 8 | #import "AMapFactory.h" 9 | #import "AMapController.h" 10 | 11 | 12 | @implementation AMapFactory { 13 | NSObject* _registrar; 14 | } 15 | 16 | - (instancetype)initWithRegistrar:(NSObject*)registrar { 17 | self = [super init]; 18 | if (self) { 19 | _registrar = registrar; 20 | } 21 | return self; 22 | } 23 | 24 | - (NSObject*)createArgsCodec { 25 | return [FlutterStandardMessageCodec sharedInstance]; 26 | } 27 | 28 | - (NSObject *)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id)args { 29 | return [[AMapController alloc] initWithFrame:frame 30 | viewIdentifier:viewId 31 | arguments:args 32 | registrar:_registrar]; 33 | } 34 | 35 | @end 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ios/Classes/AmapMapsFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface AmapMapsFlutterPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/AmapMapsFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "AmapMapsFlutterPlugin.h" 2 | #import "AMapFactory.h" 3 | #import "Constants.h" 4 | 5 | @implementation AmapMapsFlutterPlugin 6 | + (void)registerWithRegistrar:(NSObject*)registrar { 7 | AMapFactory* aMapFactory = [[AMapFactory alloc] initWithRegistrar:registrar]; 8 | [registrar registerViewFactory:aMapFactory withId:CHANNEL]; 9 | } 10 | 11 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 12 | if ([@"getPlatformVersion" isEqualToString:call.method]) { 13 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 14 | } else { 15 | result(FlutterMethodNotImplemented); 16 | } 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ios/Classes/Constants.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Constants.h 3 | // amap_maps_flutter 4 | // 5 | // Created by zxy on 2018/12/15. 6 | // 7 | 8 | 9 | extern NSString * const CHANNEL; 10 | extern NSString * const METHOD_NAME_CALLBACK_AMAP_ON_MAP_LOADED; 11 | extern NSString * const METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE; 12 | extern NSString * const MEHTOD_NAME_AMAP_CHANGE_CAMERA; 13 | extern NSString * const MEHTOD_NAME_AMAP_ADD_MARKER; 14 | extern NSString * const MEHTOD_NAME_AMAP_UPDATE_MARKER; 15 | -------------------------------------------------------------------------------- /ios/Classes/Constants.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Constants.m 3 | // amap_maps_flutter 4 | // 5 | // Created by zxy on 2018/12/15. 6 | // 7 | 8 | #import "Constants.h" 9 | 10 | 11 | NSString * const CHANNEL = @"plugins.flutter.maps.amap.com/amap_maps_flutter"; 12 | NSString * const METHOD_NAME_CALLBACK_AMAP_ON_MAP_LOADED = @"amap#onMapLoaded"; 13 | NSString * const METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE = @"amap#onCameraChange"; 14 | NSString * const MEHTOD_NAME_AMAP_CHANGE_CAMERA = @"amap#changeCamera"; 15 | NSString * const MEHTOD_NAME_AMAP_ADD_MARKER = @"amap#addMarker"; 16 | NSString * const MEHTOD_NAME_AMAP_UPDATE_MARKER = @"amap#updateMarker"; 17 | -------------------------------------------------------------------------------- /ios/amap_maps_flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'amap_maps_flutter' 6 | s.version = '0.0.1' 7 | s.summary = '高德地图flutter示例' 8 | s.description = <<-DESC 9 | 高德地图flutter示例 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | s.dependency 'AMap3DMap' 19 | 20 | s.ios.deployment_target = '8.0' 21 | end 22 | 23 | -------------------------------------------------------------------------------- /lib/amap_maps_flutter.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | library amap_maps_flutter; 5 | 6 | import 'dart:async'; 7 | import 'dart:ui'; 8 | 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/gestures.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:flutter/services.dart'; 13 | 14 | part 'src/CameraPosition.dart'; 15 | part 'src/LatLng.dart'; 16 | part 'src/AMapController.dart'; 17 | part 'src/AMap.dart'; 18 | part 'src/Callbacks.dart'; 19 | part 'src/Marker.dart'; 20 | part 'src/BitmapDescriptor.dart'; -------------------------------------------------------------------------------- /lib/src/AMap.dart: -------------------------------------------------------------------------------- 1 | part of amap_maps_flutter; 2 | 3 | 4 | /// 5 | /// 地图创建完成回调 6 | /// 7 | typedef void AMapCreatedCallback(AMapController controller); 8 | 9 | 10 | class AMap extends StatefulWidget { 11 | 12 | const AMap({this.onMapCreated, this.gestureRecognizers}); 13 | 14 | final AMapCreatedCallback onMapCreated; 15 | 16 | final Set> gestureRecognizers; 17 | 18 | @override 19 | State createState() => _AMapState(); 20 | 21 | } 22 | 23 | 24 | class _AMapState extends State { 25 | 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | final Map creationParams = { 30 | 'options': null, 31 | }; 32 | 33 | // 使用原生view进行展示 34 | if (defaultTargetPlatform == TargetPlatform.android) { 35 | return AndroidView( 36 | viewType: AMapController.CHANNEL, 37 | onPlatformViewCreated: onPlatformViewCreated, 38 | gestureRecognizers: widget.gestureRecognizers, 39 | creationParams: creationParams, 40 | creationParamsCodec: const StandardMessageCodec(), 41 | ); 42 | } else if (defaultTargetPlatform == TargetPlatform.iOS) { 43 | return UiKitView( 44 | viewType: AMapController.CHANNEL, 45 | onPlatformViewCreated: onPlatformViewCreated, 46 | gestureRecognizers: widget.gestureRecognizers, 47 | creationParams: creationParams, 48 | creationParamsCodec: const StandardMessageCodec(), 49 | ); 50 | } 51 | 52 | return Text( 53 | '$defaultTargetPlatform is not yet supported by the maps plugin'); 54 | } 55 | 56 | void onPlatformViewCreated(int id) { 57 | final AMapController controller = AMapController.init(id); 58 | 59 | if (widget.onMapCreated != null) { 60 | widget.onMapCreated(controller); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /lib/src/AMapController.dart: -------------------------------------------------------------------------------- 1 | part of amap_maps_flutter; 2 | 3 | class AMapController extends ChangeNotifier{ 4 | 5 | static const String CHANNEL = "plugins.flutter.maps.amap.com/amap_maps_flutter"; 6 | 7 | static const String METHOD_NAME_CALLBACK_AMAP_ON_MAP_LOADED = "amap#onMapLoaded"; 8 | static const String METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE = "amap#onCameraChange"; 9 | static const String MEHTOD_NAME_AMAP_CHANGE_CAMERA = "amap#changeCamera"; 10 | static const String MEHTOD_NAME_AMAP_ADD_MARKER = "amap#addMarker"; 11 | static const String MEHTOD_NAME_AMAP_UPDATE_MARKER = "amap#updateMarker"; 12 | 13 | final int _id; 14 | 15 | AMapController._(this._id) 16 | : assert(_id != null) 17 | , 18 | _channel = new MethodChannel(CHANNEL + _id.toString()) 19 | { 20 | _channel.setMethodCallHandler(_handleMethodCall); 21 | } 22 | 23 | final MethodChannel _channel; 24 | 25 | static AMapController init(int id) { 26 | assert(id != null); 27 | return AMapController._(id); 28 | } 29 | 30 | 31 | /// 地图状态发生变化的监听接口。 32 | final ArgumentCallbacks onCameraChanged = ArgumentCallbacks< 33 | CameraPosition>(); 34 | 35 | /// 地图状态发生变化的监听接口。 36 | final ArgumentCallbacks onMapLoaded = ArgumentCallbacks(); 37 | 38 | /// Marker集合 39 | Set get markers => Set.from(_markers.values); 40 | final Map _markers = {}; 41 | 42 | 43 | Future _handleMethodCall(MethodCall call) async { 44 | switch (call.method) { 45 | case METHOD_NAME_CALLBACK_AMAP_ON_MAP_LOADED: 46 | onMapLoaded.call(null); 47 | break; 48 | case METHOD_NAME_CALLBACK_AMAP_ON_CAMERA_CHANGE: 49 | CameraPosition cameraPosition = CameraPosition.fromMap( 50 | call.arguments['position']); 51 | onCameraChanged.call(cameraPosition); 52 | break; 53 | default: 54 | throw MissingPluginException(); 55 | } 56 | } 57 | 58 | 59 | /// 地图操作 60 | void changeCamera(CameraPosition cameraPosition, bool isAnimate) { 61 | if (_channel != null) { 62 | _channel.invokeMethod( 63 | MEHTOD_NAME_AMAP_CHANGE_CAMERA, [cameraPosition._toMap(), isAnimate]); 64 | } 65 | } 66 | 67 | 68 | /// 覆盖物添加 69 | Future addMarker(MarkerOptions options) async { 70 | 71 | final MarkerOptions effectiveOptions = 72 | MarkerOptions.defaultOptions.copyWith(options); 73 | final String markerId = await _channel.invokeMethod( 74 | MEHTOD_NAME_AMAP_ADD_MARKER, 75 | { 76 | 'options': effectiveOptions._toJson(), 77 | }, 78 | ); 79 | final Marker marker = Marker(markerId, effectiveOptions); 80 | _markers[markerId] = marker; 81 | notifyListeners(); 82 | 83 | return marker; 84 | } 85 | 86 | /// 87 | /// 更新Marker内容 转换成内容,各平台再根据id去更新 88 | /// 89 | Future updateMarker(Marker marker, MarkerOptions changes) async { 90 | assert(marker != null); 91 | assert(_markers[marker._id] == marker); 92 | assert(changes != null); 93 | await _channel.invokeMethod(MEHTOD_NAME_AMAP_UPDATE_MARKER, { 94 | 'marker': marker._id, 95 | 'options': changes._toJson(), 96 | }); 97 | marker._options = marker._options.copyWith(changes); 98 | 99 | notifyListeners(); 100 | } 101 | 102 | 103 | /// 104 | /// 工具转换 105 | 106 | } -------------------------------------------------------------------------------- /lib/src/BitmapDescriptor.dart: -------------------------------------------------------------------------------- 1 | 2 | part of amap_maps_flutter; 3 | 4 | /// bitmap 描述信息 5 | /// 在高德地图API 里,如果需要将一张图片绘制为Marker,需要用这个类把图片包装成对象,可以通过BitmapDescriptorFactory 6 | /// 获得一个BitmapDescriptor 对象。 7 | class BitmapDescriptor { 8 | const BitmapDescriptor._(this._json); 9 | 10 | static const double HUE_RED = 0.0; 11 | static const double HUE_ORANGE = 30.0; 12 | static const double HUE_YELLOW = 60.0; 13 | static const double HUE_GREEN = 120.0; 14 | static const double HUE_CYAN = 180.0; 15 | static const double HUE_AZURE = 210.0; 16 | static const double HUE_BLUE = 240.0; 17 | static const double HUE_VIOLET = 270.0; 18 | static const double HUE_MAGENTA = 300.0; 19 | static const double HUE_ROSE = 330.0; 20 | 21 | /// 创建默认的marker 图标的 bitmap 描述信息对象。 22 | static const BitmapDescriptor defaultMarker = 23 | BitmapDescriptor._(['defaultMarker']); 24 | 25 | /// API 提供了10 个颜色的Marker 图标,用户可以通过此方法传入值来调用。请参见本类的常量。 26 | static BitmapDescriptor defaultMarkerWithHue(double hue) { 27 | assert(0.0 <= hue && hue < 360.0); 28 | return BitmapDescriptor._(['defaultMarker', hue]); 29 | } 30 | 31 | /// 根据 asset 目录内资源名称,创建 bitmap 描述信息对象。 32 | static BitmapDescriptor fromAsset(String assetName, {String package}) { 33 | if (package == null) { 34 | return BitmapDescriptor._(['fromAsset', assetName]); 35 | } else { 36 | return BitmapDescriptor._(['fromAsset', assetName, package]); 37 | } 38 | } 39 | 40 | final dynamic _json; 41 | 42 | dynamic _toJson() => _json; 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/Callbacks.dart: -------------------------------------------------------------------------------- 1 | 2 | part of amap_maps_flutter; 3 | 4 | /// 带参数回调 5 | typedef void ArgumentCallback(T argument); 6 | 7 | /// 带参数回调 8 | class ArgumentCallbacks { 9 | final List> _callbacks = >[]; 10 | 11 | /// 依次调用回调中各方法 12 | void call(T argument) { 13 | final int length = _callbacks.length; 14 | if (length == 1) { 15 | _callbacks[0].call(argument); 16 | } else if (0 < length) { 17 | for (ArgumentCallback callback 18 | in List>.from(_callbacks)) { 19 | callback(argument); 20 | } 21 | } 22 | } 23 | 24 | /// 注册监听 25 | void add(ArgumentCallback callback) { 26 | assert(callback != null); 27 | _callbacks.add(callback); 28 | } 29 | 30 | /// 移除监听 31 | void remove(ArgumentCallback callback) { 32 | _callbacks.remove(callback); 33 | } 34 | 35 | /// 判断是否为空 36 | bool get isEmpty => _callbacks.isEmpty; 37 | 38 | /// 判断是否不是空 39 | bool get isNotEmpty => _callbacks.isNotEmpty; 40 | } 41 | -------------------------------------------------------------------------------- /lib/src/CameraPosition.dart: -------------------------------------------------------------------------------- 1 | 2 | part of amap_maps_flutter; 3 | 4 | class CameraPosition { 5 | const CameraPosition({ 6 | this.bearing = 0.0, 7 | @required this.target, 8 | this.tilt = 0.0, 9 | this.zoom = 0.0, 10 | }) : assert(bearing != null), 11 | assert(target != null), 12 | assert(tilt != null), 13 | assert(zoom != null); 14 | 15 | final double bearing; 16 | 17 | final LatLng target; 18 | 19 | final double tilt; 20 | 21 | final double zoom; 22 | 23 | /// 转成map便于传递到平台 24 | dynamic _toMap() => { 25 | 'bearing': bearing, 26 | 'target': target._toJson(), 27 | 'tilt': tilt, 28 | 'zoom': zoom, 29 | }; 30 | 31 | static CameraPosition fromMap(dynamic json) { 32 | if (json == null) { 33 | return null; 34 | } 35 | return CameraPosition( 36 | bearing: json['bearing'], 37 | target: LatLng._fromJson(json['target']), 38 | tilt: json['tilt'], 39 | zoom: json['zoom'], 40 | ); 41 | } 42 | 43 | @override 44 | bool operator ==(dynamic other) { 45 | if (identical(this, other)) return true; 46 | if (runtimeType != other.runtimeType) return false; 47 | final CameraPosition typedOther = other; 48 | return bearing == typedOther.bearing && 49 | target == typedOther.target && 50 | tilt == typedOther.tilt && 51 | zoom == typedOther.zoom; 52 | } 53 | 54 | @override 55 | int get hashCode => hashValues(bearing, target, tilt, zoom); 56 | 57 | @override 58 | String toString() => 59 | 'CameraPosition(bearing: $bearing, target: $target, tilt: $tilt, zoom: $zoom)'; 60 | } -------------------------------------------------------------------------------- /lib/src/LatLng.dart: -------------------------------------------------------------------------------- 1 | part of amap_maps_flutter; 2 | 3 | /// 存储经纬度坐标值的类,单位角度。 4 | class LatLng { 5 | const LatLng(double latitude, double longitude) 6 | : assert(latitude != null), 7 | assert(longitude != null), 8 | latitude = 9 | (latitude < -90.0 ? -90.0 : (90.0 < latitude ? 90.0 : latitude)), 10 | longitude = (longitude + 180.0) % 360.0 - 180.0; 11 | 12 | /// 纬度 (垂直方向) 13 | final double latitude; 14 | 15 | /// 经度 (水平方向) 16 | final double longitude; 17 | 18 | 19 | @override 20 | String toString() => '$runtimeType($latitude, $longitude)'; 21 | 22 | @override 23 | bool operator ==(Object o) { 24 | return o is LatLng && o.latitude == latitude && o.longitude == longitude; 25 | } 26 | 27 | @override 28 | int get hashCode => hashValues(latitude, longitude); 29 | 30 | 31 | /// 传递到平台的时候更方便 32 | dynamic _toJson() { 33 | return [latitude, longitude]; 34 | } 35 | 36 | static LatLng _fromJson(dynamic json) { 37 | if (json == null) { 38 | return null; 39 | } 40 | return LatLng(json[0], json[1]); 41 | } 42 | 43 | } 44 | 45 | 46 | /// 代表了经纬度划分的一个矩形区域。 47 | class LatLngBounds { 48 | 49 | /// 50 | /// 使用传入的西南角坐标和东北角坐标创建一个矩形区域。 51 | /// 52 | /// @param southwest 西南角坐标。 53 | /// @param northeast 东北角坐标。 54 | /// 55 | LatLngBounds({@required this.southwest, @required this.northeast}) 56 | : assert(southwest != null), 57 | assert(northeast != null), 58 | assert(southwest.latitude <= northeast.latitude); 59 | 60 | final LatLng southwest; 61 | 62 | final LatLng northeast; 63 | 64 | /// 传递到平台的时候更方便 65 | dynamic _toList() { 66 | return [southwest._toJson(), northeast._toJson()]; 67 | } 68 | 69 | 70 | @override 71 | String toString() { 72 | return '$runtimeType($southwest, $northeast)'; 73 | } 74 | 75 | @override 76 | bool operator ==(Object o) { 77 | return o is LatLngBounds && 78 | o.southwest == southwest && 79 | o.northeast == northeast; 80 | } 81 | 82 | @override 83 | int get hashCode => hashValues(southwest, northeast); 84 | } -------------------------------------------------------------------------------- /lib/src/Marker.dart: -------------------------------------------------------------------------------- 1 | part of amap_maps_flutter; 2 | 3 | /// 定义地图 Marker 覆盖物 Marker 是在地图上的一个点绘制图标。这个图标和屏幕朝向一致,和地图朝向无关,也不会受地图的旋转、倾斜、缩放影响。 4 | /// 一个marker有如下属性: 5 | /// 6 | /// 锚点:图标摆放在地图上的基准点。默认情况下,锚点是从图片下沿的中间处。 7 | /// 位置:marker是通过经纬度的值来标注在地图上的。 8 | /// 标题:当点击Marker 显示在信息窗口的文字,随时可以更改。 9 | /// 片段:除了标题外其他的文字,随时可以更改。 10 | /// 图标:Marker 显示的图标。如果未设置图标,API 将使用默认的图标,高德为默认图标提供了10 种颜色备选。默认情况下,Marker 是可见的。你们随时更改marker 的可见性。 11 | /// 12 | /// 13 | 14 | class Marker { 15 | 16 | Marker(this._id, this._options); 17 | 18 | /// marker 唯一标识 19 | final String _id; 20 | 21 | String get id => _id; 22 | 23 | /// 属性集合 24 | MarkerOptions _options; 25 | 26 | MarkerOptions get options => _options; 27 | } 28 | 29 | 30 | dynamic _offsetToJson(Offset offset) { 31 | if (offset == null) { 32 | return null; 33 | } 34 | return [offset.dx, offset.dy]; 35 | } 36 | 37 | 38 | /// Marker 的选项类。 39 | /// 包含Marker所有的熟悉 40 | class MarkerOptions { 41 | /// Marker 的选项类。 42 | const MarkerOptions({ 43 | this.alpha, 44 | this.anchorU, 45 | this.anchorV, 46 | this.draggable, 47 | this.flat, 48 | this.icon, 49 | this.position, 50 | this.rotation, 51 | this.visible, 52 | this.zIndex, 53 | }) : assert(alpha == null || (0.0 <= alpha && alpha <= 1.0)); 54 | 55 | 56 | /// 设置Marker覆盖物的透明度 57 | // alpha 透明度范围[0,1] 1为不透明 58 | final double alpha; 59 | 60 | /// 设置Marker覆盖物的锚点比例。锚点是marker 图标接触地图平面的点。图标的左顶点为(0,0)点,右底点为(1,1)点。
61 | /// 62 | /// 默认为(0.5,1.0) 63 | /// @param u 锚点水平范围的比例,建议传入0 到1 之间的数值。 64 | /// @param v 锚点垂直范围的比例,建议传入0 到1 之间的数值。 65 | final double anchorU; 66 | final double anchorV; 67 | 68 | /// 一个布尔值,表示Marker是否可拖拽,true表示可拖拽,false表示不可拖拽。 69 | final bool draggable; 70 | 71 | /// 若marker平贴在地图上返回 true;若marker面对镜头返回 false。 72 | final bool flat; 73 | 74 | /// 设置Marker覆盖物的图标。相同图案的 icon 的 Marker 最好使用同一个 BitmapDescriptor 对象以节省内存空间。 75 | final BitmapDescriptor icon; 76 | 77 | /// 设置Marker覆盖物的位置坐标。Marker经纬度坐标不能为Null,坐标无默认值。 78 | final LatLng position; 79 | 80 | /// 设置Marker覆盖物的图片旋转角度,从正北开始,逆时针计算。 81 | final double rotation; 82 | 83 | /// 设置Marker覆盖物是否可见。 84 | final bool visible; 85 | 86 | /// 设置Marker覆盖物 zIndex。 87 | final double zIndex; 88 | 89 | 90 | // 91 | // /// 是否传递点击事件 92 | // final bool consumeTapEvents; 93 | // 94 | // /// The icon image point that will be the anchor of the info window when 95 | // /// displayed. 96 | // /// 97 | // /// The image point is specified in normalized coordinates: An anchor of 98 | // /// (0.0, 0.0) means the top left corner of the image. An anchor 99 | // /// of (1.0, 1.0) means the bottom right corner of the image. 100 | // final Offset infoWindowAnchor; 101 | // 102 | // /// Text content for the info window. 103 | // final InfoWindowText infoWindowText; 104 | 105 | 106 | /// 默认 marker options. 107 | static const MarkerOptions defaultOptions = MarkerOptions( 108 | alpha: 1.0, 109 | anchorU: 0.5, 110 | anchorV: 1.0, 111 | draggable: false, 112 | flat: false, 113 | icon: BitmapDescriptor.defaultMarker, 114 | position: LatLng(39.893927, 116.405972), 115 | rotation: 0.0, 116 | visible: true, 117 | zIndex: 0.0, 118 | ); 119 | 120 | /// 根据已有属性生成 121 | MarkerOptions copyWith(MarkerOptions changes) { 122 | if (changes == null) { 123 | return this; 124 | } 125 | return MarkerOptions( 126 | alpha: changes.alpha ?? alpha, 127 | anchorU: changes.anchorU ?? anchorU, 128 | anchorV: changes.anchorV ?? anchorV, 129 | draggable: changes.draggable ?? draggable, 130 | flat: changes.flat ?? flat, 131 | icon: changes.icon ?? icon, 132 | position: changes.position ?? position, 133 | rotation: changes.rotation ?? rotation, 134 | visible: changes.visible ?? visible, 135 | zIndex: changes.zIndex ?? zIndex, 136 | ); 137 | } 138 | 139 | dynamic _toJson() { 140 | final Map json = {}; 141 | 142 | void addIfPresent(String fieldName, dynamic value) { 143 | if (value != null) { 144 | json[fieldName] = value; 145 | } 146 | } 147 | 148 | addIfPresent('alpha', alpha); 149 | addIfPresent('anchorU', anchorU); 150 | addIfPresent('anchorV', anchorV); 151 | addIfPresent('draggable', draggable); 152 | addIfPresent('flat', flat); 153 | addIfPresent('icon', icon?._toJson()); 154 | addIfPresent('position', position?._toJson()); 155 | addIfPresent('rotation', rotation); 156 | addIfPresent('visible', visible); 157 | addIfPresent('zIndex', zIndex); 158 | return json; 159 | } 160 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: amap_maps_flutter 2 | description: 高德地图flutter示例 3 | version: 0.0.1 4 | author: 5 | homepage: 6 | 7 | environment: 8 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | # For information on the generic Dart part of this file, see the 15 | # following page: https://www.dartlang.org/tools/pub/pubspec 16 | 17 | # The following section is specific to Flutter. 18 | flutter: 19 | # This section identifies this Flutter project as a plugin project. 20 | # The androidPackage and pluginClass identifiers should not ordinarily 21 | # be modified. They are used by the tooling to maintain consistency when 22 | # adding or updating assets for this project. 23 | plugin: 24 | androidPackage: com.amap.maps.amapmapsflutter 25 | pluginClass: AmapMapsFlutterPlugin 26 | 27 | # To add assets to your plugin package, add an assets section, like this: 28 | # assets: 29 | # - images/a_dot_burr.jpeg 30 | # - images/a_dot_ham.jpeg 31 | # 32 | # For details regarding assets in packages, see 33 | # https://flutter.io/assets-and-images/#from-packages 34 | # 35 | # An image asset can refer to one or more resolution-specific "variants", see 36 | # https://flutter.io/assets-and-images/#resolution-aware. 37 | 38 | # To add custom fonts to your plugin package, add a fonts section here, 39 | # in this "flutter" section. Each entry in this list should have a 40 | # "family" key with the font family name, and a "fonts" key with a 41 | # list giving the asset and other descriptors for the font. For 42 | # example: 43 | # fonts: 44 | # - family: Schyler 45 | # fonts: 46 | # - asset: fonts/Schyler-Regular.ttf 47 | # - asset: fonts/Schyler-Italic.ttf 48 | # style: italic 49 | # - family: Trajan Pro 50 | # fonts: 51 | # - asset: fonts/TrajanPro.ttf 52 | # - asset: fonts/TrajanPro_Bold.ttf 53 | # weight: 700 54 | # 55 | # For details regarding fonts in packages, see 56 | # https://flutter.io/custom-fonts/#from-packages 57 | --------------------------------------------------------------------------------