summaryrefslogtreecommitdiff
path: root/src/location/doc/src/plugins/itemsoverlay.qdoc
blob: c4e70a96c5ae873ff3ccdf53093bf3163edd692b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page location-plugin-itemsoverlay.html
\title Qt Location Items Overlay Plugin
\ingroup QtLocation-plugins

\brief Provides an empty map intended to be used as background for an overlay layers for map items.

\section1 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 \l Map element should
only show the added map items.

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

\section1 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 \b transparent, like in the example.

    \qml
    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)
        }
    }
    \endqml

*/