X-Git-Url: https://git-public.kairo.at/?p=lantea.git;a=blobdiff_plain;f=js%2Fmap.js;h=c146ad7b8940a26ea14c099cd3ab2fc2f4e024c5;hp=48b1128ac66cfee0d651977b763dab9fab98da49;hb=5a19ec685d43abf31954dd96a3d93eefe86af635;hpb=95f49ba7430c53b02b9800d277f5b1b18799b692 diff --git a/js/map.js b/js/map.js index 48b1128..c146ad7 100644 --- a/js/map.js +++ b/js/map.js @@ -14,23 +14,27 @@ var gMapStyles = { osm_mapnik: {name: "OpenStreetMap (Mapnik)", url: "http://tile.openstreetmap.org/{z}/{x}/{y}.png", - copyright: 'Map data and imagery © OpenStreetMap contributors, CC-BY-SA'}, + copyright: 'Map data and imagery © OpenStreetMap contributors, ODbL/CC-BY-SA'}, osm_cyclemap: {name: "Cycle Map (OSM)", url: "http://[a-c].tile.opencyclemap.org/cycle/{z}/{x}/{y}.png", - copyright: 'Map data and imagery © OpenStreetMap contributors, CC-BY-SA'}, + copyright: 'Map data and imagery © OpenStreetMap contributors, ODbL/CC-BY-SA'}, osm_transmap: {name: "Transport Map (OSM)", url: "http://[a-c].tile2.opencyclemap.org/transport/{z}/{x}/{y}.png", - copyright: 'Map data and imagery © OpenStreetMap contributors, CC-BY-SA'}, + copyright: 'Map data and imagery © OpenStreetMap contributors, ODbL/CC-BY-SA'}, mapquest_open: {name: "MapQuest OSM", - url: "http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png", - copyright: 'Data, imagery and map information provided by MapQuest, OpenStreetMap and contributors, CC-BY-SA.'}, + url: "http://otile[1-4].mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png", + copyright: 'Map data © OpenStreetMap and contributors (ODbL/CC-BY-SA), tiles Courtesy of MapQuest.'}, mapquest_aerial: {name: "MapQuest Open Aerial", - url: "http://oatile1.mqcdn.com/naip/{z}/{x}/{y}.png", - copyright: 'Data, imagery and map information provided by MapQuest, OpenStreetMap and contributors, CC-BY-SA.'}, + url: "http://oatile[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", + url: "http://services.opengeoserver.org/tiles/1.0.0/globe.aerial_EPSG3857/{z}/{x}/{y}.png?origin=nw", + copyright: 'Tiles by OpenGeoServer.org, CC-BY 3.0 AT.'}, google_map: {name: "Google Maps", url: " http://mt1.google.com/vt/x={x}&y={y}&z={z}", @@ -145,6 +149,7 @@ function resizeAndDraw() { gCanvas.width = canvasWidth; gCanvas.height = canvasHeight; drawMap(); + showUI(); } function zoomIn() { @@ -186,6 +191,7 @@ function setMapStyle() { gTiles = {}; document.getElementById("copyright").innerHTML = gMapStyles[gActiveMap].copyright; + showUI(); drawMap(); } } @@ -209,7 +215,8 @@ function tileURL(x, y, z) { .replace("{x}", norm.x) .replace("{y}", norm.y) .replace("{z}", norm.z) - .replace("[a-c]", String.fromCharCode(97 + Math.floor(Math.random() * 2))); + .replace("[a-c]", String.fromCharCode(97 + Math.floor(Math.random() * 2))) + .replace("[1-4]", 1 + Math.floor(Math.random() * 3)); } // Returns true if the tile is outside the current view. @@ -265,7 +272,7 @@ function drawMap() { // Go through all the tiles we want. // If any of them aren't loaded or being loaded, do so. 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++) { + for (var y = Math.floor(yMin / size); y < Math.ceil(yMax / size); y++) { // slow script warnings on the tablet appear here! var xoff = (x * size - xMin) / gZoomFactor; var yoff = (y * size - yMin) / gZoomFactor; var tileKey = encodeIndex(x, y, gPos.z); @@ -369,6 +376,7 @@ var mapEvHandler = { } gLastMouseX = x; gLastMouseY = y; + showUI(); break; case "mousemove": case "touchmove": @@ -380,6 +388,7 @@ var mapEvHandler = { gPos.x -= dX * gZoomFactor; gPos.y -= dY * gZoomFactor; drawMap(); + showUI(); } gLastMouseX = x; gLastMouseY = y; @@ -387,6 +396,7 @@ var mapEvHandler = { case "mouseup": case "touchend": gDragging = false; + showUI(); break; case "mouseout": case "touchcancel":