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

display world or model coordinates

parent e837057d
......@@ -46,6 +46,7 @@ var Map;
var SETTINGS = {
'pointer': false,
'highlight': false,
'global_coordinates': true,
'markinfo': true,
'viewinfo': true,
'moreinfo': true,
......@@ -86,6 +87,7 @@ function parseURL(){
switch (parameters[i][0]) {
case "pointer": SETTINGS.pointer = true; break;
case "highlight": SETTINGS.highlight = true; break;
case "global_coordinates": SETTINGS.global_coordinates = true; break;
case "markinfo": SETTINGS.markinfo = true; break;
case "viewinfo": SETTINGS.viewinfo = true; break;
case "moreinfo": SETTINGS.moreinfo = true; break;
......
......@@ -105,6 +105,10 @@ function menu_init(){
align_init();
work_with_kml_init();
editmode_init();
$("#global_coordinates").on('click',function(){
ui_hideMessage("window-markinfo");
});
}
function crosshair_init(){
......
......@@ -1284,9 +1284,9 @@ X3DOMObject.displayViewInfo = function(e){
'</tr>',
'<tr>',
' <td>mouse</td>',
' <td>'+mouse.real.x+'</td>',
' <td>'+mouse.real.y+'</td>',
' <td>'+mouse.real.z+'</td>',
' <td>'+(SETTINGS.global_coordinates?mouse.real.x:mouse.x)+'</td>',
' <td>'+(SETTINGS.global_coordinates?mouse.real.y:mouse.y)+'</td>',
' <td>'+(SETTINGS.global_coordinates?mouse.real.z:mouse.z)+'</td>',
' <td>'+mouse.a+'</td>',
' <td>'+mouse.e+'</td>',
' <td>'+mouse.s+'</td>',
......@@ -1405,12 +1405,24 @@ X3DOMObject.displayMarkInfo = function(index){
var marker = Data.markers[index];
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"){
$(this).val(marker.align.real.x.toFixed(2));
$(this).val(x);
}else if (coord=="y"){
$(this).val(marker.align.real.y.toFixed(2));
$(this).val(y);
}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);
......@@ -1426,7 +1438,9 @@ X3DOMObject.displayMarkInfo = function(index){
z: parseFloat($("#marker_z").val())
};
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.slide(index,xyz.x,xyz.y,xyz.z);
......
......@@ -104,6 +104,10 @@ Instructions:
<div>
<h2>Settings</h2>
<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>
<td>Show marker info (satellite vs 3D model distalnce)</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