projects
/
lantea.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
try to fix upload error, make initial draw faster
[lantea.git]
/
js
/
map.js
diff --git
a/js/map.js
b/js/map.js
index 6aeacf688794cbdbb33fccde9c89c6b23b93df61..5e65ed65080ebea906e537469fe208699e5773bd 100644
(file)
--- a/
js/map.js
+++ b/
js/map.js
@@
-162,14
+162,17
@@
function loadPrefs(aEvent) {
gAction.dispatchEvent(throwEv);
});
gWaitCounter++;
gAction.dispatchEvent(throwEv);
});
gWaitCounter++;
- var trackLoadStarted = false;
+ var trackLoadStarted = false;
redrawBase = 100;
gTrackStore.getListStepped(function(aTPoint) {
if (aTPoint) {
// Add in front and return new length.
var tracklen = gTrack.unshift(aTPoint);
gTrackStore.getListStepped(function(aTPoint) {
if (aTPoint) {
// Add in front and return new length.
var tracklen = gTrack.unshift(aTPoint);
- // Redraw track every 100 values (initial paint will do first anyhow).
- if (tracklen % 100 == 0)
+ // Redraw track periodically, larger distance the longer it gets.
+ // Initial paint will do initial track drawing.
+ if (tracklen % redrawBase == 0) {
drawTrack();
drawTrack();
+ redrawBase = tracklen;
+ }
}
else {
// Last point received.
}
else {
// Last point received.
@@
-489,7
+492,6
@@
var mapEvHandler = {
Math.pow(aEvent.targetTouches.item(1).clientY -
aEvent.targetTouches.item(0).clientY, 2)
);
Math.pow(aEvent.targetTouches.item(1).clientY -
aEvent.targetTouches.item(0).clientY, 2)
);
- console.log('!!! ' + gPinchStartWidth);
}
gDragTouchID = aEvent.changedTouches.item(0).identifier;
coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID);
}
gDragTouchID = aEvent.changedTouches.item(0).identifier;
coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID);
@@
-515,7
+517,7
@@
var mapEvHandler = {
);
if (!gPinchStartWidth)
gPinchStartWidth = curPinchStartWidth;
);
if (!gPinchStartWidth)
gPinchStartWidth = curPinchStartWidth;
- console.log(gPinchStartWidth + ' <?> ' + curPinchStartWidth);
+
if (gPinchStartWidth / curPinchStartWidth > 1.7 ||
gPinchStartWidth / curPinchStartWidth < 0.6) {
var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1);
if (gPinchStartWidth / curPinchStartWidth > 1.7 ||
gPinchStartWidth / curPinchStartWidth < 0.6) {
var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1);
@@
-544,6
+546,7
@@
var mapEvHandler = {
gPinchStartWidth = null;
}
}
gPinchStartWidth = null;
}
}
+ // If we are in a pinch, do not drag.
break;
}
var x = coordObj.clientX - gMapCanvas.offsetLeft;
break;
}
var x = coordObj.clientX - gMapCanvas.offsetLeft;
@@
-574,6
+577,7
@@
var mapEvHandler = {
break;
case "mouseup":
case "touchend":
break;
case "mouseup":
case "touchend":
+ gPinchStartWidth = null;
gDragging = false;
showUI();
break;
gDragging = false;
showUI();
break;