diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-02-17 16:22:51 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-03-08 10:00:45 +0000 |
commit | 34c474703f6761a2dafecb219da51c66ebd4709a (patch) | |
tree | 66fa4786736a62ded4ed1d91afd040340fab63e7 /src/location/doc | |
parent | 0be06411a8a8ce8748faa93b5fa767a58f53cb9e (diff) | |
download | qtlocation-34c474703f6761a2dafecb219da51c66ebd4709a.tar.gz |
Add itemsoverlay plugin
This change adds a new plugin that does only offer an empty transparent
map.
The intended usage is to add overlay layers into which to place only map
items.
Change-Id: I51e64b0354f533bf73480e800e0d5338920a7fc5
Reviewed-by: Thiago Marcos P. Santos <tmpsantos@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/doc')
-rw-r--r-- | src/location/doc/src/plugins/itemsoverlay.qdoc | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/src/location/doc/src/plugins/itemsoverlay.qdoc b/src/location/doc/src/plugins/itemsoverlay.qdoc new file mode 100644 index 00000000..7a2d1dec --- /dev/null +++ b/src/location/doc/src/plugins/itemsoverlay.qdoc @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\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 + +*/ |