osm_mapnik:
{name: "OpenStreetMap (Mapnik)",
url: "http://tile.openstreetmap.org/{z}/{x}/{y}.png",
- copyright: 'Map data and imagery © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'},
+ copyright: 'Map data and imagery © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://www.openstreetmap.org/copyright">ODbL/CC-BY-SA</a>'},
osm_cyclemap:
{name: "Cycle Map (OSM)",
url: "http://[a-c].tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",
- copyright: 'Map data and imagery © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'},
+ copyright: 'Map data and imagery © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://www.openstreetmap.org/copyright">ODbL/CC-BY-SA</a>'},
osm_transmap:
{name: "Transport Map (OSM)",
url: "http://[a-c].tile2.opencyclemap.org/transport/{z}/{x}/{y}.png",
- copyright: 'Map data and imagery © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'},
+ copyright: 'Map data and imagery © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://www.openstreetmap.org/copyright">ODbL/CC-BY-SA</a>'},
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, <a href="http://www.openstreetmap.org/">OpenStreetMap</a> and contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.'},
+ url: "http://otile[1-4].mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png",
+ copyright: 'Map data © <a href="http://www.openstreetmap.org/">OpenStreetMap</a> and contributors (<a href="http://www.openstreetmap.org/copyright">ODbL/CC-BY-SA</a>), tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a>.'},
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, <a href="http://www.openstreetmap.org/">OpenStreetMap</a> and contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.'},
+ url: "http://oatile[1-4].mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",
+ copyright: 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a>, 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 <a href="http://www.opengeoserver.org/">OpenGeoServer.org</a>, <a href="https://creativecommons.org/licenses/by/3.0/at/">CC-BY 3.0 AT</a>.'},
google_map:
{name: "Google Maps",
url: " http://mt1.google.com/vt/x={x}&y={y}&z={z}",
gCanvas.addEventListener("touchcancel", mapEvHandler, false);
gCanvas.addEventListener("touchleave", mapEvHandler, false);
+ // XXX deprecated? see https://groups.google.com/forum/?fromgroups#!topic/mozilla.dev.planning/kuhrORubaRY[1-25]
gCanvas.addEventListener("DOMMouseScroll", mapEvHandler, false);
gCanvas.addEventListener("mousewheel", mapEvHandler, false);
gCanvas.width = canvasWidth;
gCanvas.height = canvasHeight;
drawMap();
+ showUI();
}
function zoomIn() {
if (mapSel.selectedIndex >= 0 && gActiveMap != mapSel.value) {
gActiveMap = mapSel.value;
gTiles = {};
+ document.getElementById("copyright").innerHTML =
+ gMapStyles[gActiveMap].copyright;
+ showUI();
drawMap();
}
}
.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.
// 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);
}
gLastMouseX = x;
gLastMouseY = y;
+ showUI();
break;
case "mousemove":
case "touchmove":
gPos.x -= dX * gZoomFactor;
gPos.y -= dY * gZoomFactor;
drawMap();
+ showUI();
}
gLastMouseX = x;
gLastMouseY = y;
case "mouseup":
case "touchend":
gDragging = false;
+ showUI();
break;
case "mouseout":
case "touchcancel":