Changeset 3b87474
- Timestamp:
- 03/31/12 18:27:14 (15 months ago)
- Branches:
- master
- Children:
- 0f1fff2
- Parents:
- 7b60594
- git-author:
- Martin Kolman <martin.kolman@…> (03/31/12 18:27:14)
- git-committer:
- Martin Kolman <martin.kolman@…> (03/31/12 18:27:14)
- Location:
- modules/gui_modules/gui_qml/qml
- Files:
-
- 2 edited
-
MapPage.qml (modified) (3 diffs)
-
PinchMap.qml (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modules/gui_modules/gui_qml/qml/MapPage.qml
r449f379 r3b87474 17 17 } 18 18 19 property bool center : true 20 19 21 PinchMap { 20 22 id: pinchmap … … 27 29 onLastGoodFixChanged: { 28 30 //console.log("fix changed") 29 if (tabMap.status == PageStatus.Active) { 30 if (followPositionButton.checked && ! updateTimer.running) { 31 //console.debug("Update from GPS position") 32 pinchmap.setCenterLatLon(gps.lastGoodFix.lat, gps.lastGoodFix.lon); 33 updateTimer.start(); 34 } else if (followPositionButton.checked) { 35 console.debug("Update timer preventing another update."); 36 } 31 if (tabMap.center && ! updateTimer.running) { 32 //console.debug("Update from GPS position") 33 pinchmap.setCenterLatLon(gps.lastGoodFix.lat, gps.lastGoodFix.lon); 34 updateTimer.start(); 35 } else if (tabMap.center) { 36 console.debug("Update timer preventing another update."); 37 37 } 38 38 } 39 } 40 41 onDrag : { 42 // disable map centering once drag is detected 43 tabMap.center = false 39 44 } 40 45 … … 175 180 width: parent.parent.buttonSize 176 181 height: parent.parent.buttonSize 182 checked : tabMap.center 177 183 checkable: true 178 184 onClicked: { 179 if (checked && gps.lastGoodFix) { 180 pinchmap.setCenterLatLon(gps.lastGoodFix.lat, gps.lastGoodFix.lon); 185 // toggle map centering 186 if (tabMap.center) { 187 tabMap.center = false // disable 188 } else { 189 tabMap.center = true // enable 190 if (gps.lastGoodFix) { // recenter at once 191 pinchmap.setCenterLatLon(gps.lastGoodFix.lat, gps.lastGoodFix.lon); 192 } 181 193 } 182 194 } -
modules/gui_modules/gui_qml/qml/PinchMap.qml
r7b60594 r3b87474 50 50 51 51 property int tileserverPort : mapTiles.serverPort() 52 53 signal drag // signals that map-drag has been detected 52 54 53 55 transform: Rotation { … … 555 557 556 558 onPressed: { 559 console.log("PRESSED") 557 560 __isPanning = true; 558 561 __lastX = mouse.x; … … 563 566 } 564 567 565 /*onReleased: {568 onReleased: { 566 569 __isPanning = false; 567 570 if (! __wasClick) { 568 571 panEnd(); 569 } else {572 } /*else { 570 573 var n = mousearea.mapToItem(geocacheDisplayContainer, mouse.x, mouse.y) 571 574 var g = geocacheDisplayContainer.childAt(n.x, n.y) … … 574 577 controller.geocacheSelected(g.cache) 575 578 } 576 } 577 578 } */579 }*/ 580 581 } 579 582 580 583 onPositionChanged: { … … 585 588 __lastX = mouse.x; 586 589 __lastY = mouse.y; 587 if (Math.pow(mouse.x - __firstX, 2) + Math.pow(mouse.y - __firstY, 2) > maxClickDistance) { 590 /* 591 once the pan threshold is reached, 592 additional checking is unnecessary 593 for the press duration as nothing sets 594 __wasClick back to true 595 */ 596 if (__wasClick && Math.pow(mouse.x - __firstX, 2) + Math.pow(mouse.y - __firstY, 2) > maxClickDistance) { 588 597 __wasClick = false; 598 pinchmap.drag() // send the drag-detected signal 599 589 600 } 590 601 }
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/gps_navigace/chrome/site/nlp-logo.png)