【问题标题】:How to use OpenStreetMaps on flutter [duplicate]如何在颤振上使用 OpenStreetMaps [重复]
【发布时间】:2019-03-04 14:36:17
【问题描述】:

我们可以在 Flutter 中使用 Openstreetmap 还是只能使用 Google 地图?我想用另一种方式来显示地图。因为在使用 googlemaps api 密钥时,他们需要知道一张信用卡,而我没有。

【问题讨论】:

标签: flutter openstreetmap


【解决方案1】:

你可以安装这个包flutter_maps来使用OpenStreetMaps

这是一个例子

new FlutterMap(
        options: new MapOptions(
            center: new LatLng(51.5, -0.09),
            zoom: 5.0,
            maxZoom: 5.0,
            minZoom: 3.0),
        layers: [
          new TileLayerOptions(
              urlTemplate:
                  "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
              subdomains: ['a', 'b', 'c']),
        ],
      ),

【讨论】:

    猜你喜欢
    • 2021-10-18
    • 1970-01-01
    • 2021-02-26
    • 2021-09-08
    • 2020-07-13
    • 2021-03-08
    • 2018-11-13
    • 1970-01-01
    • 2019-06-15
    相关资源
    最近更新 更多