• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Flutter plugin use amap.高德地图flutter组件

flutter_amap

高德地图3d flutter组件。

展示原生android、ios高德地图,并与flutter交互。

注意:随着flutter版本的提升, 本项目也会随之更新,目前这个版本只能在单独的controller或者activity中打开高德地图。

Getting Started

集成高德地图android版本

1、先申请一个apikey http://lbs.amap.com/api/android-sdk/guide/create-project/get-key

2、在AndroidManifest.xml中增加

 <meta-data
            android:name="com.amap.api.v2.apikey"
            android:value="你的Key" />

3、增加对应的权限:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

4、增加要显示的activity:

<activity android:name="com.jzoom.flutteramap.AMapActivity" android:theme="@style/Theme.AppCompat.Light.DarkActionBar"/>

集成高德地图ios版本

1、申请一个key http://lbs.amap.com/api/ios-sdk/guide/create-project/get-key

直接在dart文件中设置key

import 'package:flutter_amap/flutter_amap.dart';
   
   void main(){
     FlutterAmap.setApiKey("你的key");
     runApp(ne w MyApp());
   }

2、在info.plist中增加:

<key>NSLocationWhenInUseUsageDescription</key>
<string>要用定位</string>

How to use

先导入dart包 修改pubspec.yaml,增加依赖:

dependencies:
  flutter_amap: "^0.0.1"

在要用的地方导入:

import 'package:flutter_amap/flutter_amap.dart';

然后就可以使用了

 FlutterAmap amap = new FlutterAmap();
 
 void show(){
     amap.show(
         mapview: new AMapView(
             centerCoordinate: new LatLng(39.9242, 116.3979),
             zoomLevel: 13.0,
             mapType: MapType.night,
             showsUserLocation: true),
         title: new TitleOptions(title: "我的地图"));
     amap.onLocationUpdated.listen((Location location){
 
       print("Location changed $location") ;
 
     });
   }

特性

  • android支持
  • ios 支持
  • 不需要新增Activity或Controller就可以展示地图
  • 地图的展示和隐藏
  • 设置地图位置
  • 基本地图选项
  • 定位回调
  • 展示定制的地图Mark
  • 搜索api
  • 更多api

More Repositories

1

flutter_swiper

The best swiper for flutter , with multiple layouts, infinite loop. Compatible with Android & iOS.
Dart
3,501
star
2

transformer_page_view

PageTransformer for flutter
Dart
518
star
3

flutter_amap_location

高德地图flutter定位组件
Dart
274
star
4

flutter_dropdown_menu

A dropdown menu for Flutter.
Dart
265
star
5

flutter_page_indicator

Page indicator for flutter, with multiple build-in layouts.
Dart
180
star
6

flutter_jpush

Flutter版本jpush
Objective-C
142
star
7

flutter_alipay

A flutter plugin to use alipay.
Dart
135
star
8

flutter_refresh

A Flutter plugin for refreshing every scrollable view by pulling down-up.
Dart
71
star
9

flutter_location_picker

A location area picker for flutter 省市区位置选择器
Dart
63
star
10

sweetalert

sweetalert for flutter
Dart
56
star
11

flutter_wechat_ble

ble 4.0 with wechat style api for flutter. flutter版微信api风格的低功耗蓝牙
Dart
53
star
12

gbk2utf8

A flutter package to convert gbk to utf-8
Dart
43
star
13

flutter-lover

我们是一群热爱flutter的开发者,我们的目标是让更多人爱上flutter,让移动开发变得更加高效、简单。
36
star
14

easy_alert

A package for flutter to use alert and toast within one line code.
Dart
32
star
15

disk_lru_cache

Disk lru cache for flutter.
Dart
31
star
16

flutter_baidu_location

A flutter plugin for baidu geo location.百度地图定位flutter插件
Dart
22
star
17

linker

A plugin for flutter to link with other app.
Dart
21
star
18

lazy_indexed_stack

懒加载IndexedStack,IndexedStack默认全部加载children,在某些情况下我们不希望这样,lazy_indexed_stack在index被访问之后才加载对应的视图
Dart
20
star
19

flutter_statusbar

A flutter plugin to fetch statusbar info like height.
Ruby
16
star
20

binding_helper

A easy way to use WidgetsBind like get rect of your widget
Dart
10
star
21

flutter_easy_nfc

nfc for flutter,android only
Java
7
star
22

dva

dva for flutter, flutter版dva。
Dart
4
star
23

flutter_rongcloud

融云im flutter版本,开发中
Dart
4
star
24

flutter_umpush

flutter友盟推送插件
3
star
25

flutter_issue

flutter的问题、坑汇总,总结便于大家查找
3
star
26

puremvc

flutter版本puremvc
Dart
2
star
27

refresh_view

Dart
2
star
28

flutter_awesome

flutter资源整理, flutter教程、flutter开源库、flutter问题汇总、flutter文章
1
star