Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
ba0dc914
Commit
ba0dc914
authored
Aug 23, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if kml is missing
parent
d24cda5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
60 deletions
+69
-60
ui_init.js
js/ui_init.js
+69
-60
No files found.
js/ui_init.js
View file @
ba0dc914
...
@@ -209,71 +209,80 @@ function light_init(){
...
@@ -209,71 +209,80 @@ function light_init(){
$
.
ajax
({
$
.
ajax
({
url
:
SETTINGS
.
files
.
kml
+
"?"
+
Date
.
now
(),
url
:
SETTINGS
.
files
.
kml
+
"?"
+
Date
.
now
(),
success
:
function
(
response
){
success
:
function
(
response
){
parse_light_init_response
(
response
);
var
longitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"longitude"
).
text
());
var
latitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"latitude"
).
text
());
var
altitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"altitude"
).
text
());
var
heading
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"heading"
).
text
());
var
tilt
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"tilt"
).
text
());
var
roll
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"roll"
).
text
());
var
fov
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"fov"
).
text
());
Data
.
camera
=
new
X3L
({
x
:
0
,
y
:
0
,
z
:
0
,
latitude
:
latitude
||
0
,
longitude
:
longitude
||
0
,
altitude
:
altitude
||
0
,
heading
:
heading
||
0
,
tilt
:
tilt
||
0
,
roll
:
roll
||
0
,
fov
:
fov
||
0
,
});
// store kml
// this data changes only in leaflet's edit location mode
Data
.
camera
.
kml
=
{
latitude
:
latitude
||
0
,
longitude
:
longitude
||
0
,
altitude
:
altitude
||
0
,
heading
:
heading
||
0
,
tilt
:
tilt
||
0
,
roll
:
roll
||
0
,
name
:
$
(
response
).
find
(
"name"
).
text
(),
description
:
$
(
response
).
find
(
"Camera"
).
find
(
"description"
).
text
(),
visibility
:
$
(
response
).
find
(
"visibility"
).
text
(),
href
:
$
(
response
).
find
(
"Icon"
).
find
(
"href"
).
text
()
};
var
element
=
document
.
getElementById
(
'x3d_id'
);
Scene
=
new
X3DOMObject
(
element
,
Data
,{});
Scene
.
initResize
();
$
.
getScript
(
"js/x3dom/x3dom-full.debug.js"
,
function
(){
Map
=
new
LeafletObject
(
'leaflet_map'
,
Data
,{});
//wait until it DOM is extended
x3dom
.
runtime
.
ready
=
function
(){
map_resize_init
();
deep_init
();
//align_init();
x3d_initial_camera_placement
();
Scene
.
resize
();
x3d_events
();
leaf_events
();
};
});
},
},
error
:
function
(
response
){
console
.
log
(
"KML not found. Using defaults"
);
parse_light_init_response
(
response
);
}
});
});
}
}
function
parse_light_init_response
(
response
){
var
longitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"longitude"
).
text
());
var
latitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"latitude"
).
text
());
var
altitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"altitude"
).
text
());
var
heading
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"heading"
).
text
());
var
tilt
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"tilt"
).
text
());
var
roll
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"roll"
).
text
());
var
fov
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"fov"
).
text
());
Data
.
camera
=
new
X3L
({
x
:
0
,
y
:
0
,
z
:
0
,
latitude
:
latitude
||
40.7233861
,
longitude
:
longitude
||
-
111.9328843
,
altitude
:
altitude
||
1305.1
,
heading
:
heading
||
0
,
tilt
:
tilt
||
90
,
roll
:
roll
||
0
,
fov
:
fov
||
0
,
});
// store kml
// this data changes only in leaflet's edit location mode
Data
.
camera
.
kml
=
{
latitude
:
latitude
||
40.7233861
,
longitude
:
longitude
||
-
111.9328843
,
altitude
:
altitude
||
1305.1
,
heading
:
heading
||
0
,
tilt
:
tilt
||
90
,
roll
:
roll
||
0
,
name
:
$
(
response
).
find
(
"name"
).
text
(),
description
:
$
(
response
).
find
(
"Camera"
).
find
(
"description"
).
text
(),
visibility
:
$
(
response
).
find
(
"visibility"
).
text
(),
href
:
$
(
response
).
find
(
"Icon"
).
find
(
"href"
).
text
()
};
var
element
=
document
.
getElementById
(
'x3d_id'
);
Scene
=
new
X3DOMObject
(
element
,
Data
,{});
Scene
.
initResize
();
$
.
getScript
(
"js/x3dom/x3dom-full.debug.js"
,
function
(){
Map
=
new
LeafletObject
(
'leaflet_map'
,
Data
,{});
//wait until it DOM is extended
x3dom
.
runtime
.
ready
=
function
(){
map_resize_init
();
deep_init
();
//align_init();
x3d_initial_camera_placement
();
Scene
.
resize
();
x3d_events
();
leaf_events
();
};
});
}
function
reset_to_initial_position
(){
function
reset_to_initial_position
(){
$
.
ajax
({
$
.
ajax
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment