Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
itemsoverlay.qdoc
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page location-plugin-itemsoverlay.html
6\title Qt Location Items Overlay Plugin
7\ingroup QtLocation-plugins
8
9\brief Provides an empty map intended to be used as background for an overlay layers for map items.
10
11\section1 Overview
12
13This geo services plugin is a special plugin providing only an empty map.
14This plugin provides no services, and is intended to be used in those cases where a \l Map element should
15only show the added map items.
16
17The Items Overlay geo services plugin can be loaded by using the plugin key "itemsoverlay".
18
19\section1 Example usage
20
21The following snippet shows how a Map using this plugin can be added as an overlay to display
22anti-aliased map items.
23Note that for such an overlay Map to be transparent, it is also necessary to set its color to
24a transparent one, such as \b transparent, like in the example.
25
26 \qml
27 Window {
28 id: win
29 visible: true
30 width: 640
31 height: 640
32
33 Map {
34 id: mapBase
35 gesture.enabled: true
36 anchors.fill: parent
37 plugin: Plugin { name: "osm" }
38 center: QtPositioning.coordinate(45,10)
39 zoomLevel: 4
40 z: parent.z + 1
41 }
42
43 Map {
44 id: mapOverlay
45 anchors.fill: parent
46 plugin: Plugin { name: "itemsoverlay" }
47 gesture.enabled: false
48 center: mapBase.center
49 color: 'transparent' // Necessary to make this map transparent
50 minimumFieldOfView: mapBase.minimumFieldOfView
51 maximumFieldOfView: mapBase.maximumFieldOfView
52 minimumTilt: mapBase.minimumTilt
53 maximumTilt: mapBase.maximumTilt
54 minimumZoomLevel: mapBase.minimumZoomLevel
55 maximumZoomLevel: mapBase.maximumZoomLevel
56 zoomLevel: mapBase.zoomLevel
57 tilt: mapBase.tilt;
58 bearing: mapBase.bearing
59 fieldOfView: mapBase.fieldOfView
60 z: mapBase.z + 1
61
62 MapCircle {
63 id: circle
64 center: QtPositioning.coordinate(44, 10)
65 radius: 200000
66 border.width: 5
67
68 MouseArea {
69 anchors.fill: parent
70 drag.target: parent
71 }
72 }
73
74 // The code below enables SSAA
75 layer.enabled: true
76 layer.smooth: true
77 property int w : mapOverlay.width
78 property int h : mapOverlay.height
79 property int pr: Screen.devicePixelRatio
80 layer.textureSize: Qt.size(w * 2 * pr, h * 2 * pr)
81 }
82 }
83 \endqml
84
85*/