qt - 如何从 Qt QML Map 访问 WMS 或 WMTS
问题描述
我想知道是否可以从 QML 地图访问Web Map Service或Web Map Tile Service 。据我所知,没有可用的地理服务插件,所以我猜它需要开发。
WMTS 可能类似于:http://mt0.google.com/vt/lyrs=s&hl=en&x={x}&y={y}&z={z}
或https://c.tile.openstreetmap.org/{z}/{x}/{y}.png
.
我的 QML 地图的代码很简单:
ApplicationWindow {
id: root
width: 512
height: 512
title: qsTr("Title")
visible: true
Plugin {
id: mapPlugin
name: 'osm' // esri
}
Map {
id: map
plugin: mapPlugin
center: QtPositioning.coordinate(60.170448, 24.942046) // Helsinki
zoomLevel: 14
anchors.fill: parent
}
}
我没有找到任何可用的解决方案来解决这个问题。那么,如何编写一个基于 (x,y,z) 三元组执行 WMTS 请求的地理服务插件?
解决方案
您将不得不编写自己的插件。我将根据这个 repo https://github.com/dirkvdb/qt-location-plugin-wmts/tree/develop/plugin做同样的事情
推荐阅读
- php - Laravel 表单验证在表单更新期间不起作用
- apache - 如何将 HTTPS POST 转换为 HTTP POST
- android - 更新firebase云消息依赖后出错
- angular - 从模态子组件更新值到父组件角度 8
- wicket - 为什么当我尝试渲染另一个页面时我的单元测试给了我一个 AssertionFailedError
- odoo - 为什么相关字段使用Write函数
- firebase - 在网络应用程序中有多个 onAuthStateChanged() 调用
- angular - 如何为primeng自动完成设置默认值
- sql - 如何在greenplum中对第一个表的数据进行排序后从另一个表插入表
- c# - 项目B安装时自动安装项目A