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){
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
)){
...
...
@@ -71,7 +78,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
}
else
{
var
viewingRay
=
elem
.
runtime
.
getViewingRay
(
cnvx
,
cnvy
);
x
=
viewingRay
.
dir
.
x
;
...
...
js/x3dom_init.js
View file @
8a21c4c4
...
...
@@ -575,11 +575,14 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
var
self
=
this
;
var
marker
=
this
.
_shape
;
var
id_prefix
=
$
(
this
.
_elem
).
attr
(
"id"
).
substr
(
0
,
PREFIX
.
length
);
var
index
=
parseInt
(
$
(
this
.
_elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
//
var id_prefix = $(this._elem).attr("id").substr(0,PREFIX.length);
//
var index = parseInt($(this._elem).attr("id").substr(PREFIX.length));
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();
//X3DOMObject.PointerMarker.dehighlight(self._elem);
...
...
@@ -587,10 +590,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
if
(
id_prefix
==
PREFIX
){
self
.
_
elem
.
remove
();
elem
.
remove
();
// REMOVE
Data
.
markers
.
splice
(
index
);
Data
.
markers
.
splice
(
index
,
1
);
Scene
.
updateMarkersIndices
();
Map
.
deleteMarker
(
index
);
...
...
@@ -599,7 +602,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
}
else
{
X3DOMObject
.
Marker
.
toggle
(
self
.
_
elem
);
X3DOMObject
.
Marker
.
toggle
(
elem
);
Map
.
toggleMarker
(
index
);
}
...
...
@@ -608,8 +611,13 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
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
);
Scene
.
highlighted_marker_index
=
index
;
if
(
Scene
.
_ctrlKey
){
...
...
@@ -630,16 +638,19 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mouseout'
,
function
(
e
){
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
//self.highlightMarker(index);
Scene
.
highlighted_marker_index
=
null
;
if
(
Scene
.
draggedTransformNode
==
null
){
if
(
!
self
.
_
elem
.
prop
(
"selected"
)){
X3DOMObject
.
Marker
.
dehighlight
(
self
.
_
elem
);
if
(
!
elem
.
prop
(
"selected"
)){
X3DOMObject
.
Marker
.
dehighlight
(
elem
);
Map
.
dehighlightMarker
(
index
);
}
else
{
X3DOMObject
.
Marker
.
highlight
(
self
.
_
elem
);
X3DOMObject
.
Marker
.
highlight
(
elem
);
Map
.
highlightMarker
(
index
);
}
...
...
@@ -649,7 +660,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
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
);
document
.
getElementById
(
"navInfo"
).
setAttribute
(
"type"
,
'"NONE"'
);
...
...
@@ -666,7 +680,10 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
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
);
});
...
...
@@ -762,6 +779,7 @@ X3DOMObject.Marker.mouseMove = function(event){
if
(
!
$
(
sr
.
pickObject
).
hasClass
(
"shapemarker"
)){
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
var
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
X3DOMObject
.
Marker
.
place
(
sr
.
pickPosition
.
x
,
sr
.
pickPosition
.
y
,
sr
.
pickPosition
.
z
,
"my-sph-"
+
index
);
//console.log("got shape");
//Scene.draggedTransformNode
...
...
@@ -791,7 +809,7 @@ X3DOMObject.Marker.drag = function(dx,dy){
var
sphere
=
$
(
Scene
.
draggedTransformNode
).
parent
().
parent
();
var
index
=
parseInt
(
sphere
.
attr
(
"id"
).
substr
(
7
));
X3DOMObject
.
Marker
.
slide
(
index
,
Scene
.
unsnappedDragPos
.
x
,
Scene
.
unsnappedDragPos
.
y
,
Scene
.
unsnappedDragPos
.
z
);
}
...
...
@@ -943,6 +961,8 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
map_mark
.
on
(
'mouseover'
,
function
(){
//console.log(this._index);
var
index
=
this
.
_index
;
var
elem
=
$
(
"#my-sph-"
+
index
);
...
...
@@ -1027,7 +1047,10 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
*/
X3DOMObject
.
displayInfo
=
function
(
e
){
console
.
log
(
"displayInfo"
);
if
(
Data
.
markers
.
length
==
0
){
ui_hideMessage
(
"window-markinfo"
);
}
//console.log("displayInfo");
var
elem
=
Scene
.
element
;
...
...
@@ -1048,7 +1071,7 @@ X3DOMObject.displayInfo = function(e){
if
(
SETTINGS
.
moreinfo
){
console
.
log
(
"displayInfo actual displaying"
);
//
console.log("displayInfo actual displaying");
$
(
"#window-info"
).
css
({
"font-size"
:
"16px"
});
...
...
@@ -1092,6 +1115,10 @@ X3DOMObject.displayInfo = function(e){
*/
X3DOMObject
.
displayViewInfo
=
function
(
e
){
if
(
Data
.
markers
.
length
==
0
){
ui_hideMessage
(
"window-markinfo"
);
}
if
(
!
e
.
target
){
e
.
clientX
=
$
(
window
).
width
()
/
2
;
e
.
clientY
=
$
(
window
).
height
()
/
2
;
...
...
@@ -1161,7 +1188,7 @@ X3DOMObject.displayViewInfo = function(e){
*/
X3DOMObject
.
displayMarkInfo
=
function
(
index
){
console
.
log
(
"displayMarkInfo"
);
//
console.log("displayMarkInfo");
var
hide
=
false
;
...
...
map.html
View file @
8a21c4c4
...
...
@@ -3,7 +3,7 @@
<head>
<title>
Ze Map
</title>
<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.camera-view-marker-controls.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker.js'
></script>
...
...
@@ -15,4 +15,4 @@
<body>
<div
id=
"leaflet_map"
></div>
</body>
</html>
\ No newline at end of file
</html>
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