# flutter_2d_amap **Repository Path**: TomarsNi/flutter_2d_amap ## Basic Information - **Project Name**: flutter_2d_amap - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-13 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # flutter_2d_amap 本插件主要服务于 [flutter_deer](https://github.com/simplezhli/flutter_deer)。仅保持现有功能,需要的功能可自行拓展。 高德2D地图插件(已支持[1.12版本新的android插件api]("https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration")) ## 效果展示 ## 实现功能包括 * 处理地图所需权限申请 * 定位并自动移动地图至当前位置 * 默认获取POI数据并返回 * 支持传入经纬度来移动地图 * 支持搜索POI ## 使用方式 ```dart flutter_2d_amap: git: url: https://github.com/simplezhli/flutter_2d_amap.git import 'package:flutter_2d_amap/flutter_2d_amap.dart'; AMap2DView( onPoiSearched: (result) { }, onAMap2DViewCreated: (controller) { }, ) ``` ### Android AndroidManifest.xml 中添加: ```java ``` 如果你的`targetSdkVersion`为27以上,则需要做以下配置来支持http明文请求(具体可以看demo),否则会导致地图加载不出: AndroidManifest.xml 中添加: ```java ``` 在 res 下新增一个 xml 目录,然后创建一个名为:`network_security_config.xml` 文件: ```xml ``` ### iOS 使用前设置key: ```dart Flutter2dAMap.setApiKey("配置你的key"); ``` 在info.plist中增加: ```xml NSLocationAlwaysAndWhenInUseUsageDescription 地图功能需要您的定位服务,否则无法使用,如果您需要使用后台定位功能请选择“始终允许”。 NSLocationAlwaysUsageDescription 地图功能需要您的定位服务,否则无法使用。 NSLocationWhenInUseUsageDescription 地图功能需要您的定位服务,否则无法使用。 io.flutter.embedded_views_preview ``` ## License Copyright 2019 simplezhli Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.