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
| import QtQuick 2.0
import QtQuick.Window 2.0
import QtLocation 5.6
import QtPositioning 5.6
Window {
width: 1024
height: 1024
visible: true
Plugin {
id: mapPlugin
name: "osm"
}
PositionSource {
id: positionSource
}
Map {
id: map
anchors.fill: parent
plugin: mapPlugin
center: QtPositioning.coordinate(47.08, 2.40)
zoomLevel: 6.5
property MapCircle circle
Component.onCompleted: {
circle = Qt.createQmlObject('import QtLocation 5.3; MapCircle {}', page)
circle.center = positionSource.position.coordinate
circle.radius = 5000.0
circle.color = green
circle.border.width = 10
map.addMapItem(circle)
}
}
} |
Partager