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
8a21c4c4
Commit
8a21c4c4
authored
Jun 07, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. fixed marker deleting bug 2. fixed map.html 3. fixed 3d distance not in sync in 2 message divs
parent
00cb5a2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
19 deletions
+53
-19
x3dom_functions.js
js/x3dom_functions.js
+9
-2
x3dom_init.js
js/x3dom_init.js
+42
-15
map.html
map.html
+2
-2
No files found.
js/x3dom_functions.js
View file @
8a21c4c4
...
@@ -44,7 +44,14 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -44,7 +44,14 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
if
(
shootRay
.
pickPosition
!=
null
){
if
(
shootRay
.
pickPosition
!=
null
){
var
index
=
Scene
.
highlighted_marker_index
;
var
index
=
Scene
.
highlighted_marker_index
;
if
(
index
==
null
){
if
((
Scene
.
draggedTransformNode
!=
undefined
)
&&
(
Scene
.
draggedTransformNode
!=
null
)){
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
}
}
if
((
index
==
null
)
||
(
Data
.
markers
[
index
]
==
undefined
)){
if
((
index
==
null
)
||
(
Data
.
markers
[
index
]
==
undefined
)){
...
@@ -71,7 +78,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -71,7 +78,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
}
else
{
}
else
{
var
viewingRay
=
elem
.
runtime
.
getViewingRay
(
cnvx
,
cnvy
);
var
viewingRay
=
elem
.
runtime
.
getViewingRay
(
cnvx
,
cnvy
);
x
=
viewingRay
.
dir
.
x
;
x
=
viewingRay
.
dir
.
x
;
...
...
js/x3dom_init.js
View file @
8a21c4c4
...
@@ -575,11 +575,14 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -575,11 +575,14 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
var
self
=
this
;
var
self
=
this
;
var
marker
=
this
.
_shape
;
var
marker
=
this
.
_shape
;
var
id_prefix
=
$
(
this
.
_elem
).
attr
(
"id"
).
substr
(
0
,
PREFIX
.
length
);
//
var id_prefix = $(this._elem).attr("id").substr(0,PREFIX.length);
var
index
=
parseInt
(
$
(
this
.
_elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
//
var index = parseInt($(this._elem).attr("id").substr(PREFIX.length));
marker
.
on
(
'click'
,
function
(
e
){
marker
.
on
(
'click'
,
function
(
e
){
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
var
id_prefix
=
$
(
elem
).
attr
(
"id"
).
substr
(
0
,
PREFIX
.
length
);
//self.dehighlight();
//self.dehighlight();
//X3DOMObject.PointerMarker.dehighlight(self._elem);
//X3DOMObject.PointerMarker.dehighlight(self._elem);
...
@@ -587,10 +590,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -587,10 +590,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
if
(
id_prefix
==
PREFIX
){
if
(
id_prefix
==
PREFIX
){
self
.
_
elem
.
remove
();
elem
.
remove
();
// REMOVE
// REMOVE
Data
.
markers
.
splice
(
index
);
Data
.
markers
.
splice
(
index
,
1
);
Scene
.
updateMarkersIndices
();
Scene
.
updateMarkersIndices
();
Map
.
deleteMarker
(
index
);
Map
.
deleteMarker
(
index
);
...
@@ -599,7 +602,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -599,7 +602,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
}
else
{
}
else
{
X3DOMObject
.
Marker
.
toggle
(
self
.
_
elem
);
X3DOMObject
.
Marker
.
toggle
(
elem
);
Map
.
toggleMarker
(
index
);
Map
.
toggleMarker
(
index
);
}
}
...
@@ -608,8 +611,13 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -608,8 +611,13 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mouseover'
,
function
(
e
){
marker
.
on
(
'mouseover'
,
function
(
e
){
X3DOMObject
.
Marker
.
highlight
(
self
.
_elem
);
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
var
id_prefix
=
$
(
elem
).
attr
(
"id"
).
substr
(
0
,
PREFIX
.
length
);
X3DOMObject
.
Marker
.
highlight
(
elem
);
Map
.
highlightMarker
(
index
);
Map
.
highlightMarker
(
index
);
Scene
.
highlighted_marker_index
=
index
;
Scene
.
highlighted_marker_index
=
index
;
if
(
Scene
.
_ctrlKey
){
if
(
Scene
.
_ctrlKey
){
...
@@ -630,16 +638,19 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -630,16 +638,19 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mouseout'
,
function
(
e
){
marker
.
on
(
'mouseout'
,
function
(
e
){
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
//self.highlightMarker(index);
//self.highlightMarker(index);
Scene
.
highlighted_marker_index
=
null
;
Scene
.
highlighted_marker_index
=
null
;
if
(
Scene
.
draggedTransformNode
==
null
){
if
(
Scene
.
draggedTransformNode
==
null
){
if
(
!
self
.
_
elem
.
prop
(
"selected"
)){
if
(
!
elem
.
prop
(
"selected"
)){
X3DOMObject
.
Marker
.
dehighlight
(
self
.
_
elem
);
X3DOMObject
.
Marker
.
dehighlight
(
elem
);
Map
.
dehighlightMarker
(
index
);
Map
.
dehighlightMarker
(
index
);
}
else
{
}
else
{
X3DOMObject
.
Marker
.
highlight
(
self
.
_
elem
);
X3DOMObject
.
Marker
.
highlight
(
elem
);
Map
.
highlightMarker
(
index
);
Map
.
highlightMarker
(
index
);
}
}
...
@@ -649,7 +660,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -649,7 +660,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mousedown'
,
function
(
e
){
marker
.
on
(
'mousedown'
,
function
(
e
){
X3DOMObject
.
Marker
.
dehighlight
(
self
.
_elem
);
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
X3DOMObject
.
Marker
.
dehighlight
(
elem
);
Map
.
dehighlightMarker
(
index
);
Map
.
dehighlightMarker
(
index
);
document
.
getElementById
(
"navInfo"
).
setAttribute
(
"type"
,
'"NONE"'
);
document
.
getElementById
(
"navInfo"
).
setAttribute
(
"type"
,
'"NONE"'
);
...
@@ -666,7 +680,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -666,7 +680,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mouseup'
,
function
(
e
){
marker
.
on
(
'mouseup'
,
function
(
e
){
X3DOMObject
.
Marker
.
highlight
(
self
.
_elem
);
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
X3DOMObject
.
Marker
.
highlight
(
elem
);
Map
.
highlightMarker
(
index
);
Map
.
highlightMarker
(
index
);
});
});
...
@@ -762,6 +779,7 @@ X3DOMObject.Marker.mouseMove = function(event){
...
@@ -762,6 +779,7 @@ X3DOMObject.Marker.mouseMove = function(event){
if
(
!
$
(
sr
.
pickObject
).
hasClass
(
"shapemarker"
)){
if
(
!
$
(
sr
.
pickObject
).
hasClass
(
"shapemarker"
)){
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
var
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
var
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
X3DOMObject
.
Marker
.
place
(
sr
.
pickPosition
.
x
,
sr
.
pickPosition
.
y
,
sr
.
pickPosition
.
z
,
"my-sph-"
+
index
);
X3DOMObject
.
Marker
.
place
(
sr
.
pickPosition
.
x
,
sr
.
pickPosition
.
y
,
sr
.
pickPosition
.
z
,
"my-sph-"
+
index
);
//console.log("got shape");
//console.log("got shape");
//Scene.draggedTransformNode
//Scene.draggedTransformNode
...
@@ -791,7 +809,7 @@ X3DOMObject.Marker.drag = function(dx,dy){
...
@@ -791,7 +809,7 @@ X3DOMObject.Marker.drag = function(dx,dy){
var
sphere
=
$
(
Scene
.
draggedTransformNode
).
parent
().
parent
();
var
sphere
=
$
(
Scene
.
draggedTransformNode
).
parent
().
parent
();
var
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
var
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
X3DOMObject
.
Marker
.
slide
(
index
,
Scene
.
unsnappedDragPos
.
x
,
Scene
.
unsnappedDragPos
.
y
,
Scene
.
unsnappedDragPos
.
z
);
X3DOMObject
.
Marker
.
slide
(
index
,
Scene
.
unsnappedDragPos
.
x
,
Scene
.
unsnappedDragPos
.
y
,
Scene
.
unsnappedDragPos
.
z
);
}
}
...
@@ -943,6 +961,8 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
...
@@ -943,6 +961,8 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
map_mark
.
on
(
'mouseover'
,
function
(){
map_mark
.
on
(
'mouseover'
,
function
(){
//console.log(this._index);
var
index
=
this
.
_index
;
var
index
=
this
.
_index
;
var
elem
=
$
(
"#my-sph-"
+
index
);
var
elem
=
$
(
"#my-sph-"
+
index
);
...
@@ -1027,7 +1047,10 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
...
@@ -1027,7 +1047,10 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
*/
*/
X3DOMObject
.
displayInfo
=
function
(
e
){
X3DOMObject
.
displayInfo
=
function
(
e
){
console
.
log
(
"displayInfo"
);
if
(
Data
.
markers
.
length
==
0
){
ui_hideMessage
(
"window-markinfo"
);
}
//console.log("displayInfo");
var
elem
=
Scene
.
element
;
var
elem
=
Scene
.
element
;
...
@@ -1048,7 +1071,7 @@ X3DOMObject.displayInfo = function(e){
...
@@ -1048,7 +1071,7 @@ X3DOMObject.displayInfo = function(e){
if
(
SETTINGS
.
moreinfo
){
if
(
SETTINGS
.
moreinfo
){
console
.
log
(
"displayInfo actual displaying"
);
//
console.log("displayInfo actual displaying");
$
(
"#window-info"
).
css
({
"font-size"
:
"16px"
});
$
(
"#window-info"
).
css
({
"font-size"
:
"16px"
});
...
@@ -1092,6 +1115,10 @@ X3DOMObject.displayInfo = function(e){
...
@@ -1092,6 +1115,10 @@ X3DOMObject.displayInfo = function(e){
*/
*/
X3DOMObject
.
displayViewInfo
=
function
(
e
){
X3DOMObject
.
displayViewInfo
=
function
(
e
){
if
(
Data
.
markers
.
length
==
0
){
ui_hideMessage
(
"window-markinfo"
);
}
if
(
!
e
.
target
){
if
(
!
e
.
target
){
e
.
clientX
=
$
(
window
).
width
()
/
2
;
e
.
clientX
=
$
(
window
).
width
()
/
2
;
e
.
clientY
=
$
(
window
).
height
()
/
2
;
e
.
clientY
=
$
(
window
).
height
()
/
2
;
...
@@ -1161,7 +1188,7 @@ X3DOMObject.displayViewInfo = function(e){
...
@@ -1161,7 +1188,7 @@ X3DOMObject.displayViewInfo = function(e){
*/
*/
X3DOMObject
.
displayMarkInfo
=
function
(
index
){
X3DOMObject
.
displayMarkInfo
=
function
(
index
){
console
.
log
(
"displayMarkInfo"
);
//
console.log("displayMarkInfo");
var
hide
=
false
;
var
hide
=
false
;
...
...
map.html
View file @
8a21c4c4
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<head>
<head>
<title>
Ze Map
</title>
<title>
Ze Map
</title>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<script
type=
'text/javascript'
src=
'js/jquery-3.1.1.js'
></script>
<script
type=
'text/javascript'
src=
'js/jquery
/jquery
-3.1.1.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet-src.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet-src.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker-controls.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker-controls.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker.js'
></script>
...
@@ -15,4 +15,4 @@
...
@@ -15,4 +15,4 @@
<body>
<body>
<div
id=
"leaflet_map"
></div>
<div
id=
"leaflet_map"
></div>
</body>
</body>
</html>
</html>
\ No newline at end of file
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