Révision 8697fbab
ID | 8697fbabb931b4a3ec47ec39b73f0628df48e596 |
Parent | 943d3f9a |
Enfant | f576f563 |
if the ref_point not found, shows at least an error refs #303
Fichiers
- ajouté
- modifié
- copié
- renommé
- supprimé
Révisions
js/pano.js | ||
---|---|---|
867 | 867 |
|
868 | 868 |
function insert_ref_point(el, x, y) { |
869 | 869 |
var label, posx, posy; |
870 |
el.style.display = 'none'; |
|
870 |
el.style.display = 'none'; |
|
871 |
var selected_label = document.getElementById('sel_point').value; |
|
872 |
var found = false; |
|
871 | 873 |
for(var i = 0; i < zm.pt_list.length; i++) { |
872 | 874 |
label = zm.pt_list[i]['label']; |
873 |
if(label == document.getElementById('sel_point').value) {
|
|
875 |
if(label == selected_label) {
|
|
874 | 876 |
posx = nmodulo(last.x + x - canvas.width/2, zm.im.width)/zm.im.width; |
875 | 877 |
posy = 0.5 - (last.y + y - canvas.height/2)/zm.im.height; |
876 | 878 |
var pval = {x:posx, y:posy, cap:zm.pt_list[i]['cap'], ele:zm.pt_list[i]['ele'], label:label}; |
... | ... | |
878 | 880 |
document.getElementById('res').innerHTML = '<h4>Dernier point entré</h4>'; |
879 | 881 |
document.getElementById('res').innerHTML += '<p>reference["'+label+'"] = '+posx.toFixed(5)+','+posy.toFixed(5)+'</p>'; |
880 | 882 |
reset_zooms(); |
881 |
putImage(last.x, last.y); |
|
883 |
putImage(last.x, last.y); |
|
884 |
found = true; |
|
882 | 885 |
break; |
883 | 886 |
} |
884 | 887 |
} |
888 |
if (!found) { |
|
889 |
alert('unknown ref_point: '+label); |
|
890 |
} |
|
885 | 891 |
show_result(); |
886 | 892 |
|
887 | 893 |
// Then push the modif |