Flutter Plugin Based on AutoNavi Open Platform Map SDK

Flutter Plugin Based on AutoNavi Open Platform Map SDK

amap_flutter_map .Flutter plugin based on AutoNavi Open Platform Map SDK

amap_flutter_map

Flutter plugin based on AutoNavi Open Platform Map SDK

Usage

To use the Flutter plug-in, please refer to Using Packages in Flutter , add a reference to amap_flutter_map

Ready to work

Usage example

import 'package:amap_flutter_map_example/base_page.dart';
import 'package:flutter/material.dart';

import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';

class ShowMapPage extends BasePage {
  ShowMapPage(String title, String subTitle) : super(title, subTitle);
  @override
  Widget build(BuildContext context) {
    return _ShowMapPageBody();
  }
}

class _ShowMapPageBody extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _ShowMapPageState();
}

class _ShowMapPageState extends State<_ShowMapPageBody> {
  static final CameraPosition _kInitialPosition = const CameraPosition(
    target: LatLng(39.909187, 116.397451),
    zoom: 10.0,
  );
  List<Widget> _approvalNumberWidget = List<Widget>();
  @override
  Widget build(BuildContext context) {
    final AMapWidget map = AMapWidget(
      initialCameraPosition : _kInitialPosition,
      onMapCreated: onMapCreated,
    );

    return ConstrainedBox(
      constraints: BoxConstraints.expand(),
      child: Stack(
        alignment: Alignment.center,
        children: [
          Container(
            height: MediaQuery.of(context).size.height,
            width: MediaQuery.of(context).size.width,
            child: map,
          ),
          Positioned(
              right: 10,
              bottom: 15,
              child: Container(
                alignment: Alignment.centerLeft,
                child: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: _approvalNumberWidget),
              ))
        ],
      ),
    );
  }

  AMapController _mapController;
  void onMapCreated(AMapController controller) {
    setState(() {
      _mapController = controller;
      getApprovalNumber();
    });
  }

  /// Get the review number
  void  getApprovalNumber () the async {
     // general map plan approval number 
    String mapContentApprovalNumber = 
        the await _mapController ? . getMapContentApprovalNumber ();
     // satellite map plan approval number 
    String satelliteImageApprovalNumber = 
        the await _mapController ? . getSatelliteImageApprovalNumber ();
     setState (() {
       IF ( null  != mapContentApprovalNumber) {
        _approvalNumberWidget.add(Text(mapContentApprovalNumber));
      }
      if (null != satelliteImageApprovalNumber) {
        _approvalNumberWidget.add(Text(satelliteImageApprovalNumber));
      }
    });
    print ( 'Map review number (normal map): $ mapContentApprovalNumber ' );
     print ( 'Map review number (satellite map): $ satelliteImageApprovalNumber ' );
  }
}

Known issues:

  1. When the Flutter plug-in is on the iOS side, when the MapView is destroyed, it will trigger the alarm of the Main Thread Checker with a certain probability. After comparison tests, it is confirmed that it is caused by a Flutter bug; https://github.com/flutter/flutter/issues/68490 (compare 1.25.0 -8.1.pre version has been fixed. According to github issues, there are feedback from other developers that 1.24.0-6.0.pre has been fixed; this issue depends on Flutter upgrade and repair)

Download Details:

Author: dmlzj

Source Code: https://github.com/dmlzj/amap-flutter-map

flutter dart mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

Top 25 Flutter Mobile App Templates in 2020

Flutter has been booming worldwide from the past few years. While there are many popular mobile app development technologies out there, Flutter has managed to leave its mark in the mobile application development world. In this article, we’ve curated the best Flutter app templates available on the market as of July 2020.

Flutter App Development Trends 2020

As the new decade dawns upon us, a slew of technologies has been making a lot of noise to grab the developers’ attention. While native app development is going strong, the trade winds are now blowing towards going cross-platform.

How To Succeed In Mobile App Wireframe Design?

This article covers everything about mobile app wireframe design: what to do and what not, tools used in designing a mobile or web app wireframe, and more.

Top 10 Mobile App Development Companies in India

The mobile application scenario has been continually changing over the years. In recent years India has become a center for mobile app development companies. The increase of smartphones has instantly increased the requirements for these apps. Every year new technological trends occur due to contin