admin
2021-12-03 f092e392700f68cdbfc545c9801f530d19fd39fa
lib/ui/main/travel_main.dart
@@ -74,7 +74,7 @@
  @override
  void initState() {
    super.initState();
    _animationController = new AnimationController(
    _animationController = AnimationController(
        duration: const Duration(milliseconds: 300), vsync: this);
    final CurvedAnimation curve =
        CurvedAnimation(parent: _animationController!, curve: Curves.easeIn);
@@ -117,7 +117,7 @@
    subscription = await LocationUtil.startLocation(scanspan, (state, map) {
      if (state == LocationState.success) {
        double lat = map!["latitude"] as double;
        double lng = map!["longitude"] as double;
        double lng = map["longitude"] as double;
        currentPosition = BMFCoordinate(lat, lng);
        _mapController!.setCenterCoordinate(BMFCoordinate(lat, lng), true);
        setCurrentPosition(BMFCoordinate(lat, lng));
@@ -134,11 +134,9 @@
  }
  setCurrentPosition(BMFCoordinate position) async {
    Directory? tempDir = await getExternalStorageDirectory();
    String tempPath = tempDir!.path;
    if (userMarker == null) {
      _captureController.capturePng(tempPath + "/portrait.png").then((value) {
        MapUtil.addMarker(_mapController, position, value!.path,
      _captureController.capturePng().then((value) {
        MapUtil.addMarker(_mapController, position, value,
                offset: BMFPoint(0, 40), zIndex: 10)
            .then((value) {
          userMarker = value;
@@ -163,6 +161,7 @@
              child: //----------搜索框--------
                  Flex(
                direction: Axis.horizontal,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Expanded(
                      child: InkWell(
@@ -396,7 +395,7 @@
                      LocationUtil.startLocation(0, (state, map) {
                        if (state == LocationState.success) {
                          double lat = map!["latitude"] as double;
                          double lng = map!["longitude"] as double;
                          double lng = map["longitude"] as double;
                          currentPosition = BMFCoordinate(lat, lng);
                          _mapController!.setCenterCoordinate(
                              BMFCoordinate(lat, lng), true);
@@ -475,7 +474,16 @@
                ),
                InkWell(
                  onTap: () {
                    _startLocation(0);
                    if(travelRECIng){
                      //正在录制轨迹
                      if( Global.currentPosition!=null) {
                        _mapController!.updateMapOptions(BMFMapOptions(center:
                        Global.currentPosition
                        ));
                      }
                    }else {
                      _startLocation(0);
                    }
                  },
                  child: Column(
                    children: [