Commit 046f0d0a authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

display world or model coordinates

parent e837057d
...@@ -46,6 +46,7 @@ var Map; ...@@ -46,6 +46,7 @@ var Map;
var SETTINGS = { var SETTINGS = {
'pointer': false, 'pointer': false,
'highlight': false, 'highlight': false,
'global_coordinates': true,
'markinfo': true, 'markinfo': true,
'viewinfo': true, 'viewinfo': true,
'moreinfo': true, 'moreinfo': true,
...@@ -86,6 +87,7 @@ function parseURL(){ ...@@ -86,6 +87,7 @@ function parseURL(){
switch (parameters[i][0]) { switch (parameters[i][0]) {
case "pointer": SETTINGS.pointer = true; break; case "pointer": SETTINGS.pointer = true; break;
case "highlight": SETTINGS.highlight = true; break; case "highlight": SETTINGS.highlight = true; break;
case "global_coordinates": SETTINGS.global_coordinates = true; break;
case "markinfo": SETTINGS.markinfo = true; break; case "markinfo": SETTINGS.markinfo = true; break;
case "viewinfo": SETTINGS.viewinfo = true; break; case "viewinfo": SETTINGS.viewinfo = true; break;
case "moreinfo": SETTINGS.moreinfo = true; break; case "moreinfo": SETTINGS.moreinfo = true; break;
......
...@@ -105,6 +105,10 @@ function menu_init(){ ...@@ -105,6 +105,10 @@ function menu_init(){
align_init(); align_init();
work_with_kml_init(); work_with_kml_init();
editmode_init(); editmode_init();
$("#global_coordinates").on('click',function(){
ui_hideMessage("window-markinfo");
});
} }
function crosshair_init(){ function crosshair_init(){
......
...@@ -1284,9 +1284,9 @@ X3DOMObject.displayViewInfo = function(e){ ...@@ -1284,9 +1284,9 @@ X3DOMObject.displayViewInfo = function(e){
'</tr>', '</tr>',
'<tr>', '<tr>',
' <td>mouse</td>', ' <td>mouse</td>',
' <td>'+mouse.real.x+'</td>', ' <td>'+(SETTINGS.global_coordinates?mouse.real.x:mouse.x)+'</td>',
' <td>'+mouse.real.y+'</td>', ' <td>'+(SETTINGS.global_coordinates?mouse.real.y:mouse.y)+'</td>',
' <td>'+mouse.real.z+'</td>', ' <td>'+(SETTINGS.global_coordinates?mouse.real.z:mouse.z)+'</td>',
' <td>'+mouse.a+'</td>', ' <td>'+mouse.a+'</td>',
' <td>'+mouse.e+'</td>', ' <td>'+mouse.e+'</td>',
' <td>'+mouse.s+'</td>', ' <td>'+mouse.s+'</td>',
...@@ -1405,12 +1405,24 @@ X3DOMObject.displayMarkInfo = function(index){ ...@@ -1405,12 +1405,24 @@ X3DOMObject.displayMarkInfo = function(index){
var marker = Data.markers[index]; var marker = Data.markers[index];
var coord = $(this).attr("id").substr(-1); var coord = $(this).attr("id").substr(-1);
var x,y,z;
if (SETTINGS.global_coordinates){
x = marker.align.real.x.toFixed(2);
y = marker.align.real.y.toFixed(2);
z = marker.align.real.z.toFixed(2);
}else{
x = marker.align.x.toFixed(2);
y = marker.align.y.toFixed(2);
z = marker.align.z.toFixed(2);
}
if (coord=="x"){ if (coord=="x"){
$(this).val(marker.align.real.x.toFixed(2)); $(this).val(x);
}else if (coord=="y"){ }else if (coord=="y"){
$(this).val(marker.align.real.y.toFixed(2)); $(this).val(y);
}else if (coord=="z"){ }else if (coord=="z"){
$(this).val(marker.align.real.z.toFixed(2)); $(this).val(z);
} }
//var xyz_real = x3dom_scene_to_real(x,y,z); //var xyz_real = x3dom_scene_to_real(x,y,z);
...@@ -1426,7 +1438,9 @@ X3DOMObject.displayMarkInfo = function(index){ ...@@ -1426,7 +1438,9 @@ X3DOMObject.displayMarkInfo = function(index){
z: parseFloat($("#marker_z").val()) z: parseFloat($("#marker_z").val())
}; };
xyz = x3dom_real_to_scene(xyz.x,xyz.y,xyz.z); if (SETTINGS.global_coordinates){
xyz = x3dom_real_to_scene(xyz.x,xyz.y,xyz.z);
}
X3DOMObject.Marker.place(xyz.x,xyz.y,xyz.z,"my-sph-"+index); X3DOMObject.Marker.place(xyz.x,xyz.y,xyz.z,"my-sph-"+index);
X3DOMObject.Marker.slide(index,xyz.x,xyz.y,xyz.z); X3DOMObject.Marker.slide(index,xyz.x,xyz.y,xyz.z);
......
...@@ -104,6 +104,10 @@ Instructions: ...@@ -104,6 +104,10 @@ Instructions:
<div> <div>
<h2>Settings</h2> <h2>Settings</h2>
<table> <table>
<tr>
<td>Display world (checked) or model coordinates</td>
<td><input id='global_coordinates' type='checkbox' class='my-check-box donothide' /></td>
</tr>
<tr> <tr>
<td>Show marker info (satellite vs 3D model distalnce)</td> <td>Show marker info (satellite vs 3D model distalnce)</td>
<td><input id='markinfo' type='checkbox' class='my-check-box donothide' /></td> <td><input id='markinfo' type='checkbox' class='my-check-box donothide' /></td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment