QML OpenStreetMap自定义图块

时间:2018-11-02 03:39:31

标签: qt qml openstreetmap tiles

我想在我的QML项目中使用OSM插件。但是我真的不喜欢Qt提供的默认图块的外观。

我发现,可以为自定义切片服务器的url字符串指定osm.mapping.custom.host。我还从图块服务器列表https://wiki.openstreetmap.org/wiki/Tile_servers中选择了要使用的图块(“人道主义地图样式”)。

我想知道,我应该在osm.mapping.custom.host字段中提供些什么,以更改具有人道主义地图样式图块的默认图块?

1 个答案:

答案 0 :(得分:0)

基本上,这是添加自定义图块所需的全部内容。 “值”位于基于OpenStreetMap数据的图块服务器上(可以找到更多here,使用“ tiles url”,并且不要忘记擦除“ $ {z} / $ {x} / $ {y } .png')

Map
{
    id: map
    anchors.fill: parent
    plugin: Plugin
    {
        name: "osm"
        PluginParameter
        {
            name: "osm.mapping.custom.host"
            value: "http://a.tile.openstreetmap.fr/hot/"
        }
    }
    activeMapType: supportedMapTypes[supportedMapTypes.length - 1]
}
相关问题