版权声明:版权归博主所有,转载请带上本文链接! https://mp.csdn.net/mdeditor/85122606#
- Plugin, 指定地图的类型
Plugin {
id: myPlugin
name: "osm"// 指定为open street map 地图
}
- map,显示地图,缩小和放大地图,改变位置
Map {
id: map
width: parent.width
anchors.top: searchRow.bottom
anchors.bottom: parent.bottom
plugin: myPlugin
center: locationBeijing
zoomLevel: 15
minimumZoomLevel: 2
gesture.enabled: true
activeMapType: supportedMapTypes[1]
onCenterChanged: {
//console.log("center changed : " + center.longitude + " " + center.latitude)
coordinateText.text = "(" + center.latitude.toFixed(4) +", " + center.longitude.toFixed(4) + ")"
}