X-Git-Url: https://git-public.kairo.at//?a=blobdiff_plain;f=js%2Fmap.js;h=b5fe9e2a088607063160a1be0d54cbd252c3b09d;hb=fd537d595285fcfb525be447e3bd5c5dfe81e3aa;hp=a8105ae48f0bbb0845162a32ec85bc97e2b655dd;hpb=b5e49b956629a45c3af14a87790060cbf18a718a;p=lantea.git
diff --git a/js/map.js b/js/map.js
index a8105ae..b5fe9e2 100644
--- a/js/map.js
+++ b/js/map.js
@@ -35,7 +35,7 @@ var gMapStyles = {
copyright: 'Map data © OpenStreetMap and contributors (ODbL/CC-BY-SA), tiles Courtesy of MapQuest.'},
mapquest_aerial:
{name: "MapQuest Open Aerial",
- url: "http://oatile[1-4].mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",
+ url: "http://otile[1-4].mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",
copyright: 'Tiles Courtesy of MapQuest, portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency.'},
opengeoserver_arial:
{name: "OpenGeoServer Aerial",
@@ -297,13 +297,16 @@ function drawMap(aPixels, aOverdraw) {
for (var x = Math.floor(xMin / size); x < Math.ceil(xMax / size); x++) {
for (var y = Math.floor(yMin / size); y < Math.ceil(yMax / size); y++) { // slow script warnings on the tablet appear here!
// Only go to the drawing step if we need to draw this tile.
- if (x < tiles.left || x > tiles.right || y < tiles.top || y > tiles.bottom) {
+ if (x < tiles.left || x > tiles.right ||
+ y < tiles.top || y > tiles.bottom) {
// Round here is **CRUCIAL** otherwise the images are filtered
// and the performance sucks (more than expected).
var xoff = Math.round((x * size - xMin) / gZoomFactor);
var yoff = Math.round((y * size - yMin) / gZoomFactor);
// Draw placeholder tile unless we overdraw.
- if (!aOverdraw)
+ if (!aOverdraw &&
+ (x < tiles.left -1 || x > tiles.right + 1 ||
+ y < tiles.top -1 || y > tiles.bottom + 1))
gMapContext.drawImage(gLoadingTile, xoff, yoff);
// Initiate loading/drawing of the actual tile.
@@ -575,8 +578,14 @@ function setTracking(aCheckbox) {
function startTracking() {
if (gGeolocation) {
+ gActionLabel.textContent = "Establishing Position";
+ gAction.style.display = "block";
gGeoWatchID = gGeolocation.watchPosition(
function(position) {
+ if (gActionLabel.textContent) {
+ gActionLabel.textContent = "";
+ gAction.style.display = "none";
+ }
// Coords spec: https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionCoords
var tPoint = {time: position.timestamp,
coords: {latitude: position.coords.latitude,
@@ -622,6 +631,10 @@ function startTracking() {
}
function endTracking() {
+ if (gActionLabel.textContent) {
+ gActionLabel.textContent = "";
+ gAction.style.display = "none";
+ }
if (gGeoWatchID) {
gGeolocation.clearWatch(gGeoWatchID);
}