【问题标题】:Show Map in the Flutter Web在 Flutter Web 中显示地图
【发布时间】:2021-05-20 07:57:25
【问题描述】:

我尝试在 Flutter Web 中加载地图,但除了谷歌地图(我必须为此支付预算(计费))之外,没有可用于 Web 的地图库。

有没有免费的解决方案?

【问题讨论】:

    标签: flutter dictionary dart openstreetmap flutter-web


    【解决方案1】:

    有多种解决方案:

    1.1:在 pubspec.ymal 中添加 flutter_map

    1.2:将FlutterMap(TileLayerWidget(TileLayerOptions(urlTemplate:''))) 小部件添加到您希望的任何页面

    1.3:在urltemplate添加你感兴趣的地图地址提供者。例如 OSM 地图瓦片地址提供者是

    "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
    

    或 bing 地址映射提供程序是“https://atlas.microsoft.com/map/tile/png?api-version=1&layer=basic&style=main&tileSize=256&view=Auto&zoom={z}&x={x}&y= {y}&subscription-key={subscriptionKey}","

    1.4:享受你的地图

    2.1: 使用 mapbox 库 https://pub.dev/packages/mapbox_gl

    【讨论】:

      猜你喜欢
      • 2020-07-20
      • 2021-11-04
      • 2020-01-07
      • 2020-01-14
      • 2019-09-27
      • 2020-12-16
      • 2020-04-10
      • 2020-08-01
      • 2021-12-06
      相关资源
      最近更新 更多