|
@@ -7,25 +7,12 @@ var debug_mode = false;
|
|
var canvas;
|
|
var canvas;
|
|
var cntext;
|
|
var cntext;
|
|
var point_list = new Array();
|
|
var point_list = new Array();
|
|
-var zoom = 0;
|
|
|
|
-var zooms = new Array();
|
|
|
|
-var prev_zm;
|
|
|
|
-var zm;
|
|
|
|
-var tile = {width:256, height:256};
|
|
|
|
-var ntiles = {x:228, y:9};
|
|
|
|
var border_width = 2;
|
|
var border_width = 2;
|
|
var imageObj = new Array();
|
|
var imageObj = new Array();
|
|
|
|
|
|
// minimum and maximum azimuth
|
|
// minimum and maximum azimuth
|
|
var alpha_domain = {start:0, end:360};
|
|
var alpha_domain = {start:0, end:360};
|
|
|
|
|
|
-var fingr = 0; // mémorisation de lécart entre doigts;
|
|
|
|
-var last = {x:0,y:0};
|
|
|
|
-var shift = {x:0,y:0};
|
|
|
|
-var mouse = {x:0,y:0};
|
|
|
|
-var speed = {x:0,y:0};
|
|
|
|
-var canvas_pos = {x:0,y:0};
|
|
|
|
-var tmt;
|
|
|
|
var is_located = false;
|
|
var is_located = false;
|
|
var point_colors = {
|
|
var point_colors = {
|
|
'pano_point' : '255,128,128', // red
|
|
'pano_point' : '255,128,128', // red
|
|
@@ -73,126 +60,11 @@ function fmodulo(val, div) { // pour obtenir un modulo dans l'esp
|
|
return (val%div+div)%div; // il y a peut être plus simple, mais en attendant ....
|
|
return (val%div+div)%div; // il y a peut être plus simple, mais en attendant ....
|
|
}
|
|
}
|
|
|
|
|
|
-function distort_canvas(p, x, y) {
|
|
|
|
- if (p == 0) distort = 0;
|
|
|
|
- else {
|
|
|
|
- cntext.save();
|
|
|
|
- distort++;
|
|
|
|
- cntext.clearRect(0, 0, canvas.width, 2*canvas.height);
|
|
|
|
- var ratio = (canvas.width-2*distort)/canvas.width;
|
|
|
|
- var shift = canvas.height/2*(1-ratio);
|
|
|
|
- cntext.scale(1, ratio);
|
|
|
|
- if (p == 1) cntext.translate(0, 0);
|
|
|
|
- else if (p == -1) cntext.translate(0, 0);
|
|
|
|
- draw_image(x, y);
|
|
|
|
- cntext.restore();
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function draw_image(ox, oy) {
|
|
|
|
- var ref_vals = {x:last.x, y:last.y, zoom:zoom};
|
|
|
|
- ox = nmodulo(ox-canvas.width/2, zm.im.width); // pour placer l'origine au centre du canvas
|
|
|
|
- oy = Math.floor(oy-canvas.height/2); // pas de rebouclage vertical
|
|
|
|
-
|
|
|
|
- cntext.clearRect(0, 0, canvas.width, canvas.height);
|
|
|
|
- cntext.fillStyle = "rgba(128,128,128,0.8)";
|
|
|
|
-
|
|
|
|
- if (canvas.height > zm.im.height) {
|
|
|
|
- var fy = Math.floor((oy+canvas.height/2-zm.im.height/2)/(tile.height*zm.ntiles.y))*zm.ntiles.y;
|
|
|
|
- if (fy < 0) fy = 0;
|
|
|
|
- var ly = fy + zm.ntiles.y;
|
|
|
|
- } else {
|
|
|
|
- var fy = Math.floor(oy/tile.height);
|
|
|
|
- var ly = Math.floor((oy+canvas.height+tile.height-1)/tile.height+1);
|
|
|
|
- if (fy < 0) fy = 0;
|
|
|
|
- if (ly > zm.ntiles.y) ly = zm.ntiles.y;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (var j=fy; j<ly; j++) {
|
|
|
|
- var delta_y = (Math.floor(j/zm.ntiles.y) - Math.floor(fy/zm.ntiles.y)) * (tile.height - zm.last_tile.height);
|
|
|
|
- var dy = j*tile.height - oy - delta_y;
|
|
|
|
- var ny = j%ntiles.y;
|
|
|
|
- var wy = zm.tile.width;
|
|
|
|
- if (ny == zm.ntiles.y - 1) wy = zm.last_tile.height;
|
|
|
|
-
|
|
|
|
- var cpx = 0;
|
|
|
|
- var i = 0;
|
|
|
|
- var Nx = zm.ntiles.x;
|
|
|
|
- while (cpx < ox+canvas.width) {
|
|
|
|
- var cur_width = zm.tile.width;
|
|
|
|
- if (i%Nx == zm.ntiles.x-1) cur_width = zm.last_tile.width;
|
|
|
|
- if (cpx >= ox-cur_width) {
|
|
|
|
- var nx = i%Nx;
|
|
|
|
- var idx = nx+'-'+ny+'-'+ref_vals.zoom;
|
|
|
|
- if (imageObj[idx] && imageObj[idx].complete) {
|
|
|
|
- draw_tile(idx, cpx-ox, dy); // l'image est déja en mémoire, on force le dessin sans attendre.
|
|
|
|
- } else {
|
|
|
|
- var fname = get_file_name(nx, ny, ref_vals.zoom);
|
|
|
|
- imageObj[idx] = new Image();
|
|
|
|
- imageObj[idx].src = fname;
|
|
|
|
- var ts = zm.get_tile_size(nx, ny);
|
|
|
|
- cntext.fillRect(cpx-ox, dy, ts.width, ts.height);
|
|
|
|
- imageObj[idx].addEventListener('load', (function(ref, idx, dx, dy, ox, oy, ts) {
|
|
|
|
- return function() { // closure nécéssaire pour gestion assynchronisme !!!
|
|
|
|
- draw_tile_del(ref, idx, dx, dy, ox, oy, ts.width, ts.height);
|
|
|
|
- };
|
|
|
|
- })(ref_vals, idx, cpx-ox, dy, ox, oy, ts), false);
|
|
|
|
- }
|
|
|
|
- // load_image(zoom, nx, ny, shx, shy, cpx-ox, dy, ox, oy);
|
|
|
|
- }
|
|
|
|
- cpx += cur_width;
|
|
|
|
- i++;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- drawDecorations(ox, oy);
|
|
|
|
- var cap_ele = zm.get_cap_ele(last.x, zm.im.height/2-last.y);
|
|
|
|
- angle_control.value = cap_ele.cap.toFixed(2);
|
|
|
|
- elvtn_control.value = cap_ele.ele.toFixed(2);
|
|
|
|
- update_url();
|
|
|
|
-
|
|
|
|
- // draw minimap
|
|
|
|
- if (Object.keys(ref_points).length>1){
|
|
|
|
- // Draw the mijimap only if there are at least 2 reference points (so the size is known)
|
|
|
|
- if (typeof panorama_lat !== 'undefined') {
|
|
|
|
- if (map_never_drawn ) { load_map() }
|
|
|
|
- update_map();
|
|
|
|
- } else {
|
|
|
|
- // hack: It updates well when the 2nd points is pointed, but the map
|
|
|
|
- // failed to load due to the missing JS variables linked to the panorama
|
|
|
|
- // (head of view.html), so reload the page first.
|
|
|
|
- location.reload();
|
|
|
|
- };
|
|
|
|
- $('#expandmap').css({'visibility': 'visible'})
|
|
|
|
- } else {
|
|
|
|
- // remove the expandmap button
|
|
|
|
- $('#expandmap').css({'visibility': 'hidden'})
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
-function draw_tile_del(ref, idx, tx, ty, ox, oy, twidth, theight) {
|
|
|
|
- if (ref.zoom == zoom && ref.x == last.x && ref.y == last.y) {
|
|
|
|
- draw_tile(idx, tx, ty);
|
|
|
|
- drawDecorations(ox, oy, tx, ty, twidth, theight);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function draw_tile(idx, ox, oy) {
|
|
|
|
- var img = imageObj[idx];
|
|
|
|
- cntext.drawImage(img, ox, oy);
|
|
|
|
-}
|
|
|
|
|
|
|
|
/** Draws the colored circles and the central line
|
|
/** Draws the colored circles and the central line
|
|
*/
|
|
*/
|
|
function drawDecorations(ox, oy, tx, ty, twidth, theight) {
|
|
function drawDecorations(ox, oy, tx, ty, twidth, theight) {
|
|
- if (twidth) {
|
|
|
|
- cntext.save();
|
|
|
|
- cntext.beginPath();
|
|
|
|
- cntext.rect(tx, ty, twidth, theight);
|
|
|
|
- cntext.clip();
|
|
|
|
- }
|
|
|
|
- var wgrd = zm.im.width/360;
|
|
|
|
- var od = ((ox+canvas.width/2)/wgrd)%360;
|
|
|
|
- var el = (zm.im.height/2 - (oy+canvas.height/2))/wgrd;
|
|
|
|
|
|
|
|
// draw a vertical blue line with the central dot
|
|
// draw a vertical blue line with the central dot
|
|
// the dot is centered on (ox, oy) = (canvas.width/2, canvas.width/2)
|
|
// the dot is centered on (ox, oy) = (canvas.width/2, canvas.width/2)
|
|
@@ -297,29 +169,6 @@ function erase_point() {
|
|
putImage(last.x, last.y);
|
|
putImage(last.x, last.y);
|
|
}
|
|
}
|
|
|
|
|
|
-/** Returns a 3-width zero-padded version of an int
|
|
|
|
- * ex: 3 -> "003"
|
|
|
|
- */
|
|
|
|
-function zero_pad(number) {
|
|
|
|
- var temp = number.toString(10);
|
|
|
|
- while (temp.length < 3) {
|
|
|
|
- temp = '0' + temp;
|
|
|
|
- }
|
|
|
|
- return temp;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function get_file_name(x, y, z) { // recherche du fichier correspondant au zoom et à la position
|
|
|
|
- return img_prefix+'/'+zero_pad(z)+'-'+zero_pad(x)+'-'+zero_pad(y)+'.jpg';
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function get_base_name() {
|
|
|
|
- /**
|
|
|
|
- * @returns the base name, which is the name (not path) of the folder where
|
|
|
|
- * the tiles are.
|
|
|
|
- */
|
|
|
|
- return img_prefix.split('/').reverse()[0];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
|
|
function keys(key) {
|
|
function keys(key) {
|
|
hide_links();
|
|
hide_links();
|
|
@@ -403,93 +252,6 @@ function onImageClick(e) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-function stickImage(e) {
|
|
|
|
- var index = {};
|
|
|
|
- if (e.changedTouches && e.changedTouches.length == 2) {
|
|
|
|
- e.preventDefault();
|
|
|
|
- // cas du zoom à 2 doigts
|
|
|
|
- var nfingr = Math.sqrt((e.changedTouches[0].clientX - e.changedTouches[1].clientX)^2 +
|
|
|
|
- (e.changedTouches[0].clientY - e.changedTouches[1].clientY)^2);
|
|
|
|
- var evt = {}
|
|
|
|
- evt.pageX = (e.changedTouches[0].clientX + e.changedTouches[1].clientX)/2;
|
|
|
|
- evt.pageY = (e.changedTouches[0].clientY + e.changedTouches[1].clientY)/2;
|
|
|
|
- if (fingr > nfingr*2 || fingr < nfingr/2) {
|
|
|
|
- evt.wheelDelta = fingr - nfingr;
|
|
|
|
- fingr = nfingr;
|
|
|
|
- return wheel_zoom(evt);
|
|
|
|
- } else {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (e.touches) {
|
|
|
|
- e.preventDefault();
|
|
|
|
- index.x = e.changedTouches[0].clientX;
|
|
|
|
- index.y = e.changedTouches[0].clientY;
|
|
|
|
- } else {
|
|
|
|
- index.x = e.pageX;
|
|
|
|
- index.y = e.pageY;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var xs = mouse.x - index.x + shift.x;
|
|
|
|
- var ys = mouse.y - index.y + shift.y;
|
|
|
|
- speed.x = xs - last.x; //mémorisation des vitesses horizontales
|
|
|
|
- speed.y = ys - last.y; //et verticales lors de ce déplacement
|
|
|
|
- putImage(xs, ys);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function launchImage(e) {
|
|
|
|
- var index = {};
|
|
|
|
- if (e.touches) {
|
|
|
|
- e.preventDefault();
|
|
|
|
- index.x = e.changedTouches[0].clientX;
|
|
|
|
- index.y = e.changedTouches[0].clientY;
|
|
|
|
- } else {
|
|
|
|
- index.x = e.pageX;
|
|
|
|
- index.y = e.pageY;
|
|
|
|
- }
|
|
|
|
- distort_canvas(0);
|
|
|
|
- canvas.removeEventListener('mousemove', stickImage, false);
|
|
|
|
- canvas.removeEventListener('touchmove', stickImage, false);
|
|
|
|
- //document.onmousemove = null;
|
|
|
|
- shift.x = index.x - mouse.x + shift.x;
|
|
|
|
- shift.y = index.y - mouse.y + shift.y;
|
|
|
|
- tmt = setTimeout(inertialImage, 100);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function putImage(x, y) { // est destiné à permettre l'effet d'amortissement par la mémorisation de la position courante.
|
|
|
|
- if (!zm.is_updated) return;
|
|
|
|
- if (x >= zm.im.width) { // rebouclage horizontal
|
|
|
|
- shift.x -= zm.im.width;
|
|
|
|
- x -= zm.im.width;
|
|
|
|
- } else if (x < 0) {
|
|
|
|
- shift.x += zm.im.width;
|
|
|
|
- x += zm.im.width;
|
|
|
|
- }
|
|
|
|
- if (y >= zm.im.height) { // pas de rebouclage vertical mais blocage
|
|
|
|
- //distort_canvas(1, x, y);
|
|
|
|
- shift.y = zm.im.height-1;
|
|
|
|
- y = zm.im.height-1;
|
|
|
|
- } else if (y < 0) {
|
|
|
|
- //distort_canvas(-1, x, y);
|
|
|
|
- shift.y = 0;
|
|
|
|
- y = 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- last.x = x;
|
|
|
|
- last.y = y;
|
|
|
|
- draw_image(x, y);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function inertialImage() {
|
|
|
|
- speed.x *= 0.9;
|
|
|
|
- speed.y *= 0.9;
|
|
|
|
- if (Math.abs(speed.x) > 2 || Math.abs(speed.y) > 2) {
|
|
|
|
- putImage(last.x+speed.x, last.y+speed.y);
|
|
|
|
- tmt = setTimeout(inertialImage, 100);
|
|
|
|
- } else {
|
|
|
|
- show_links();
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
function tri_ref_points(v1, v2) {
|
|
function tri_ref_points(v1, v2) {
|
|
return v1['x'] - v2['x'];
|
|
return v1['x'] - v2['x'];
|
|
@@ -505,31 +267,8 @@ function sort_points_by_rev_distance(p1, p2) {
|
|
|
|
|
|
|
|
|
|
function tzoom(zv) {
|
|
function tzoom(zv) {
|
|
- this.value = zv;
|
|
|
|
- this.ntiles = {x:0,y:0};
|
|
|
|
- this.tile = {width:0,height:0};
|
|
|
|
- this.last_tile = {width:0,height:0};
|
|
|
|
- this.max_tile = {width:0,height:0};
|
|
|
|
- this.im = {width:0,height:0};
|
|
|
|
- this.is_updated = false;
|
|
|
|
|
|
|
|
this.refresh = function() {
|
|
this.refresh = function() {
|
|
- this.im.visible_width = this.tile.width*(this.ntiles.x-1)+this.last_tile.width;
|
|
|
|
- this.is_updated = true;
|
|
|
|
-
|
|
|
|
- this.im.width = this.im.visible_width;
|
|
|
|
- this.im.height = this.tile.height*(this.ntiles.y-1)+this.last_tile.height;
|
|
|
|
- if (this.last_tile.width > this.tile.width) {
|
|
|
|
- this.max_tile.width = this.im.last_tile.width;
|
|
|
|
- } else {
|
|
|
|
- this.max_tile.width = this.tile.width;
|
|
|
|
- }
|
|
|
|
- if (this.last_tile.height > this.tile.height) {
|
|
|
|
- this.max_tile.height = this.im.last_tile.height;
|
|
|
|
- } else {
|
|
|
|
- this.max_tile.height = this.tile.height;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
var ord_pts = new Array();
|
|
var ord_pts = new Array();
|
|
for(var label in ref_points) {
|
|
for(var label in ref_points) {
|
|
ord_pts.push(ref_points[label]);
|
|
ord_pts.push(ref_points[label]);
|
|
@@ -725,61 +464,6 @@ function get_circle_size(point) {
|
|
return Math.max(Math.min(size, 50), 7);
|
|
return Math.max(Math.min(size, 50), 7);
|
|
}
|
|
}
|
|
|
|
|
|
-function reset_zooms () {
|
|
|
|
- for(i=0; i<zooms.length; i++) zooms[i].is_updated = false;
|
|
|
|
- zm.refresh();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function wheel_zoom (event) {
|
|
|
|
- var zshift = {x:0, y:0};
|
|
|
|
- if (event.pageX != undefined && event.pageX != undefined) {
|
|
|
|
- zshift.x = event.pageX-canvas.width/2-canvas_pos.x;
|
|
|
|
- zshift.y = event.pageY-canvas.height/2-canvas_pos.y;
|
|
|
|
- }
|
|
|
|
- //event.preventDefault();
|
|
|
|
-
|
|
|
|
- var delta = (event.wheelDelta || -event.detail);
|
|
|
|
- if (delta < 0 && zoom_control.value < zoom_control.max) {
|
|
|
|
- zoom_control.value++;
|
|
|
|
- change_zoom(zshift.x, zshift.y);
|
|
|
|
- } else if (delta > 0 && zoom_control.value > zoom_control.min) {
|
|
|
|
- zoom_control.value--;
|
|
|
|
- change_zoom(zshift.x, zshift.y);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function change_zoom(shx, shy) {
|
|
|
|
- var zoom_control = document.getElementById("zoom_ctrl");
|
|
|
|
- var v = zoom_control.value;
|
|
|
|
-
|
|
|
|
- prev_zm = zm;
|
|
|
|
-
|
|
|
|
- if (zooms[v]) {
|
|
|
|
- if (!zooms[v].is_updated) zooms[v].refresh();
|
|
|
|
- } else {
|
|
|
|
- zooms[v] = new tzoom(v);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (zooms[v].is_updated) {
|
|
|
|
- if (shx == undefined || shy == undefined) {
|
|
|
|
- shx=0;
|
|
|
|
- shy=0;
|
|
|
|
- }
|
|
|
|
- zm = zooms[v];
|
|
|
|
- var px = (last.x+shx)*zm.im.width/prev_zm.im.width - shx;
|
|
|
|
- var py = (last.y+shy)*zm.im.height/prev_zm.im.height - shy;
|
|
|
|
- if (py < zm.im.height && py >= 0) {
|
|
|
|
- zoom = zm.value;
|
|
|
|
- tile = zm.tile;
|
|
|
|
- ntiles = zm.ntiles;
|
|
|
|
- update_url();
|
|
|
|
- putImage(px, py);
|
|
|
|
- } else {
|
|
|
|
- zm = prev_zm;
|
|
|
|
- zoom_control.value = zm.value;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
function change_angle() {
|
|
function change_angle() {
|
|
var elvtn_control = document.getElementById('elvtn_ctrl');
|
|
var elvtn_control = document.getElementById('elvtn_ctrl');
|
|
@@ -946,10 +630,11 @@ function insert_ref_point(el, x, y) {
|
|
xhr.open("POST", "/api/v1/references/", true);
|
|
xhr.open("POST", "/api/v1/references/", true);
|
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
xhr.setRequestHeader("X-CSRFToken", csrf_token);
|
|
xhr.setRequestHeader("X-CSRFToken", csrf_token);
|
|
|
|
+ /* TODO: get correct x and y */
|
|
xhr.send("reference_point=" + refpoint_url
|
|
xhr.send("reference_point=" + refpoint_url
|
|
+ "&panorama=" + panorama_url
|
|
+ "&panorama=" + panorama_url
|
|
+ "&x=" + Math.floor(posx * image_width)
|
|
+ "&x=" + Math.floor(posx * image_width)
|
|
- + "&y=" + Math.floor((posy + 0.5) * image_height));
|
|
|
|
|
|
+ + "&y=" + Math.floor((posy + 0.5) * image_height));
|
|
|
|
|
|
// update the course of the panorama boundaries
|
|
// update the course of the panorama boundaries
|
|
// (update cap_min/cap_max of the panorama object)
|
|
// (update cap_min/cap_max of the panorama object)
|
|
@@ -974,27 +659,6 @@ function delete_ref_point(el) {
|
|
xhr.send();
|
|
xhr.send();
|
|
}
|
|
}
|
|
|
|
|
|
-function clean_canvas_events(e) {
|
|
|
|
- canvas.removeEventListener('mousemove', stickImage, false);
|
|
|
|
- canvas.removeEventListener('touchmove', stickImage, false);
|
|
|
|
- document.getElementById('info').style.display = 'none';
|
|
|
|
- speed.x = 0;
|
|
|
|
- speed.y = 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-canvas_set_size = function() {
|
|
|
|
- canvas.style.border = border_width+"px solid black";
|
|
|
|
- canvas.width = window.innerWidth-2*border_width;
|
|
|
|
- canvas.height = window.innerHeight-2*border_width;
|
|
|
|
- canvas_pos.x = canvas.offsetLeft+border_width;
|
|
|
|
- canvas_pos.y = canvas.offsetTop+border_width;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-canvas_resize = function() {
|
|
|
|
- canvas_set_size();
|
|
|
|
- putImage(last.x, last.y);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function paramIn(e) {
|
|
function paramIn(e) {
|
|
e = e || window.event;
|
|
e = e || window.event;
|
|
var relatedTarget = e.relatedTarget || e.fromElement;
|
|
var relatedTarget = e.relatedTarget || e.fromElement;
|
|
@@ -1068,26 +732,14 @@ function update_url() {
|
|
function load_pano() {
|
|
function load_pano() {
|
|
localisation = document.getElementById("locadraw");
|
|
localisation = document.getElementById("locadraw");
|
|
adding = document.getElementById("adding");
|
|
adding = document.getElementById("adding");
|
|
- canvas = document.getElementById("mon-canvas");
|
|
|
|
- cntext = canvas.getContext("2d");
|
|
|
|
canvas_set_size();
|
|
canvas_set_size();
|
|
canvas.addEventListener("click", check_links, false);
|
|
canvas.addEventListener("click", check_links, false);
|
|
- //canvas.addEventListener("oncontextmenu", manage_ref_points, false);
|
|
|
|
canvas.oncontextmenu = manage_ref_points;
|
|
canvas.oncontextmenu = manage_ref_points;
|
|
- canvas.addEventListener("mouseout" , clean_canvas_events, false);
|
|
|
|
show_links();
|
|
show_links();
|
|
|
|
|
|
var initial_orientation = get_orientation_from_url();
|
|
var initial_orientation = get_orientation_from_url();
|
|
var to_zoom = initial_orientation.zoom;
|
|
var to_zoom = initial_orientation.zoom;
|
|
|
|
|
|
- var max_zoom = zooms.length - 1;
|
|
|
|
- zoom_control = document.getElementById("zoom_ctrl");
|
|
|
|
- zoom_control.onchange = change_zoom;
|
|
|
|
- zoom_control.max = max_zoom;
|
|
|
|
- if (to_zoom > max_zoom) to_zoom = Math.floor(max_zoom/2);
|
|
|
|
- zm = zooms[to_zoom];
|
|
|
|
- zoom_control.value = to_zoom;
|
|
|
|
- zm.refresh();
|
|
|
|
|
|
|
|
zoom = zm.value;
|
|
zoom = zm.value;
|
|
tile = zm.tile;
|
|
tile = zm.tile;
|