Qt位置项覆盖插件

Qt Location Items Overlay Plugin

Qt位置项覆盖插件

Overview

概述

This geo services plugin is a special plugin providing only an empty map. This plugin provides no services, and is intended to be used in those cases where a Map element should only show the added map items.

​这个地理服务插件是一个只提供空地图的特殊插件。此插件不提供任何服务,旨在用于Map元素应仅显示添加的地图项的情况。

The Items Overlay geo services plugin can be loaded by using the plugin key "itemsoverlay".

可以使用插件键“itemsoverlay”加载Items Overlay地理服务插件。

Example usage

示例用法

The following snippet shows how a Map using this plugin can be added as an overlay to display anti-aliased map items. Note that for such an overlay Map to be transparent, it is also necessary to set its color to a transparent one, such as transparent, like in the example.

以下代码片段显示了如何使用此插件将地图添加为覆盖层以显示抗锯齿地图项。请注意,要使这样的叠加贴图透明,还需要将其颜色设置为透明颜色,例如透明,如示例所示。

Window {
    id: win
    visible: true
    width: 640
    height: 640

    Map {
        id: mapBase
        gesture.enabled: true
        anchors.fill: parent
        plugin: Plugin { name: "osm" }
        center: QtPositioning.coordinate(45,10)
        zoomLevel: 4
        z: parent.z + 1
    }

    Map {
        id: mapOverlay
        anchors.fill: parent
        plugin: Plugin { name: "itemsoverlay" }
        gesture.enabled: false
        center: mapBase.center
        color: 'transparent' // Necessary to make this map transparent
        minimumFieldOfView: mapBase.minimumFieldOfView
        maximumFieldOfView: mapBase.maximumFieldOfView
        minimumTilt: mapBase.minimumTilt
        maximumTilt: mapBase.maximumTilt
        minimumZoomLevel: mapBase.minimumZoomLevel
        maximumZoomLevel: mapBase.maximumZoomLevel
        zoomLevel: mapBase.zoomLevel
        tilt: mapBase.tilt;
        bearing: mapBase.bearing
        fieldOfView: mapBase.fieldOfView
        z: mapBase.z + 1

        MapCircle {
            id: circle
            center: QtPositioning.coordinate(44, 10)
            radius: 200000
            border.width: 5

            MouseArea {
                anchors.fill: parent
                drag.target: parent
            }
        }

        // The code below enables SSAA
        layer.enabled: true
        layer.smooth: true
        property int w : mapOverlay.width
        property int h : mapOverlay.height
        property int pr: Screen.devicePixelRatio
        layer.textureSize: Qt.size(w  * 2 * pr, h * 2 * pr)
    }
}

Open Street Map PluginUpgrading to Qt 5

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值