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
61b1083a
Commit
61b1083a
authored
Jul 16, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. pass zooom and lat;lng from index to viewer and back
2. center on dblclick, no center on click 3. minor error fix
parent
e7e176f7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
9 deletions
+88
-9
index.js
js/index.js
+63
-6
ui_init.js
js/ui_init.js
+5
-0
ui_menu.js
js/ui_menu.js
+11
-1
x3dom_init.js
js/x3dom_init.js
+4
-1
list.php
list.php
+5
-1
No files found.
js/index.js
View file @
61b1083a
...
...
@@ -14,7 +14,7 @@ $(function(){
init_maps
();
init_help
();
var
url
=
'list.php?rating='
+
SETTINGS
.
rating
;
var
url
=
'list.php?rating='
+
SETTINGS
.
rating
+
'&basepath='
+
SETTINGS
.
basepath
;
if
(
SETTINGS
.
showall
){
url
+=
"?showall"
;
...
...
@@ -42,7 +42,8 @@ var SETTINGS = {
'lat'
:
44.92980751
,
'lng'
:
-
118.25683594
,
'zoom'
:
7
,
'model'
:
undefined
'model'
:
undefined
,
'basepath'
:
'models/all'
};
var
Dragged
=
false
;
...
...
@@ -139,11 +140,50 @@ function parseURL(){
case
"lat"
:
SETTINGS
.
lat
=
parseFloat
(
parameters
[
i
][
1
]);
break
;
case
"lng"
:
SETTINGS
.
lng
=
parseFloat
(
parameters
[
i
][
1
]);
break
;
case
"zoom"
:
SETTINGS
.
zoom
=
parseFloat
(
parameters
[
i
][
1
]);
break
;
// selected model
case
"model"
:
SETTINGS
.
model
=
parameters
[
i
][
1
];
break
;
case
"basepath"
:
SETTINGS
.
basepath
=
parameters
[
i
][
1
];
break
;
}
}
}
function
update_links
(){
// a. update links for selected only?
// b. update all - won't take long
// List
$
(
'.arow'
).
each
(
function
(){
var
arow
=
this
;
$
(
List
).
find
(
'model[name="'
+
$
(
arow
).
attr
(
"title"
)
+
'"]'
).
each
(
function
(){
var
name
=
$
(
this
).
attr
(
"name"
);
var
vlist
=
""
;
$
(
this
).
find
(
"version"
).
each
(
function
(
i
,
v
){
var
comments
=
$
(
this
).
find
(
"comments"
).
text
();
var
link_url
=
"viewer.html?path="
+
name
+
"&ver="
+
$
(
this
).
attr
(
"name"
)
+
"&rating="
+
SETTINGS
.
rating
;
link_url
+=
"&basepath="
+
SETTINGS
.
basepath
;
var
center
=
map
.
getCenter
();
var
zoom
=
map
.
getZoom
();
link_url
+=
"&lat="
+
center
.
lat
.
toFixed
(
8
)
+
"&lng="
+
center
.
lng
.
toFixed
(
8
)
+
"&zoom="
+
zoom
;
var
link
=
"<a title='"
+
comments
+
"' href='"
+
link_url
+
"'>"
+
$
(
this
).
attr
(
"name"
)
+
"</a>, "
;
vlist
+=
link
;
});
vlist
=
vlist
.
slice
(
0
,
-
7
);
$
(
arow
).
attr
(
"vlist"
,
vlist
);
markers
[
$
(
arow
).
attr
(
"index"
)][
0
].
vlist
=
vlist
;
var
tmp
=
popup_message
(
markers
[
$
(
arow
).
attr
(
"index"
)]);
markers
[
$
(
arow
).
attr
(
"index"
)][
0
].
_popup
.
setContent
(
tmp
);
});
});
}
function
parse_list
(
res
){
var
index
=
0
;
...
...
@@ -155,12 +195,13 @@ function parse_list(res){
var
thumb
=
$
(
this
).
attr
(
"thumb"
);
if
(
thumb
.
length
!=
""
){
srcpath
=
"models
/"
+
name
+
"/thumb.jpeg"
;
srcpath
=
SETTINGS
.
basepath
+
"
/"
+
name
+
"/thumb.jpeg"
;
}
else
{
srcpath
=
"js/images/thumb_na.jpeg"
;
}
row
.
append
(
"<td class='acell' title='"
+
name
+
"' ><div><img src='"
+
srcpath
+
"'></img></div></td>"
);
row
.
attr
(
'title'
,
name
);
//row.append("<td class='acell' valign='top'>"+name+"</td>");
...
...
@@ -170,6 +211,13 @@ function parse_list(res){
var
comments
=
$
(
this
).
find
(
"comments"
).
text
();
var
link_url
=
"viewer.html?path="
+
name
+
"&ver="
+
$
(
this
).
attr
(
"name"
)
+
"&rating="
+
SETTINGS
.
rating
;
link_url
+=
"&basepath="
+
SETTINGS
.
basepath
;
var
center
=
map
.
getCenter
();
var
zoom
=
map
.
getZoom
();
link_url
+=
"&lat="
+
center
.
lat
.
toFixed
(
8
)
+
"&lng="
+
center
.
lng
.
toFixed
(
8
)
+
"&zoom="
+
zoom
;
var
link
=
"<a title='"
+
comments
+
"' href='"
+
link_url
+
"'>"
+
$
(
this
).
attr
(
"name"
)
+
"</a>, "
;
vlist
+=
link
;
...
...
@@ -247,6 +295,14 @@ function register_row_events(elem){
console
.
log
(
"double click"
);
// put double click actions here
var
index
=
$
(
this
).
attr
(
"index"
);
var
list
=
$
(
List
).
find
(
"model"
);
var
item
=
list
[
index
];
var
lat
=
$
(
$
(
item
).
find
(
"latitude"
)[
0
]).
text
();
var
lng
=
$
(
$
(
item
).
find
(
"longitude"
)[
0
]).
text
();
map
.
panTo
(
new
L
.
LatLng
(
lat
,
lng
));
$
(
this
).
click
();
});
$
(
elem
).
on
(
"click"
,
function
(
e
){
...
...
@@ -271,7 +327,6 @@ function register_row_events(elem){
var
lng
=
$
(
$
(
item
).
find
(
"longitude"
)[
0
]).
text
();
BLOCK_MOVEEND
=
true
;
map
.
panTo
(
new
L
.
LatLng
(
lat
,
lng
));
if
(
markers
[
index
]
!=
undefined
){
...
...
@@ -410,7 +465,9 @@ function init_maps(){
var
center
=
map
.
getCenter
();
var
zoom
=
map
.
getZoom
();
window
.
history
.
pushState
(
""
,
"x3d models index"
,
"?lat="
+
center
.
lat
.
toFixed
(
8
)
+
"&lng="
+
center
.
lng
.
toFixed
(
8
)
+
"&zoom="
+
zoom
+
"&rating="
+
SETTINGS
.
rating
);
window
.
history
.
pushState
(
""
,
"x3d models index"
,
"?lat="
+
center
.
lat
.
toFixed
(
8
)
+
"&lng="
+
center
.
lng
.
toFixed
(
8
)
+
"&zoom="
+
zoom
+
"&rating="
+
SETTINGS
.
rating
+
"&basepath="
+
SETTINGS
.
basepath
);
update_links
();
if
(
!
BLOCK_MOVEEND
){
...
...
js/ui_init.js
View file @
61b1083a
...
...
@@ -135,6 +135,11 @@ function parseURL(){
case
"manualposor"
:
SETTINGS
.
manualposor
=
true
;
break
;
case
"experimental"
:
SETTINGS
.
experimental
=
true
;
break
;
// to recover the index position
case
"lat"
:
SETTINGS
.
lat
=
parameters
[
i
][
1
];
break
;
case
"lng"
:
SETTINGS
.
lng
=
parameters
[
i
][
1
];
break
;
case
"zoom"
:
SETTINGS
.
zoom
=
parameters
[
i
][
1
];
break
;
// case "kml": SETTINGS.kml = parameters[i][1]; break;
}
}
...
...
js/ui_menu.js
View file @
61b1083a
...
...
@@ -64,7 +64,17 @@ function menu_init(){
var
origin
=
window
.
location
.
origin
;
var
path
=
window
.
location
.
pathname
;
path
=
path
.
substr
(
0
,
path
.
lastIndexOf
(
"/"
));
window
.
location
.
href
=
origin
+
path
+
"?model="
+
SETTINGS
.
path
+
"&rating="
+
SETTINGS
.
rating
;
//var index_url = origin+path+"?model="+SETTINGS.path+"&rating="+SETTINGS.rating;
var
index_url
=
[
origin
+
path
,
"?lat="
+
SETTINGS
.
lat
,
"&lng="
+
SETTINGS
.
lng
,
"&zoom="
+
SETTINGS
.
zoom
,
"&rating="
+
SETTINGS
.
rating
,
"&basepath="
+
SETTINGS
.
basepath
,
"&model="
+
SETTINGS
.
path
].
join
(
""
);
window
.
location
.
href
=
index_url
;
});
$
(
"#download_button"
).
on
(
"click"
,
function
(){
...
...
js/x3dom_init.js
View file @
61b1083a
...
...
@@ -1185,7 +1185,10 @@ X3DOMObject.displayInfo = function(e){
}
//var dist = 1115;
var
dist
=
parseFloat
(
$
(
".GroupTop"
).
attr
(
"bboxSize"
).
trim
().
split
(
" "
)[
2
]);
var
dist
=
1115
;
if
(
$
(
".GroupTop"
).
attr
(
"bboxSize"
)
!=
undefined
){
dist
=
parseFloat
(
$
(
".GroupTop"
).
attr
(
"bboxSize"
).
trim
().
split
(
" "
)[
2
]);
}
$
(
"#window-info"
).
css
({
"font-size"
:
"20px"
});
...
...
list.php
View file @
61b1083a
<?php
$base
=
"models"
;
if
(
isset
(
$_GET
[
'basepath'
])){
$base
=
$_GET
[
'basepath'
];
}
else
{
$base
=
"models/all"
;
}
$THUMBNAME
=
"thumb.jpeg"
;
$RATINGFILE
=
"rating.txt"
;
...
...
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