flutter - 在 Flutter Web 中显示地图
问题描述
我尝试在颤振网络中加载地图,但除了谷歌地图之外没有地图库可用于网络(我必须为此支付预算(计费))。
有免费的解决方案吗?
解决方案
有多种解决方案:
1.1:添加flutter_map
pubspec.ymal
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 lib https://pub.dev/packages/mapbox_gl
推荐阅读
- mysql - MySQL 数据类型重新插入值
- c# - 类型或命名空间定义,或编译时预期的文件结尾问题
- javascript - Css:如何用边界线连接两个点
- javascript - 从vue上传多个动态文件到laravel
- octobercms - OctoberCMS 更新会话值不起作用
- azurekinect - 有谁知道为什么在使用 WFOW(宽视野)作为深度配置时 Azure Kinect DK 在查看器中崩溃?
- javascript - 有什么方法可以将自定义打字稿接口/类型用于来自 node_modules 的反应组件?
- python - 谷歌云存储:将字符串上传到 GCS 时 CRC32C 和 MD5 不匹配
- python - Pandas 将数据导出到 Excel 文件(超链接)
- javascript - 反应 onChange 不起作用。有人能帮我吗?