summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2011-08-31 07:28:24 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-31 07:28:24 +0200
commitfa64a06853f2df2b2d9e2699f3163e2fff173fa3 (patch)
treedf2f7d200daacc4cc93063df3bba724b8d7d6a16
parentb2fcca1c549ce97fca76765dfa0bd13059e262c0 (diff)
parent824c84ae40b128687a77daebd2225cc2fd615d98 (diff)
downloadqtlocation-fa64a06853f2df2b2d9e2699f3163e2fff173fa3.tar.gz
Merge "Merge remote branch 'origin/master' into places" into places
-rw-r--r--.gitignore2
-rw-r--r--examples/declarative/mapviewer/Dialog.qml2
-rw-r--r--examples/declarative/mapviewer/MapComponent.qml559
-rw-r--r--examples/declarative/mapviewer/Marker.qml58
-rw-r--r--examples/declarative/mapviewer/RouteDialog.qml98
-rw-r--r--examples/declarative/mapviewer/common/Checkbox.qml63
-rw-r--r--examples/declarative/mapviewer/common/Optionbutton.qml67
-rw-r--r--examples/declarative/mapviewer/mapviewer.pro2
-rw-r--r--examples/declarative/mapviewer/mapviewer.qml80
-rw-r--r--examples/declarative/mapviewer/mapviewer.qrc8
-rwxr-xr-xexamples/declarative/mapviewer/resources/catch.pngbin0 -> 1374 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/checkbox.pngbin0 -> 419 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/checkbox_selected.pngbin0 -> 493 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/marker.pngbin1712 -> 2354 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/marker_hovered.pngbin1684 -> 2358 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/marker_selected.pngbin1696 -> 2356 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/node.pngbin0 -> 433 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/node_selected.pngbin0 -> 439 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/option_button_selected.pngbin469 -> 417 bytes
-rwxr-xr-xexamples/declarative/mapviewer/resources/scale.pngbin0 -> 258 bytes
-rw-r--r--src/3rdparty/proj.pri151
-rw-r--r--src/3rdparty/proj.pro158
-rw-r--r--src/imports/location/qdeclarativegeomapobject_p.h3
-rw-r--r--src/location/location.pro1
-rw-r--r--src/location/maps/qgeomappingmanagerengine.cpp4
-rw-r--r--src/location/maps/qgeomaptextobject.cpp1
-rw-r--r--src/location/maps/tiled/qgeotiledmappolygonobjectinfo_p.cpp2
-rw-r--r--src/location/maps/tiled/qgeotiledmappolylineobjectinfo_p.cpp2
-rw-r--r--src/location/maps/tiled/qgeotiledmaprouteobjectinfo_p.cpp2
-rw-r--r--src/location/qlocationutils.cpp8
-rw-r--r--src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp8
-rw-r--r--src/src.pro2
-rw-r--r--tests/systemtests/sys_location.qtt113
33 files changed, 969 insertions, 425 deletions
diff --git a/.gitignore b/.gitignore
index 9566aa18..184e5c67 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,8 +96,6 @@ tests/auto/qprocess/fileWriterProcess.txt
.com.apple.timemachine.supported
tests/auto/qlibrary/libmylib.so*
tests/auto/qresourceengine/runtime_resource.rcc
-tools/qtestlib/chart/chart*
-tools/qtestlib/updater/updater*
tools/activeqt/testcon/testcon.tlb
translations/*.qm
translations/*_untranslated.ts
diff --git a/examples/declarative/mapviewer/Dialog.qml b/examples/declarative/mapviewer/Dialog.qml
index 26b6b791..253fe0b7 100644
--- a/examples/declarative/mapviewer/Dialog.qml
+++ b/examples/declarative/mapviewer/Dialog.qml
@@ -143,7 +143,7 @@ Item {
height: 32
Common.Button {
id: buttonClearAll
- text: "Clear All"
+ text: "Clear"
width: 80; height: parent.height
onClicked: {
for (var i = 0; i<length; i++){
diff --git a/examples/declarative/mapviewer/MapComponent.qml b/examples/declarative/mapviewer/MapComponent.qml
index 0ce92e83..b3324131 100644
--- a/examples/declarative/mapviewer/MapComponent.qml
+++ b/examples/declarative/mapviewer/MapComponent.qml
@@ -52,8 +52,7 @@ Map {
property int longPressDuration: 1000
property list<Marker> markers
- property int numberOfMarkers: 0 //actual length of markers array
- property int counter: 0 // counter for total amount of markers. Resets to 0 when numberOfMarkers = 0
+ property int counter: 0 // counter for total amount of markers. Resets to 0 when number of markers = 0
property Marker currentMarker
property RouteQuery routeQuery: RouteQuery {}
@@ -62,12 +61,17 @@ Map {
query: routeQuery
onStatusChanged:{
if (status == RouteModel.Ready){
- if (count == 1) showRouteInfo()
+ if (count == 1) { routeInfoModel.update()}
}
else if (status == RouteModel.Error){
+ clearAll()
map.routeError()
}
}
+ function clearAll(){
+ clear()
+ routeInfoModel.update()
+ }
}
property GeocodeModel geocodeModel: GeocodeModel {
plugin : map.plugin;
@@ -79,13 +83,14 @@ Map {
if (count == 1) map.center = get(0).coordinate
}
}
+ property int lastX : -1
+ property int lastY : -1
signal mousePressed() // replace with
// signal mousePressed(MouseEvent mouse)
// when QTBUG-14550 is fixed
signal sliderUpdated()
signal coordinatesCaptured(double latitude, double longitude)
- signal showRouteInfo()
signal geocodeFinished()
signal showGeocodeInfo()
signal moveMarker()
@@ -95,31 +100,58 @@ Map {
markers = []
}
- onNumberOfMarkersChanged: {
- if (numberOfMarkers == 0) counter = 0
- }
-
Component {
id: routeDelegate
- MapRoute {
- route: path
+ MapGroup {
+ MapRoute {
+ route: path
border.color: routeMouseArea.containsMouse ? "lime" :"red"
border.width: 5
- MapMouseArea {
- id: routeMouseArea
- hoverEnabled: true
- onPressed : {routeTimer.start(); map.state = ""}
- onReleased : { if (routeTimer.running) routeTimer.stop() }//SHORT PRESS
- onPositionChanged: { if (routeTimer.running) routeTimer.stop()}
-
- Timer {
- id: routeTimer
- interval: longPressDuration; running: false; repeat: false
- onTriggered: { //LONG PRESS
- map.showRouteInfo()
+ MapMouseArea {
+ id: routeMouseArea
+
+ hoverEnabled: true
+ onPressed : {
+ routeTimer.start();
+ map.state = ""
+ map.lastX = mouse.x
+ map.lastY = mouse.y
+ }
+ onReleased : {
+ if (routeTimer.running){ //SHORT PRESS
+ routeTimer.stop()
+ map.lastX = -1
+ map.lastY = -1
+ }
+ }
+ onPositionChanged: {
+ if (routeTimer.running) routeTimer.stop()
+ if (map.state == "") {
+ map.lastX = mouse.x
+ map.lastY = mouse.y
+ }
+ }
+ Timer {
+ id: routeTimer
+ interval: longPressDuration; running: false; repeat: false
+ onTriggered: { //LONG PRESS
+ map.state = "RoutePopupMenu"
+ }
}
}
}
+ MapImage {
+ source: routeMouseArea.containsMouse ? "resources/node_selected.png" : "resources/node.png"
+ coordinate:path.path[0]
+ offset.x: -5
+ offset.y: -5
+ }
+ MapImage {
+ source: routeMouseArea.containsMouse ? "resources/node_selected.png" : "resources/node.png"
+ coordinate:path.path[path.path.length-1]
+ offset.x: -5
+ offset.y: -5
+ }
}
}
@@ -127,29 +159,122 @@ Map {
id: pointDelegate
MapCircle {
radius: 1000
- color: circleMouseArea.containsMouse ? "lime" : "#80FF0000"
+ color: circleMouseArea.containsMouse ? "#8000FF00" : "#80FF0000"
center: location.coordinate
MapMouseArea {
id: circleMouseArea
hoverEnabled: true
- onPressed : { circleTimer.start(); map.state = ""}
- onReleased : { if (circleTimer.running) circleTimer.stop() }//SHORT PRESS
+ onPressed : {
+ circleTimer.start()
+ map.state = ""
+ map.lastX = mouse.x
+ map.lastY = mouse.y
+ }
+ onReleased : {
+ if (circleTimer.running) {//SHORT PRESS
+ circleTimer.stop();
+ map.lastX = -1
+ map.lastY = -1
+ }
+ }
onPositionChanged: {
if (circleTimer.running) circleTimer.stop()
- if (mouse.button == Qt.LeftButton) radius = center.distanceTo(mouse.coordinate)
+ if ((mouse.button == Qt.LeftButton) && (map.state == "")) radius = center.distanceTo(mouse.coordinate)
+ if (map.state == "") {
+ map.lastX = mouse.x
+ map.lastY = mouse.y
+ }
}
-
Timer {
id: circleTimer
interval: longPressDuration; running: false; repeat: false
onTriggered: { //LONG PRESS
- map.showGeocodeInfo()
+ map.state = "PointPopupMenu"
}
}
}
}
}
+ Component {
+ id: routeInfoDelegate
+ Row {
+ spacing: 10
+ Text {
+ id: indexText
+ text: index + 1
+ color: "white"
+ font.bold: true
+ font.pixelSize: 12
+ }
+ Text {
+ text: instruction
+ color: "white"
+ height: indexText.height*3
+ wrapMode: Text.Wrap
+ width: textArea.width - indexText.width - distanceText.width - spacing*4
+ }
+ Text {
+ id: distanceText
+ text: distance
+ color: "white"
+ font.bold: true
+ font.pixelSize: 12
+ }
+ }
+ }
+
+ Component{
+ id: routeInfoHeader
+ Item {
+ width: textArea.width
+ height: travelTime.height + line.anchors.topMargin + line.height
+ Text {
+ id: travelTime
+ text: routeInfoModel.travelTime
+ color: "white"
+ font.bold: true
+ font.pixelSize: 14
+ anchors.left: parent.left
+ }
+ Text {
+ id: distance
+ text: routeInfoModel.distance
+ color: "white"
+ font.bold: true
+ font.pixelSize: 14
+ anchors.right: parent.right
+ }
+ Rectangle {
+ id: line
+ color: "white"
+ width: parent.width
+ height: 2
+ anchors.left: parent.left
+ anchors.topMargin: 1
+ anchors.top: distance.bottom
+ }
+ }
+ }
+
+
+ ListModel{
+ id: routeInfoModel
+ property string travelTime
+ property string distance
+
+ function update() {
+ clear()
+ if (routeModel.count > 0){
+ for (var i=0; i< routeModel.get(0).segments.length; i++){
+ append({"instruction": routeModel.get(0).segments[i].maneuver.instructionText, "distance": formatDistance(routeModel.get(0).segments[i].maneuver.distanceToNextInstruction)})
+ }
+ }
+ travelTime = routeModel.count == 0 ? "" : formatTime(routeModel.get(0).travelTime)
+ distance = routeModel.count == 0 ? "" : formatDistance(routeModel.get(0).distance)
+ }
+ }
+
MapObjectView {
model: routeModel
delegate: routeDelegate
@@ -167,10 +292,69 @@ Map {
Coordinate {
id: defaultCoordinates
- latitude : -27.575
+ latitude : -27.53
longitude : 153.088
}
+ Item {
+ id: infoTab
+ parent: scale.parent
+ z: map.z
+ height: parent.height - 180
+ width: parent.width
+ x: -5 - infoRect.width
+ y: 60
+ visible: (routeInfoModel.count > 0)
+ Image {
+ id: catchImage
+ source: "resources/catch.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (infoTab.x == -5) infoTab.x -= infoRect.width
+ else infoTab.x = -5
+ map.state = ""
+ }
+ }
+ }
+
+ Behavior on x {
+ PropertyAnimation { properties: "x"; duration: 300; easing.type: Easing.InOutQuad }
+ }
+
+ Rectangle {
+ id: infoRect
+ width: parent.width - catchImage.sourceSize.width
+ height: parent.height
+ color: "grey"
+ opacity: 0.75
+ radius: 5
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+ Item {
+ id: textArea
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ width: parent.width -15
+ height: parent.height - 20
+ ListView {
+ id: routeInfoView
+ model: routeInfoModel
+ delegate: routeInfoDelegate
+ header: routeInfoHeader
+ anchors.fill: parent
+ clip: true
+ }
+ }
+ }
+ }
+
Common.Slider {
id: zoomSlider;
parent: map.parent //todo: remove the line
@@ -191,6 +375,40 @@ Map {
}
}
+ Item {//scale
+ id: scale
+ parent: zoomSlider.parent
+ z: map.z
+ opacity: 0.6
+ visible: map.zoomLevel == 0 ? false : true
+ anchors {
+ bottom: zoomSlider.top;
+ bottomMargin: 8;
+ leftMargin: 20
+ left: zoomSlider.left
+ }
+ Image {
+ id: scaleImage
+ source: "resources/scale.png"
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ }
+ Text {
+ id: scaleText
+ color: "black"
+ horizontalAlignment: Text.AlignHCenter
+ width: scaleImage.sourceSize.width
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.bottomMargin: 3
+ Component.onCompleted: {text = calculateScale()}
+ }
+ }
+
+ onCenterChanged:{
+ scaleText.text = calculateScale()
+ }
+
Common.Menu {
id: markerMenu
orientation: ListView.Vertical
@@ -241,11 +459,11 @@ Map {
addMarker()
break;
}
- case 1: {
+ case 1: {//show coordinates
map.coordinatesCaptured(mouseArea.lastCoordinate.latitude, mouseArea.lastCoordinate.longitude)
break;
}
- case 2: {
+ case 2: { //delete all Markers
map.deleteAllMarkers()
break;
}
@@ -254,51 +472,187 @@ Map {
}
}
+ Common.Menu {
+ id: routeMenu
+ orientation: ListView.Vertical
+ z: map.z +2
+ opacity: 0
+
+ itemHeight: 30;
+ itemWidth: 150
+ x: 0
+ y: 0
+
+ onClicked: {
+ switch (button) {
+ case 0: {//delete route
+ routeModel.clear()
+ routeInfoModel.update()
+ break;
+ }
+ }
+ map.state = ""
+ }
+ Component.onCompleted: {
+ setModel(["Delete"])
+ }
+ }
+
+ Common.Menu {
+ id: pointMenu
+ orientation: ListView.Vertical
+ z: map.z +2
+ opacity: 0
+
+ itemHeight: 30;
+ itemWidth: 150
+ x: 0
+ y: 0
+
+ onClicked: {
+ switch (button) {
+ case 0: {//point info
+ map.showGeocodeInfo()
+ break;
+ }
+ case 1: {//delete point
+ geocodeModel.clear()
+ break;
+ }
+ }
+ map.state = ""
+ }
+ Component.onCompleted: {
+ setModel(["Info", "Delete"])
+ }
+ }
+
+ onZoomLevelChanged:{
+ zoomSlider.value = map.zoomLevel
+ scaleText.text = map.calculateScale()
+ }
+
+ MapMouseArea {
+ id: mouseArea
+ property Coordinate lastCoordinate: Coordinate { latitude : 0; longitude : 0}
+
+ onPressed : {
+ mapTimer.start()
+ map.state = ""
+ map.lastX = mouse.x
+ map.lastY = mouse.y
+ lastCoordinate = mouse.coordinate
+ map.mousePressed()
+ }
+ onReleased : {
+ if (mapTimer.running) {//SHORT PRESS
+ mapTimer.stop()
+ map.lastX = -1
+ map.lastY = -1
+ }
+ }
+ onPositionChanged: {
+ if (mapTimer.running) mapTimer.stop()
+ if ((mouse.button == Qt.LeftButton) & (map.state == "")) {
+ if ((map.lastX != -1) && (map.lastY != -1)) {
+ var dx = mouse.x - map.lastX
+ var dy = mouse.y - map.lastY
+ map.pan(-dx, -dy)
+ }
+ map.lastX = mouse.x
+ map.lastY = mouse.y
+ }
+ }
+ onDoubleClicked: {
+ map.center = mouse.coordinate
+ if (mouse.button == Qt.LeftButton){
+ map.zoomLevel += 1
+ } else if (mouse.button == Qt.RightButton){
+ map.zoomLevel -= 1
+ }
+ lastX = -1
+ lastY = -1
+ }
+ Timer {
+ id: mapTimer
+ interval: longPressDuration; running: false; repeat: false
+ onTriggered: { //LONG PRESS
+ if (map.markers.length != 0) popupMenu.setModel(["Set Marker","Coordinates","Delete all markers"])
+ else popupMenu.setModel(["Set Marker","Coordinates"])
+
+ map.state = "PopupMenu"
+ }
+ }
+ }
+
+ Keys.onPressed: {
+ if ((event.key == Qt.Key_Plus) || (event.key == Qt.Key_VolumeUp)) {
+ map.zoomLevel += 1
+ } else if ((event.key == Qt.Key_Minus) || (event.key == Qt.Key_VolumeDown)){
+ map.zoomLevel -= 1
+ }
+ }
+
+ function calculateScale(){
+ var coord1, coord2, dist, text
+ if (map.zoomLevel == 0) { text=""}
+ else{
+ coord1 = map.toCoordinate(Qt.point(0,scale.y))
+ coord2 = map.toCoordinate(Qt.point(0+scaleImage.sourceSize.width,scale.y))
+ dist = Math.round(coord1.distanceTo(coord2))
+ text = formatDistance(dist)
+ }
+ return text
+ }
+
function deleteAllMarkers(){
- for (var i = 0; i<numberOfMarkers; i++){
+ var count = map.markers.length
+ for (var i = 0; i<count; i++){
map.removeMapObject(map.markers[i])
map.markers[i].destroy()
}
- map.numberOfMarkers = 0
map.markers = []
+ counter = 0
}
function addMarker(){
var marker, myArray
+ var count = map.markers.length
counter++
marker = Qt.createQmlObject ('Marker {}', map)
map.addMapObject(marker)
//update list of markers
myArray = new Array()
- for (var i = 0; i<numberOfMarkers; i++){
+ for (var i = 0; i<count; i++){
myArray.push(markers[i])
}
myArray.push(marker)
markers = myArray
- ++numberOfMarkers
}
function removeMarker(marker){
//update list of markers
var myArray = new Array()
- for (var i = 0; i<map.numberOfMarkers; i++){
+ var count = map.markers.length
+ for (var i = 0; i<count; i++){
if (marker != map.markers[i]) myArray.push(map.markers[i])
}
map.removeMapObject(marker)
marker.destroy()
- --map.numberOfMarkers
map.markers = myArray
+ if (markers.length == 0) counter = 0
}
function markerLongPress(){
var array
+ var count = map.markers.length
- if (currentMarker == markers[numberOfMarkers-1]) array = ["Delete", "Move to", "Coordinates"]
- else if (numberOfMarkers > 2){
- if (currentMarker == markers[numberOfMarkers-2]) array = ["Delete", "Move to", "Coordinates", "Route to next point"]
+ if (currentMarker == markers[count-1]) array = ["Delete", "Move to", "Coordinates"]
+ else if (count > 2){
+ if (currentMarker == markers[count-2]) array = ["Delete", "Move to", "Coordinates", "Route to next point"]
else array = ["Delete", "Move to", "Coordinates", "Route to next points"]
}
else array = ["Delete", "Move to", "Coordinates", "Route to next point"]
@@ -307,16 +661,11 @@ Map {
map.state = "MarkerPopupMenu"
}
- function updateMarkers(){
- for (var i = 0; i<map.numberOfMarkers; i++){
- map.markers[i].update()
- }
- }
-
function calculateRoute(marker){
routeQuery.clearWaypoints();
var startPointFound = false
- for (var i = 0; i< numberOfMarkers; i++){
+ var count = map.markers.length
+ for (var i = 0; i< count; i++){
if (startPointFound != true){
if (markers[i] == marker){
startPointFound = true
@@ -327,78 +676,48 @@ Map {
}
routeQuery.travelModes = RouteQuery.CarTravel
routeQuery.routeOptimizations = RouteQuery.ShortestRoute
+ for (i=0; i<9; i++) {
+ routeQuery.setFeatureWeight(i, 0)
+ }
routeModel.update();
}
- onCenterChanged: {
- map.updateMarkers()
+ function roundNumber(number, digits) {
+ var multiple = Math.pow(10, digits);
+ return Math.round(number * multiple) / multiple;
}
- onZoomLevelChanged:{
- map.updateMarkers()
- zoomSlider.value = map.zoomLevel
- }
-
- MapMouseArea {
- id: mouseArea
- property int lastX : -1
- property int lastY : -1
- property Coordinate lastCoordinate: Coordinate { latitude : 0; longitude : 0}
-
- onPressed : {
- mapTimer.start()
- map.state = ""
- lastX = mouse.x
- lastY = mouse.y
- lastCoordinate = mouse.coordinate
- map.mousePressed()
- }
- onReleased : {
- if (mapTimer.running) { mapTimer.stop() //SHORT PRESS
- lastX = -1
- lastY = -1
- }
- }
- onPositionChanged: {
- if (mapTimer.running) mapTimer.stop()
- if ((mouse.button == Qt.LeftButton) & (map.state == "")) {
- if ((lastX != -1) && (lastY != -1)) {
- var dx = mouse.x - lastX
- var dy = mouse.y - lastY
- map.pan(-dx, -dy)
- }
- lastX = mouse.x
- lastY = mouse.y
- }
- }
- onDoubleClicked: {
- map.center = mouse.coordinate
- if (mouse.button == Qt.LeftButton){
- map.zoomLevel += 1
- } else if (mouse.button == Qt.RightButton){
- map.zoomLevel -= 1
- }
- lastX = -1
- lastY = -1
- }
- Timer {
- id: mapTimer
- interval: longPressDuration; running: false; repeat: false
- onTriggered: { //LONG PRESS
- if (numberOfMarkers != 0) popupMenu.setModel(["Set Marker","Capture","Delete all markers"])
- else popupMenu.setModel(["Set Marker","Capture"])
-
- map.state = "PopupMenu"
- }
- }
+ function formatTime(sec){
+ var value = sec
+ var seconds = value % 60
+ value /= 60
+ value = (value > 1) ? Math.round(value) : 0
+ var minutes = value % 60
+ value /= 60
+ value = (value > 1) ? Math.round(value) : 0
+ var hours = value
+ if (hours > 0) value = hours + "h:"+ minutes + "m"
+ else value = minutes + "min"
+ return value
}
- Keys.onPressed: {
- if ((event.key == Qt.Key_Plus) || (event.key == Qt.Key_VolumeUp)) {
- map.zoomLevel += 1
- } else if ((event.key == Qt.Key_Minus) || (event.key == Qt.Key_VolumeDown)){
- map.zoomLevel -= 1
- }
+ function formatDistance(meters)
+ {
+ var dist = Math.round(meters)
+ if (dist > 1000 ){
+ if (dist > 100000){
+ dist = Math.round(dist / 1000)
+ }
+ else{
+ dist = Math.round(dist / 100)
+ dist = dist / 10
+ }
+ dist = dist + " km"
+ }
+ else{
+ dist = dist + " m"
+ }
+ return dist
}
// states of map
@@ -406,14 +725,26 @@ Map {
State {
name: "PopupMenu"
PropertyChanges { target: popupMenu; opacity: 1}
- PropertyChanges { target: popupMenu; x: ((mouseArea.lastX + popupMenu.width > map.width) ? map.width - popupMenu.width : mouseArea.lastX)}
- PropertyChanges { target: popupMenu; y: ((mouseArea.lastY + popupMenu.height > map.height) ? map.height - popupMenu.height : mouseArea.lastY)}
+ PropertyChanges { target: popupMenu; x: ((map.lastX + popupMenu.width > map.width) ? map.width - popupMenu.width : map.lastX)}
+ PropertyChanges { target: popupMenu; y: ((map.lastY + popupMenu.height > map.height) ? map.height - popupMenu.height : map.lastY)}
},
State {
name: "MarkerPopupMenu"
PropertyChanges { target: markerMenu; opacity: 1}
PropertyChanges { target: markerMenu; x: ((currentMarker.lastMouseX + markerMenu.width > map.width) ? map.width - markerMenu.width : currentMarker.lastMouseX )}
PropertyChanges { target: markerMenu; y: ((currentMarker.lastMouseY + markerMenu.height > map.height) ? map.height - markerMenu.height : currentMarker.lastMouseY)}
+ },
+ State {
+ name: "RoutePopupMenu"
+ PropertyChanges { target: routeMenu; opacity: 1}
+ PropertyChanges { target: routeMenu; x: ((map.lastX + routeMenu.width > map.width) ? map.width - routeMenu.width : map.lastX)}
+ PropertyChanges { target: routeMenu; y: ((map.lastY + routeMenu.height > map.height) ? map.height - routeMenu.height : map.lastY)}
+ },
+ State {
+ name: "PointPopupMenu"
+ PropertyChanges { target: pointMenu; opacity: 1}
+ PropertyChanges { target: pointMenu; x: ((map.lastX + pointMenu.width > map.width) ? map.width - pointMenu.width : map.lastX)}
+ PropertyChanges { target: pointMenu; y: ((map.lastY + pointMenu.height > map.height) ? map.height - pointMenu.height : map.lastY)}
}
]
}
diff --git a/examples/declarative/mapviewer/Marker.qml b/examples/declarative/mapviewer/Marker.qml
index 6f5ff3eb..9d59db95 100644
--- a/examples/declarative/mapviewer/Marker.qml
+++ b/examples/declarative/mapviewer/Marker.qml
@@ -42,16 +42,20 @@ import QtQuick 2.0;
import Qt.location 5.0
import "common" as Common
- MapImage { //to be used inside MapComponent only
- id: marker
+MapGroup { //to be used inside MapComponent only
+ id: marker
+ property alias coordinate: markerImage.coordinate
+ property alias lastMouseX: markerMouseArea.lastX
+ property alias lastMouseY: markerMouseArea.lastY
+ property alias text: markerIndex.text
+
+ MapImage {
+ id: markerImage
source: markerMouseArea.pressed ? "resources/marker_selected.png" : "resources/marker.png" //TODO replace with following lane when QTBUG-20096 fixed
// source: markerMouseArea.containsMouse ? (markerMouseArea.pressed ? "resources/marker_selected.png" :"resources/marker_hovered.png") : "resources/marker.png"
coordinate: Coordinate { latitude : 0; longitude : 0 }
offset.x: -13
offset.y: -32
- property alias lastMouseX: markerMouseArea.lastX
- property alias lastMouseY: markerMouseArea.lastY
- property alias text: markerIndex.text
Component.onCompleted: {
coordinate = mouseArea.lastCoordinate
@@ -66,12 +70,12 @@ import "common" as Common
property bool longPress: false
hoverEnabled: true
onPressed: {
- marker.z++
+ ++marker.z
var newX, newY, oldX, oldY
newX = map.toScreenPosition(mouse.coordinate).x
newY = map.toScreenPosition(mouse.coordinate).y
- oldX = map.toScreenPosition(marker.coordinate).x
- oldY = map.toScreenPosition(marker.coordinate).y
+ oldX = map.toScreenPosition(markerImage.coordinate).x
+ oldY = map.toScreenPosition(markerImage.coordinate).y
dX = oldX - newX
dY = oldY - newY
lastX = mouse.x
@@ -95,15 +99,13 @@ import "common" as Common
lastY = mouse.y
newX = map.toScreenPosition(mouse.coordinate).x + dX
newY = map.toScreenPosition(mouse.coordinate).y + dY
- marker.coordinate = map.toCoordinate(Qt.point(newX,newY))
- textArea.x = map.toScreenPosition(marker.coordinate).x + offset.x
- textArea.y = map.toScreenPosition(marker.coordinate).y + offset.y
+ markerImage.coordinate = map.toCoordinate(Qt.point(newX,newY))
}
}
Timer {
id: markerTimer
- interval: 1000
+ interval: map.longPressDuration
running: false
repeat: false
onTriggered: {
@@ -112,28 +114,16 @@ import "common" as Common
}
}
}
+ }
- Item {
- id: textArea
- width: 26
- height: 32
- x: map.toScreenPosition(marker.coordinate).x + offset.x
- y: map.toScreenPosition(marker.coordinate).y + offset.y
- Text {
- id: markerIndex
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- z: marker.z
- color: "white"
- font.bold: true
- Component.onCompleted: {
- text = map.counter
- }
- }
- }
-
- function update(){
- textArea.x = map.toScreenPosition(marker.coordinate).x + marker.offset.x
- textArea.y = map.toScreenPosition(marker.coordinate).y + marker.offset.y
+ MapText {
+ id: markerIndex
+ offset.y : -16
+ coordinate: markerImage.coordinate
+ color: "white"
+ font.bold: true
+ Component.onCompleted: {
+ text = map.counter
}
}
+}
diff --git a/examples/declarative/mapviewer/RouteDialog.qml b/examples/declarative/mapviewer/RouteDialog.qml
index 5a3e4744..c74a33ac 100644
--- a/examples/declarative/mapviewer/RouteDialog.qml
+++ b/examples/declarative/mapviewer/RouteDialog.qml
@@ -64,8 +64,8 @@ Item {
property alias endCountry: countryTo.text
property alias byCoordinates: coord.enabled
property int travelMode: RouteQuery.CarTravel // CarTravel, PedestrianTravel, BicycleTravel, PublicTransitTravel, TruckTravel
- property int routeOptimization: RouteQuery.ShortestRoute // ShortestRoute, FastestRoute, MostEconomicRoute, MostScenicRoute
- // TODO NoFeature, TollFeature, HighwayFeature, PublicTransitFeature, FerryFeature, TunnelFeature, DirtRoadFeature, ParksFeature, MotorPoolLaneFeature
+ property int routeOptimization: RouteQuery.FastestRoute // ShortestRoute, FastestRoute, MostEconomicRoute, MostScenicRoute
+ property variant features: [] // NoFeature, TollFeature, HighwayFeature, PublicTransitFeature, FerryFeature, TunnelFeature, DirtRoadFeature, ParksFeature, MotorPoolLaneFeature
Common.Fader {}
@@ -74,7 +74,7 @@ Item {
color: "lightsteelblue"
opacity: 1
width: parent.width - gap*2;
- height: options.height + gap*3 + buttons.height + titleBar.height
+ height: options.height + gap*4 + buttons.height + titleBar.height + routeOptions.height
anchors {
top: parent.top
@@ -361,14 +361,104 @@ Item {
topMargin:gap/3
}
}
+ }
+ }
+ }
+
+ Row {
+ id: routeOptions
+ anchors.top: options.bottom
+ anchors.topMargin: gap
+ anchors.left: parent.left
+ anchors.leftMargin: gap
+ width: parent.width - gap
+ height: checkboxToll.height*2 + gap
+ spacing: gap
+ Column {//travel mode
+ spacing: gap/3
+ height: parent.height
+ width: parent.width/3 - gap
+ Common.Optionbutton {
+ id: optionbuttonVehicle
+ width: parent.width
+ text: "Vehicle"
+ selected: true
+ onClicked: {
+ travelMode = RouteQuery.CarTravel
+ optionbuttonPedestrian.selected = false
+ }
+ }
+ Common.Optionbutton {
+ id: optionbuttonPedestrian
+ width: parent.width
+ text: "Pedestrian"
+ onClicked: {
+ travelMode = RouteQuery.PedestrianTravel
+ optionbuttonVehicle.selected = false
+ }
+ }
+ }
+
+ Column {//Optimization
+ spacing: gap/3
+ height: parent.height
+ width: parent.width/3 - gap
+ Common.Optionbutton {
+ id: optionbuttonFastest
+ width: parent.width
+ text: "Fastest"
+ selected: true
+ onClicked: {
+ routeOptimization = RouteQuery.FastestRoute
+ optionbuttonShortest.selected = false
+ }
+ }
+ Common.Optionbutton {
+ id: optionbuttonShortest
+ width: parent.width
+ text: "Shortest"
+ onClicked: {
+ routeOptimization = RouteQuery.ShortestRoute
+ optionbuttonFastest.selected = false
+ }
+ }
+ }
+
+ Column {//Route features
+ id: routeFeatures
+ spacing: gap/3
+ height: parent.height
+ width: parent.width/3 - gap
+ Common.Checkbox {
+ id: checkboxToll
+ width: parent.width
+ text: "Avoid toll roads"
+ onSelectedChanged: {routeFeatures.updateRouteFeatures()}
+ }
+ Common.Checkbox {
+ id: checkboxHighways
+ width: parent.width
+ text: "Avoid highways"
+ onSelectedChanged: {routeFeatures.updateRouteFeatures()}
+ }
+
+ function updateRouteFeatures(){
+ features = []
+ var myArray = new Array()
+
+ if (checkboxToll.selected) myArray.push(RouteQuery.TollFeature)
+ if (checkboxHighways.selected) myArray.push(RouteQuery.HighwayFeature)
+
+ features = myArray
}
}
}
+
Row {
id: buttons
- anchors.top: options.bottom
+ anchors.top: routeOptions.bottom
anchors.topMargin: gap
anchors.horizontalCenter: parent.horizontalCenter
spacing: gap/3
diff --git a/examples/declarative/mapviewer/common/Checkbox.qml b/examples/declarative/mapviewer/common/Checkbox.qml
new file mode 100644
index 00000000..9f9cecc4
--- /dev/null
+++ b/examples/declarative/mapviewer/common/Checkbox.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.1
+
+Item {
+ id: checkbox
+ property bool selected: false
+ property alias text: checkboxText.text
+ height: checkboxText.height
+
+ Row {
+ id: checkboxRow
+ spacing: 3
+ anchors.fill: parent
+ Image {
+ source: checkbox.selected ? "../resources/checkbox_selected.png" : "../resources/checkbox.png"
+ }
+ Text {
+ id: checkboxText
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { checkbox.selected = !checkbox.selected }
+ }
+}
diff --git a/examples/declarative/mapviewer/common/Optionbutton.qml b/examples/declarative/mapviewer/common/Optionbutton.qml
new file mode 100644
index 00000000..47f00c5d
--- /dev/null
+++ b/examples/declarative/mapviewer/common/Optionbutton.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.1
+
+Item {
+ id: optionbutton
+ property bool selected: false
+ property alias text: optionbuttonText.text
+ height: optionbuttonText.height
+ signal clicked
+
+ Row {
+ id: optionbuttonRow
+ spacing: 3
+ anchors.fill: parent
+ Image {
+ source: optionbutton.selected ? "../resources/option_button_selected.png" : "../resources/option_button.png"
+ }
+ Text {
+ id: optionbuttonText
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ optionbutton.selected = true
+ optionbutton.clicked()
+ }
+ }
+}
diff --git a/examples/declarative/mapviewer/mapviewer.pro b/examples/declarative/mapviewer/mapviewer.pro
index 5d931a8e..adc53344 100644
--- a/examples/declarative/mapviewer/mapviewer.pro
+++ b/examples/declarative/mapviewer/mapviewer.pro
@@ -1,7 +1,7 @@
TARGET = qml_location_mapviewer
TEMPLATE=app
-QT += declarative network
+QT += qtquick1 declarative network
SOURCES += qmlmapviewer.cpp
symbian {
diff --git a/examples/declarative/mapviewer/mapviewer.qml b/examples/declarative/mapviewer/mapviewer.qml
index 2badd2c9..9aa5685d 100644
--- a/examples/declarative/mapviewer/mapviewer.qml
+++ b/examples/declarative/mapviewer/mapviewer.qml
@@ -42,10 +42,9 @@ import QtQuick 2.0
import Qt.location 5.0
import "common" as Common
-FocusScope {
+Item {
anchors.fill: parent
id: page
- focus: true
Rectangle {
id: backgroundRect
@@ -89,8 +88,7 @@ FocusScope {
orientation: ListView.Vertical
z: mainMenu.z - 1
Component.onCompleted: {
- setModel(["Reverse geocode", "Geocode","Search", "Route"])
- disableItem(2)
+ setModel(["Reverse geocode", "Geocode", "Route"])
}
itemHeight: 30;
itemWidth: mainMenu.itemWidth
@@ -108,10 +106,6 @@ FocusScope {
break;
}
case 2: {
- page.state = "Search"
- break;
- }
- case 3: {
page.state = "Route"
break;
}
@@ -274,6 +268,10 @@ FocusScope {
PropertyChanges { target: messageDialog; text: "Unable to find a route for the given points"}
},
State{
+ name: "Coordinates"
+ PropertyChanges { target: messageDialog; title: "Coordinates" }
+ },
+ State{
name: "LocationInfo"
PropertyChanges { target: messageDialog; title: "Location" }
PropertyChanges { target: messageDialog; text: geocodeMessage() }
@@ -325,9 +323,9 @@ FocusScope {
messageDialog.state = "AmbiguousGeocode"
messageDialog.text = count + " results found for the " + st + " point, please specify location"
}
- console.log(" state = " + messageDialog.state)
success = 0
page.state = "Message"
+ map.routeModel.clearAll()
}
}
}
@@ -370,27 +368,16 @@ FocusScope {
map.routeQuery.addWaypoint(endCoordinate)
map.routeQuery.travelModes = routeDialog.travelMode
map.routeQuery.routeOptimizations = routeDialog.routeOptimization
- map.routeModel.update();
- }
- }
-//Search Dialog
- Dialog {
- id: searchDialog
- title: "Search"
- z: mainMenu.z + 1
+ for (var i=0; i<9; i++) {
+ map.routeQuery.setFeatureWeight(i, 0)
+ }
- onGoButtonClicked: {
- page.state = ""
-// searchModel.searchString = dialogModel.get(0).inputText
-// searchModel.update();
- }
- Component.onCompleted: {
- var obj = [["Please enter thing to search:","53 Brandl St, Eight Mile Plains, Australia"]]
- setModel(obj)
- }
- onCancelButtonClicked: {
- page.state = ""
+ for (var i=0; i<routeDialog.features.length; i++) {
+ map.routeQuery.setFeatureWeight(routeDialog.features[i], RouteQuery.AvoidFeatureWeight)
+ }
+
+ map.routeModel.update();
}
}
@@ -523,31 +510,11 @@ FocusScope {
}
onCoordinatesCaptured: {
- messageDialog.title = "Coordinates"
+ messageDialog.state = "Coordinates"
messageDialog.text = "<b>Latitude:</b> " + roundNumber(latitude,4) + "<br/><b>Longitude:</b> " + roundNumber(longitude,4);
page.state = "Message"
}
- onShowRouteInfo: {
- var value = map.routeModel.get(0).travelTime
- var seconds = value % 60
- value /= 60
- value = Math.round(value)
- var minutes = value % 60
- value /= 60
- value = Math.round(value)
- var hours = value
- var dist = roundNumber(map.routeModel.get(0).distance,0)
-
- if (dist>1000) dist = dist/1000 + " km"
- else dist = dist + " m"
-
- messageDialog.title = "Route info"
- messageDialog.text = "<b>Travel time:</b> " + hours + "h:"+ minutes + "m<br/><b>Distance:</b> " + dist;
-
- page.state = "Message"
- }
-
onGeocodeFinished:{
var street, district, city, county, state, countryCode, country, latitude, longitude, text
@@ -601,13 +568,6 @@ FocusScope {
return text
}
-
- function roundNumber(number, digits) {
- var multiple = Math.pow(10, digits);
- var rndedNum = Math.round(number * multiple) / multiple;
- return rndedNum;
- }
-
//=====================States of page=====================
states: [
State {
@@ -623,10 +583,6 @@ FocusScope {
PropertyChanges { target: routeDialog; opacity: 1 }
},
State {
- name: "Search"
- PropertyChanges { target: searchDialog; opacity: 1 }
- },
- State {
name: "Geocode"
PropertyChanges { target: geocodeDialog; opacity: 1 }
},
@@ -669,10 +625,6 @@ FocusScope {
NumberAnimation { properties: "opacity" ; duration: 500; easing.type: Easing.Linear }
},
Transition {
- to: "Search"
- NumberAnimation { properties: "opacity" ; duration: 500; easing.type: Easing.Linear }
- },
- Transition {
to: "Geocode"
NumberAnimation { properties: "opacity" ; duration: 500; easing.type: Easing.Linear }
},
diff --git a/examples/declarative/mapviewer/mapviewer.qrc b/examples/declarative/mapviewer/mapviewer.qrc
index 3f622246..cc2c671b 100644
--- a/examples/declarative/mapviewer/mapviewer.qrc
+++ b/examples/declarative/mapviewer/mapviewer.qrc
@@ -30,5 +30,13 @@
<file>resources/marker.png</file>
<file>resources/marker_selected.png</file>
<file>resources/marker_hovered.png</file>
+ <file>resources/node.png</file>
+ <file>resources/node_selected.png</file>
+ <file>resources/catch.png</file>
+ <file>resources/scale.png</file>
+ <file>resources/checkbox_selected.png</file>
+ <file>resources/checkbox.png</file>
+ <file>common/Checkbox.qml</file>
+ <file>common/Optionbutton.qml</file>
</qresource>
</RCC>
diff --git a/examples/declarative/mapviewer/resources/catch.png b/examples/declarative/mapviewer/resources/catch.png
new file mode 100755
index 00000000..a07dabed
--- /dev/null
+++ b/examples/declarative/mapviewer/resources/catch.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/checkbox.png b/examples/declarative/mapviewer/resources/checkbox.png
new file mode 100755
index 00000000..193eeb3d
--- /dev/null
+++ b/examples/declarative/mapviewer/resources/checkbox.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/checkbox_selected.png b/examples/declarative/mapviewer/resources/checkbox_selected.png
new file mode 100755
index 00000000..fbbf544f
--- /dev/null
+++ b/examples/declarative/mapviewer/resources/checkbox_selected.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/marker.png b/examples/declarative/mapviewer/resources/marker.png
index e2375e3c..a0d6b2df 100755
--- a/examples/declarative/mapviewer/resources/marker.png
+++ b/examples/declarative/mapviewer/resources/marker.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/marker_hovered.png b/examples/declarative/mapviewer/resources/marker_hovered.png
index a974e721..890b67cc 100755
--- a/examples/declarative/mapviewer/resources/marker_hovered.png
+++ b/examples/declarative/mapviewer/resources/marker_hovered.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/marker_selected.png b/examples/declarative/mapviewer/resources/marker_selected.png
index 5d97a17d..2f850ec4 100755
--- a/examples/declarative/mapviewer/resources/marker_selected.png
+++ b/examples/declarative/mapviewer/resources/marker_selected.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/node.png b/examples/declarative/mapviewer/resources/node.png
new file mode 100755
index 00000000..e51978f2
--- /dev/null
+++ b/examples/declarative/mapviewer/resources/node.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/node_selected.png b/examples/declarative/mapviewer/resources/node_selected.png
new file mode 100755
index 00000000..d46347bf
--- /dev/null
+++ b/examples/declarative/mapviewer/resources/node_selected.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/option_button_selected.png b/examples/declarative/mapviewer/resources/option_button_selected.png
index a0c01cf7..4ebb1223 100755
--- a/examples/declarative/mapviewer/resources/option_button_selected.png
+++ b/examples/declarative/mapviewer/resources/option_button_selected.png
Binary files differ
diff --git a/examples/declarative/mapviewer/resources/scale.png b/examples/declarative/mapviewer/resources/scale.png
new file mode 100755
index 00000000..3ceccc5e
--- /dev/null
+++ b/examples/declarative/mapviewer/resources/scale.png
Binary files differ
diff --git a/src/3rdparty/proj.pri b/src/3rdparty/proj.pri
index e075a68e..b954a9ad 100644
--- a/src/3rdparty/proj.pri
+++ b/src/3rdparty/proj.pri
@@ -1,158 +1,7 @@
INCLUDEPATH += $$PWD/proj/include
-SOURCES += $$PWD/proj/PJ_aeqd.c \
- $$PWD/proj/PJ_gnom.c \
- $$PWD/proj/PJ_laea.c \
- $$PWD/proj/PJ_mod_ster.c \
- $$PWD/proj/PJ_nsper.c \
- $$PWD/proj/PJ_nzmg.c \
- $$PWD/proj/PJ_ortho.c \
- $$PWD/proj/PJ_stere.c \
- $$PWD/proj/PJ_sterea.c \
- $$PWD/proj/PJ_aea.c \
- $$PWD/proj/PJ_bipc.c \
- $$PWD/proj/PJ_bonne.c \
- $$PWD/proj/PJ_eqdc.c \
- $$PWD/proj/PJ_imw_p.c \
- $$PWD/proj/PJ_krovak.c \
- $$PWD/proj/PJ_lcc.c \
- $$PWD/proj/PJ_poly.c \
- $$PWD/proj/PJ_rpoly.c \
- $$PWD/proj/PJ_sconics.c \
- $$PWD/proj/proj_rouss.c \
- $$PWD/proj/PJ_cass.c \
- $$PWD/proj/PJ_cc.c \
- $$PWD/proj/PJ_cea.c \
- $$PWD/proj/PJ_eqc.c \
- $$PWD/proj/PJ_gall.c \
- $$PWD/proj/PJ_labrd.c \
- $$PWD/proj/PJ_lsat.c \
- $$PWD/proj/PJ_merc.c \
- $$PWD/proj/PJ_mill.c \
- $$PWD/proj/PJ_ocea.c \
- $$PWD/proj/PJ_omerc.c \
- $$PWD/proj/PJ_somerc.c \
- $$PWD/proj/PJ_tcc.c \
- $$PWD/proj/PJ_tcea.c \
- $$PWD/proj/PJ_tmerc.c \
- $$PWD/proj/PJ_airy.c \
- $$PWD/proj/PJ_aitoff.c \
- $$PWD/proj/PJ_august.c \
- $$PWD/proj/PJ_bacon.c \
- $$PWD/proj/PJ_chamb.c \
- $$PWD/proj/PJ_hammer.c \
- $$PWD/proj/PJ_lagrng.c \
- $$PWD/proj/PJ_larr.c \
- $$PWD/proj/PJ_lask.c \
- $$PWD/proj/PJ_nocol.c \
- $$PWD/proj/PJ_ob_tran.c \
- $$PWD/proj/PJ_oea.c \
- $$PWD/proj/PJ_tpeqd.c \
- $$PWD/proj/PJ_vandg.c \
- $$PWD/proj/PJ_vandg2.c \
- $$PWD/proj/PJ_vandg4.c \
- $$PWD/proj/PJ_wag7.c \
- $$PWD/proj/PJ_lcca.c \
- $$PWD/proj/PJ_geos.c \
- $$PWD/proj/PJ_boggs.c \
- $$PWD/proj/PJ_collg.c \
- $$PWD/proj/PJ_crast.c \
- $$PWD/proj/PJ_denoy.c \
- $$PWD/proj/PJ_eck1.c \
- $$PWD/proj/PJ_eck2.c \
- $$PWD/proj/PJ_eck3.c \
- $$PWD/proj/PJ_eck4.c \
- $$PWD/proj/PJ_eck5.c \
- $$PWD/proj/PJ_fahey.c \
- $$PWD/proj/PJ_fouc_s.c \
- $$PWD/proj/PJ_gins8.c \
- $$PWD/proj/PJ_gstmerc.c \
- $$PWD/proj/PJ_gn_sinu.c \
- $$PWD/proj/PJ_goode.c \
- $$PWD/proj/PJ_hatano.c \
- $$PWD/proj/PJ_loxim.c \
- $$PWD/proj/PJ_mbt_fps.c \
- $$PWD/proj/PJ_mbtfpp.c \
- $$PWD/proj/PJ_mbtfpq.c \
- $$PWD/proj/PJ_moll.c \
- $$PWD/proj/PJ_nell.c \
- $$PWD/proj/PJ_nell_h.c \
- $$PWD/proj/PJ_putp2.c \
- $$PWD/proj/PJ_putp3.c \
- $$PWD/proj/PJ_putp4p.c \
- $$PWD/proj/PJ_putp5.c \
- $$PWD/proj/PJ_putp6.c \
- $$PWD/proj/PJ_robin.c \
- $$PWD/proj/PJ_sts.c \
- $$PWD/proj/PJ_urm5.c \
- $$PWD/proj/PJ_urmfps.c \
- $$PWD/proj/PJ_wag2.c \
- $$PWD/proj/PJ_wag3.c \
- $$PWD/proj/PJ_wink1.c \
- $$PWD/proj/PJ_wink2.c \
- $$PWD/proj/pj_latlong.c \
- $$PWD/proj/pj_geocent.c \
- $$PWD/proj/aasincos.c \
- $$PWD/proj/adjlon.c \
- $$PWD/proj/bch2bps.c \
- $$PWD/proj/bchgen.c \
- $$PWD/proj/biveval.c \
- $$PWD/proj/dmstor.c \
- $$PWD/proj/mk_cheby.c \
- $$PWD/proj/pj_auth.c \
- $$PWD/proj/pj_deriv.c \
- $$PWD/proj/pj_ell_set.c \
- $$PWD/proj/pj_ellps.c \
- $$PWD/proj/pj_errno.c \
- $$PWD/proj/pj_factors.c \
- $$PWD/proj/pj_fwd.c \
- $$PWD/proj/pj_init.c \
- $$PWD/proj/pj_inv.c \
- $$PWD/proj/pj_list.c \
- $$PWD/proj/pj_malloc.c \
- $$PWD/proj/pj_mlfn.c \
- $$PWD/proj/pj_msfn.c \
- $$PWD/proj/proj_mdist.c \
- $$PWD/proj/pj_open_lib_qt.cpp \
- $$PWD/proj/pj_param.c \
- $$PWD/proj/pj_phi2.c \
- $$PWD/proj/pj_pr_list.c \
- $$PWD/proj/pj_qsfn.c \
- $$PWD/proj/pj_strerrno.c \
- $$PWD/proj/pj_tsfn.c \
- $$PWD/proj/pj_units.c \
- $$PWD/proj/pj_zpoly1.c \
- $$PWD/proj/rtodms.c \
- $$PWD/proj/vector1.c \
- $$PWD/proj/pj_release.c \
- $$PWD/proj/pj_gauss.c \
- $$PWD/proj/nad_cvt.c \
- $$PWD/proj/nad_init.c \
- $$PWD/proj/nad_intr.c \
- $$PWD/proj/emess.c \
- $$PWD/proj/pj_apply_gridshift.c \
- $$PWD/proj/pj_datums.c \
- $$PWD/proj/pj_datum_set.c \
- $$PWD/proj/pj_transform.c \
- $$PWD/proj/geocent.c \
- $$PWD/proj/pj_utils.c \
- $$PWD/proj/pj_gridinfo.c \
- $$PWD/proj/pj_gridlist.c \
- $$PWD/proj/pj_mutex.c \
- $$PWD/proj/pj_initcache.c
-
DEFINES += DISABLE_CVSID
-unix {
- DEFINES += MUTEX_pthread
-}
-
symbian {
LIBS += -llibpthread -llibm
}
-
-win32 {
- DEFINES += MUTEX_win32
-}
-
-RESOURCES += $$PWD/proj/data.qrc
diff --git a/src/3rdparty/proj.pro b/src/3rdparty/proj.pro
new file mode 100644
index 00000000..beee478d
--- /dev/null
+++ b/src/3rdparty/proj.pro
@@ -0,0 +1,158 @@
+TEMPLATE=lib
+CONFIG+=static
+
+include(proj.pri)
+
+CONFIG += warn_off
+
+SOURCES += \
+ $$PWD/proj/PJ_aeqd.c \
+ $$PWD/proj/PJ_gnom.c \
+ $$PWD/proj/PJ_laea.c \
+ $$PWD/proj/PJ_mod_ster.c \
+ $$PWD/proj/PJ_nsper.c \
+ $$PWD/proj/PJ_nzmg.c \
+ $$PWD/proj/PJ_ortho.c \
+ $$PWD/proj/PJ_stere.c \
+ $$PWD/proj/PJ_sterea.c \
+ $$PWD/proj/PJ_aea.c \
+ $$PWD/proj/PJ_bipc.c \
+ $$PWD/proj/PJ_bonne.c \
+ $$PWD/proj/PJ_eqdc.c \
+ $$PWD/proj/PJ_imw_p.c \
+ $$PWD/proj/PJ_krovak.c \
+ $$PWD/proj/PJ_lcc.c \
+ $$PWD/proj/PJ_poly.c \
+ $$PWD/proj/PJ_rpoly.c \
+ $$PWD/proj/PJ_sconics.c \
+ $$PWD/proj/proj_rouss.c \
+ $$PWD/proj/PJ_cass.c \
+ $$PWD/proj/PJ_cc.c \
+ $$PWD/proj/PJ_cea.c \
+ $$PWD/proj/PJ_eqc.c \
+ $$PWD/proj/PJ_gall.c \
+ $$PWD/proj/PJ_labrd.c \
+ $$PWD/proj/PJ_lsat.c \
+ $$PWD/proj/PJ_merc.c \
+ $$PWD/proj/PJ_mill.c \
+ $$PWD/proj/PJ_ocea.c \
+ $$PWD/proj/PJ_omerc.c \
+ $$PWD/proj/PJ_somerc.c \
+ $$PWD/proj/PJ_tcc.c \
+ $$PWD/proj/PJ_tcea.c \
+ $$PWD/proj/PJ_tmerc.c \
+ $$PWD/proj/PJ_airy.c \
+ $$PWD/proj/PJ_aitoff.c \
+ $$PWD/proj/PJ_august.c \
+ $$PWD/proj/PJ_bacon.c \
+ $$PWD/proj/PJ_chamb.c \
+ $$PWD/proj/PJ_hammer.c \
+ $$PWD/proj/PJ_lagrng.c \
+ $$PWD/proj/PJ_larr.c \
+ $$PWD/proj/PJ_lask.c \
+ $$PWD/proj/PJ_nocol.c \
+ $$PWD/proj/PJ_ob_tran.c \
+ $$PWD/proj/PJ_oea.c \
+ $$PWD/proj/PJ_tpeqd.c \
+ $$PWD/proj/PJ_vandg.c \
+ $$PWD/proj/PJ_vandg2.c \
+ $$PWD/proj/PJ_vandg4.c \
+ $$PWD/proj/PJ_wag7.c \
+ $$PWD/proj/PJ_lcca.c \
+ $$PWD/proj/PJ_geos.c \
+ $$PWD/proj/PJ_boggs.c \
+ $$PWD/proj/PJ_collg.c \
+ $$PWD/proj/PJ_crast.c \
+ $$PWD/proj/PJ_denoy.c \
+ $$PWD/proj/PJ_eck1.c \
+ $$PWD/proj/PJ_eck2.c \
+ $$PWD/proj/PJ_eck3.c \
+ $$PWD/proj/PJ_eck4.c \
+ $$PWD/proj/PJ_eck5.c \
+ $$PWD/proj/PJ_fahey.c \
+ $$PWD/proj/PJ_fouc_s.c \
+ $$PWD/proj/PJ_gins8.c \
+ $$PWD/proj/PJ_gstmerc.c \
+ $$PWD/proj/PJ_gn_sinu.c \
+ $$PWD/proj/PJ_goode.c \
+ $$PWD/proj/PJ_hatano.c \
+ $$PWD/proj/PJ_loxim.c \
+ $$PWD/proj/PJ_mbt_fps.c \
+ $$PWD/proj/PJ_mbtfpp.c \
+ $$PWD/proj/PJ_mbtfpq.c \
+ $$PWD/proj/PJ_moll.c \
+ $$PWD/proj/PJ_nell.c \
+ $$PWD/proj/PJ_nell_h.c \
+ $$PWD/proj/PJ_putp2.c \
+ $$PWD/proj/PJ_putp3.c \
+ $$PWD/proj/PJ_putp4p.c \
+ $$PWD/proj/PJ_putp5.c \
+ $$PWD/proj/PJ_putp6.c \
+ $$PWD/proj/PJ_robin.c \
+ $$PWD/proj/PJ_sts.c \
+ $$PWD/proj/PJ_urm5.c \
+ $$PWD/proj/PJ_urmfps.c \
+ $$PWD/proj/PJ_wag2.c \
+ $$PWD/proj/PJ_wag3.c \
+ $$PWD/proj/PJ_wink1.c \
+ $$PWD/proj/PJ_wink2.c \
+ $$PWD/proj/pj_latlong.c \
+ $$PWD/proj/pj_geocent.c \
+ $$PWD/proj/aasincos.c \
+ $$PWD/proj/adjlon.c \
+ $$PWD/proj/bch2bps.c \
+ $$PWD/proj/bchgen.c \
+ $$PWD/proj/biveval.c \
+ $$PWD/proj/dmstor.c \
+ $$PWD/proj/mk_cheby.c \
+ $$PWD/proj/pj_auth.c \
+ $$PWD/proj/pj_deriv.c \
+ $$PWD/proj/pj_ell_set.c \
+ $$PWD/proj/pj_ellps.c \
+ $$PWD/proj/pj_errno.c \
+ $$PWD/proj/pj_factors.c \
+ $$PWD/proj/pj_fwd.c \
+ $$PWD/proj/pj_init.c \
+ $$PWD/proj/pj_inv.c \
+ $$PWD/proj/pj_list.c \
+ $$PWD/proj/pj_malloc.c \
+ $$PWD/proj/pj_mlfn.c \
+ $$PWD/proj/pj_msfn.c \
+ $$PWD/proj/proj_mdist.c \
+ $$PWD/proj/pj_open_lib_qt.cpp \
+ $$PWD/proj/pj_param.c \
+ $$PWD/proj/pj_phi2.c \
+ $$PWD/proj/pj_pr_list.c \
+ $$PWD/proj/pj_qsfn.c \
+ $$PWD/proj/pj_strerrno.c \
+ $$PWD/proj/pj_tsfn.c \
+ $$PWD/proj/pj_units.c \
+ $$PWD/proj/pj_zpoly1.c \
+ $$PWD/proj/rtodms.c \
+ $$PWD/proj/vector1.c \
+ $$PWD/proj/pj_release.c \
+ $$PWD/proj/pj_gauss.c \
+ $$PWD/proj/nad_cvt.c \
+ $$PWD/proj/nad_init.c \
+ $$PWD/proj/nad_intr.c \
+ $$PWD/proj/emess.c \
+ $$PWD/proj/pj_apply_gridshift.c \
+ $$PWD/proj/pj_datums.c \
+ $$PWD/proj/pj_datum_set.c \
+ $$PWD/proj/pj_transform.c \
+ $$PWD/proj/geocent.c \
+ $$PWD/proj/pj_utils.c \
+ $$PWD/proj/pj_gridinfo.c \
+ $$PWD/proj/pj_gridlist.c \
+ $$PWD/proj/pj_mutex.c \
+ $$PWD/proj/pj_initcache.c
+
+unix {
+ DEFINES += MUTEX_pthread
+}
+
+win32 {
+ DEFINES += MUTEX_win32
+}
+
+RESOURCES += $$PWD/proj/data.qrc
diff --git a/src/imports/location/qdeclarativegeomapobject_p.h b/src/imports/location/qdeclarativegeomapobject_p.h
index 143c4167..415c29de 100644
--- a/src/imports/location/qdeclarativegeomapobject_p.h
+++ b/src/imports/location/qdeclarativegeomapobject_p.h
@@ -115,6 +115,9 @@ private:
class QDeclarativeGeoMapObjectView : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
+
+ Q_INTERFACES(QDeclarativeParserStatus)
+
Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
Q_PROPERTY(QDeclarativeComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
diff --git a/src/location/location.pro b/src/location/location.pro
index 0d2ffd8a..8e6d89ba 100644
--- a/src/location/location.pro
+++ b/src/location/location.pro
@@ -23,6 +23,7 @@ contains(proj_enabled, yes) {
LIBS += -lproj
} else {
include($$PWD/../3rdparty/proj.pri)
+ LIBS += -L$$OUT_PWD/../3rdparty -lproj
}
PUBLIC_HEADERS += \
diff --git a/src/location/maps/qgeomappingmanagerengine.cpp b/src/location/maps/qgeomappingmanagerengine.cpp
index fd6c8c47..362ec23f 100644
--- a/src/location/maps/qgeomappingmanagerengine.cpp
+++ b/src/location/maps/qgeomappingmanagerengine.cpp
@@ -373,7 +373,7 @@ void QGeoMappingManagerEngine::setSupportsTilting(bool supportsTilting)
bool QGeoMappingManagerEngine::supportsCustomMapObjects() const
{
Q_D(const QGeoMappingManagerEngine);
- return d_ptr->supportsCustomMapObjects;
+ return d->supportsCustomMapObjects;
}
/*!
@@ -386,7 +386,7 @@ bool QGeoMappingManagerEngine::supportsCustomMapObjects() const
void QGeoMappingManagerEngine::setSupportsCustomMapObjects(bool supportsCustomMapObjects)
{
Q_D(QGeoMappingManagerEngine);
- d_ptr->supportsCustomMapObjects = supportsCustomMapObjects;
+ d->supportsCustomMapObjects = supportsCustomMapObjects;
}
/*!
diff --git a/src/location/maps/qgeomaptextobject.cpp b/src/location/maps/qgeomaptextobject.cpp
index 68cbc154..2b9ee8cd 100644
--- a/src/location/maps/qgeomaptextobject.cpp
+++ b/src/location/maps/qgeomaptextobject.cpp
@@ -241,7 +241,6 @@ QPoint QGeoMapTextObject::offset() const
void QGeoMapTextObject::setOffset(const QPoint &off)
{
- QPointF offset = off;
if (d_ptr->offset != off) {
d_ptr->offset = off;
emit offsetChanged(off);
diff --git a/src/location/maps/tiled/qgeotiledmappolygonobjectinfo_p.cpp b/src/location/maps/tiled/qgeotiledmappolygonobjectinfo_p.cpp
index 02279ade..9e5928bd 100644
--- a/src/location/maps/tiled/qgeotiledmappolygonobjectinfo_p.cpp
+++ b/src/location/maps/tiled/qgeotiledmappolygonobjectinfo_p.cpp
@@ -106,7 +106,6 @@ void QGeoTiledMapPolygonObjectInfo::genPoly()
double oy = origin.latitude() * 3600.0;
double oldx = ox;
- double oldy = oy;
poly << QPointF(0,0);
for (int i = 0; i < path.size(); ++i) {
@@ -125,7 +124,6 @@ void QGeoTiledMapPolygonObjectInfo::genPoly()
poly << QPointF(x - ox, y - oy);
oldx = x;
- oldy = y;
}
}
diff --git a/src/location/maps/tiled/qgeotiledmappolylineobjectinfo_p.cpp b/src/location/maps/tiled/qgeotiledmappolylineobjectinfo_p.cpp
index 3e76ce90..472d032b 100644
--- a/src/location/maps/tiled/qgeotiledmappolylineobjectinfo_p.cpp
+++ b/src/location/maps/tiled/qgeotiledmappolylineobjectinfo_p.cpp
@@ -98,7 +98,6 @@ void QGeoTiledMapPolylineObjectInfo::genPath()
double oy = origin.latitude() * 3600.0;
double oldx = ox;
- double oldy = oy;
p.moveTo(0, 0);
for (int i = 1; i < path.size(); ++i) {
@@ -117,7 +116,6 @@ void QGeoTiledMapPolylineObjectInfo::genPath()
p.lineTo(x - ox, y - oy);
oldx = x;
- oldy = y;
}
}
diff --git a/src/location/maps/tiled/qgeotiledmaprouteobjectinfo_p.cpp b/src/location/maps/tiled/qgeotiledmaprouteobjectinfo_p.cpp
index e6ae4553..4b14647f 100644
--- a/src/location/maps/tiled/qgeotiledmaprouteobjectinfo_p.cpp
+++ b/src/location/maps/tiled/qgeotiledmaprouteobjectinfo_p.cpp
@@ -111,7 +111,6 @@ void QGeoTiledMapRouteObjectInfo::regenPath()
if (path.size() > 0) {
double oldx = 0.0;
- double oldy = 0.0;
for (int i = 0; i < path.size(); ++i) {
double x = path.at(i).longitude() * 3600.0;
@@ -131,7 +130,6 @@ void QGeoTiledMapRouteObjectInfo::regenPath()
}
oldx = x;
- oldy = y;
}
}
diff --git a/src/location/qlocationutils.cpp b/src/location/qlocationutils.cpp
index c210ed59..ed879628 100644
--- a/src/location/qlocationutils.cpp
+++ b/src/location/qlocationutils.cpp
@@ -133,7 +133,7 @@ static void qlocationutils_readRmc(const char *data, int size, QGeoPositionInfo
*hasFix = (parts[2][0] == 'A');
if (parts.count() > 9 && parts[9].count() == 6) {
- date = QDate::fromString(parts[9], QLatin1String("ddMMyy"));
+ date = QDate::fromString(QString::fromLatin1(parts[9]), QLatin1String("ddMMyy"));
if (date.isValid())
date = date.addYears(100); // otherwise starts from 1900
else
@@ -305,9 +305,11 @@ bool QLocationUtils::getNmeaTime(const QByteArray &bytes, QTime *time)
QTime tempTime;
if (dotIndex < 0) {
- tempTime = QTime::fromString(bytes, QLatin1String("hhmmss"));
+ tempTime = QTime::fromString(QString::fromLatin1(bytes.constData()),
+ QLatin1String("hhmmss"));
} else {
- tempTime = QTime::fromString(bytes.mid(0, dotIndex), QLatin1String("hhmmss"));
+ tempTime = QTime::fromString(QString::fromLatin1(bytes.mid(0, dotIndex)),
+ QLatin1String("hhmmss"));
bool hasMsecs = false;
int midLen = qMin(3, bytes.size() - dotIndex - 1);
int msecs = bytes.mid(dotIndex + 1, midLen).toUInt(&hasMsecs);
diff --git a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
index f92e20ac..10559a66 100644
--- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
@@ -336,6 +336,9 @@ QString QGeoRoutingManagerEngineNokia::modesRequestString(const QGeoRouteRequest
case QGeoRouteRequest::DisallowFeatureWeight:
weightString = "-3";
break;
+ case QGeoRouteRequest::NeutralFeatureWeight:
+ case QGeoRouteRequest::RequireFeatureWeight:
+ break;
}
if (weightString.isEmpty())
@@ -358,6 +361,11 @@ QString QGeoRoutingManagerEngineNokia::modesRequestString(const QGeoRouteRequest
case QGeoRouteRequest::DirtRoadFeature:
featureStrings.append("dirtRoad:" + weightString);
break;
+ case QGeoRouteRequest::PublicTransitFeature:
+ case QGeoRouteRequest::ParksFeature:
+ case QGeoRouteRequest::MotorPoolLaneFeature:
+ case QGeoRouteRequest::NoFeature:
+ break;
}
}
diff --git a/src/src.pro b/src/src.pro
index b321da3d..75e0983e 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
CONFIG+=ordered
-SUBDIRS += location plugins imports
+SUBDIRS += 3rdparty/proj.pro location plugins imports
diff --git a/tests/systemtests/sys_location.qtt b/tests/systemtests/sys_location.qtt
index 52c98aca..3453513e 100644
--- a/tests/systemtests/sys_location.qtt
+++ b/tests/systemtests/sys_location.qtt
@@ -259,8 +259,6 @@ testcase = {
skip( "Nothing tested", SkipAll );
},
- //TESTED_COMPONENT=plugins/declarative/location
-
// \groups BAT,1.2,QTMOBILITY-796
qml_display_map: function()
{
@@ -300,14 +298,15 @@ testcase = {
| Select Route menu item | |
| Make sure that coordinates are *(-27.575,153.088)->(-27.465,153.023)* | |
| Press Go button | |
- | Wait for message appears on the screen | Verify that distance is *15.901*km |
- | Press Ok button | Verify that the route looks correct and does not have strange loops |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *15.9km* |
+ | Click on the catch | |
| Press Options button | |
| Select Route menu item | |
| Select second option group to enter start and end points as address | |
| Use default addresses and Press Go button | |
- | Wait for message appears on the screen | Verify that distance is *18.676km* |
- | Press Ok button | Verify that the route looks correct and does not have strange loops |'
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *19.6km* |'
));
},
@@ -320,21 +319,22 @@ testcase = {
| Run the qml_mapviewer application | |
| Press Options button | |
| Select Route menu item | |
- | Selec first option group | |
+ | Selec coordinate option group | |
| Fill in *-27.4709* in From Latitude field | |
| Fill in *153.0235* in From Longitude filed | |
| Fill in *-33.8689* in To Latitude field | |
| Fill in *151.2071* in To Longitude filed | |
| Press Go button | |
- | Wait for message appears on the screen | Verify that distance is *927.209km* |
- | Press Ok button | Verify that the route looks correct and does not have strange loops |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *930km* |
+ | Click on the catch | |
| Press Options button | |
| Select Route menu item | |
| Selec second option group | |
| Press Clear button | |
- | Fill in *Moscow* in From City field | |
- | Fill in *Russia* in From Country filed | |
- | Fill in *Eight Mile Plains* in To City filed | |
+ | Fill in *Eight Mile Plains* in From City field | |
+ | Fill in *Australia* in From Country filed | |
+ | Fill in *Moscow* in To City filed | |
| Fill in *Australia* in To Country filed | |
| Press Go button | |
| Wait for message appears on the screen | Verify that route is not found |
@@ -342,14 +342,11 @@ testcase = {
| Press Options button | |
| Select Route menu item | |
| Selec second option group | |
- | Press Clear button | |
- | Fill in *Eight Mile Plains* in From City field | |
- | Fill in *Australia* in From Country filed | |
| Fill in *Byron Bay* in To City filed | |
| Fill in *Australia* in To Country filed | |
| Press Go button | |
- | Wait for message appears on the screen | Verify that distance is *151.318km* |
- | Press Ok button | Verify that the route looks correct and does not have strange loops |'
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *151km* |'
));
},
@@ -381,52 +378,86 @@ testcase = {
| Press Go! button | |
| Long Press on the first marker | |
| Select Route To The Next Points | |
- | Wait for message appears on the screen | Verify that distance is *29.491km* |
- | Press Ok button | Verify that the route looks correct, goes through all waypoints and does not have strange loops |'
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *29.5km* |'
));
},
-/*
+
// \groups BAT,5.0,MOBILITY-2893,RESEARCH
qml_travel_mode: function()
{
- prompt(twiki('---+++ QML: Travel mode
+ prompt(twiki('---+++ QML: Travel modes: Vechile Fastest and Pedestrian Fastest
Note that internet connection is required for this test case
| *Step* | *Verification* |
-1. Travel mode: pedestrian. Use qml_mapviewer to test. (55 Bordeaux Street, Eight Mile Plains QLD)->(53 Brandl St, Eight Mile Plains QLD 4113) or (-27.5784,153.0934)->(-27.5798,153.1003)
-2. Travel mode: bicycle
-3. Travel mode: public transport
-4. Travel mode: by truck'
+ | Run the qml_mapviewer application | |
+ | Press Options button | |
+ | Select Route menu item | |
+ | Selec first option group | |
+ | Fill in *-27.5789* in From Latitude field | |
+ | Fill in *153.0919* in From Longitude filed | |
+ | Fill in *-27.5792* in To Latitude field | |
+ | Fill in *153.096* in To Longitude filed | |
+ | Press Go button | |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *2.6km* |
+ | Click on the catch | |
+ | Press Options button | |
+ | Select Route menu item | |
+ | Select *Pedestrian* option button | |
+ | Press Go button | |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *1.7km* |'
+ ));
},
// \groups BAT,5.0,MOBILITY-2893,RESEARCH
qml_route_feature_type: function()
{
- prompt(twiki('---+++ QML: Route features
+ prompt(twiki('---+++ QML: Route features: Avoid Highways and Avoid Tool Roads
Note that internet connection is required for this test case
| *Step* | *Verification* |
-1. Feature type: no feature
-2. Feature type: toll
-3. Feature type: highway
-4. Feature type: public transit
-5. Feature type: ferry
-6. Feature type: tunnel
-7. Feature type: dirt road
-8. Feature type: parks
-9. Feature type: motor pool lane'
+ | Run the qml_mapviewer application | |
+ | Press Options button | |
+ | Select Route menu item | |
+ | Selec first option group | |
+ | Fill in *-27.5013* in From Latitude field | |
+ | Fill in *153.1002* in From Longitude filed | |
+ | Fill in *-27.4395* in To Latitude field | |
+ | Fill in *153.0504* in To Longitude filed | |
+ | Select *Avoid toll roads* checkbox | |
+ | Press Go button | |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *18km* |
+ | Click on the catch | |
+ | Press Options button | |
+ | Select *Avoid highways* checkbox | |
+ | Press Go button | |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *15km* |'
+ ));
},
// \groups BAT,5.0,MOBILITY-2893,RESEARCH
qml_route_optimization: function()
{
- prompt(twiki('---+++ QML: Route optimization
+ prompt(twiki('---+++ QML: Travel optimization: Vechile Shortest
Note that internet connection is required for this test case
| *Step* | *Verification* |
-1. Route optimization: shortest
-2. Route optimization: fastest
-3. Route optimization: most economic
-4. Route optimization: most scenic'
+ | Run the qml_mapviewer application | |
+ | Press Options button | |
+ | Select Route menu item | |
+ | Selec first option group | |
+ | Fill in *-27.5789* in From Latitude field | |
+ | Fill in *153.0919* in From Longitude filed | |
+ | Fill in *-27.5792* in To Latitude field | |
+ | Fill in *153.096* in To Longitude filed | |
+ | Select *Shortest* option button | |
+ | Press Go button | |
+ | Wait for the route appears on the screen | Verify that the route looks correct and does not have strange loops |
+ | Click on the catch on the left side of the screen | Verify that distance is *2.2km* |'
+ ));
},
-*/
+
// \groups BAT,5.0,MOBILITY-2900,RESEARCH
qml_geocode_australian_location: function()
{