【问题标题】:map_view flutter, how to change plugin to add variable location latitude and longitudemap_view 颤动,如何更改插件以添加可变位置纬度和经度
【发布时间】:2018-09-30 07:33:21
【问题描述】:

您好,我不知道如何更改 map_view 插件:localition.dart,以便能够使用可变纬度和经度。不像目前那样修复 lat 和 long。

https://github.com/apptreesoftware/flutter_google_map_view/tree/master/lib

locations.dart(插件 map_view):

import 'location.dart';

class Locations {
  static Location portland = new Location(37.0902, 37.0902);
  static Location centerOfUSA = new Location(37.0902, -95.7192);
}

main.dart (app):

@override
initState() {
super.initState();


cameraPosition = new CameraPosition(Locations.portland, 2.0);
staticMapUri = staticMapProvider.getStaticUri(Locations.portland, 20,
    width: 900, height: 400, mapType: StaticMapViewType.hybrid );
}

我想用我的双纬和双长来改变波特兰。

【问题讨论】:

    标签: google-maps plugins flutter


    【解决方案1】:

    Locations.portland 只是一个示例,可能用于测试或其他用途。您可以使用new Location(<your latitude>, <your longitude>); 的任何位置,即new Location(48.8583,2.2944);

    原来如此

    staticMapUri = staticMapProvider.getStaticUri(
      new Location(48.8583,2.2944), 20,
      width: 900, height: 400, mapType: StaticMapViewType.hybrid,
    );
    

    【讨论】:

    • 感谢您的快速回复,我试过了,但我有一条消息“NoShuchMethodeError: The getter 'center' was called on null, Receiver : null, Tried call : center . 我想我需要与 le 插件 (static_map_provider) 通信,但我无法将她的双纬度、经度与我的双纬经度联系起来。我试图将我的页面导入插件,但我的双精度没有被识别。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多