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
57e18eb5
Commit
57e18eb5
authored
Jul 18, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create marker by clicking on shape - works for big distances
parent
5e599a5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
45 deletions
+58
-45
x3dom_init.js
js/x3dom_init.js
+58
-45
No files found.
js/x3dom_init.js
View file @
57e18eb5
...
@@ -353,6 +353,12 @@ X3DOMObject.Shape.prototype._registerEvents = function(){
...
@@ -353,6 +353,12 @@ X3DOMObject.Shape.prototype._registerEvents = function(){
X3DOMObject
.
Shape
.
toggle
(
this
);
X3DOMObject
.
Shape
.
toggle
(
this
);
}
}
if
(
self
.
_ctrlKey
){
X3DOMObject
.
createNewMarker
(
e
.
originalEvent
.
worldX
,
e
.
originalEvent
.
worldY
,
e
.
originalEvent
.
worldZ
);
}
});
});
$
(
this
.
_elem
).
on
(
"mouseover"
,
function
(
e
){
$
(
this
.
_elem
).
on
(
"mouseover"
,
function
(
e
){
...
@@ -1009,51 +1015,7 @@ X3DOMObject.PointerMarker.prototype._registerEvents = function(){
...
@@ -1009,51 +1015,7 @@ X3DOMObject.PointerMarker.prototype._registerEvents = function(){
var
xyz
=
$
(
this
).
parent
().
attr
(
"translation"
);
var
xyz
=
$
(
this
).
parent
().
attr
(
"translation"
);
xyz
=
xyz
.
split
(
" "
);
xyz
=
xyz
.
split
(
" "
);
// Create marker for Data
X3DOMObject
.
createNewMarker
(
xyz
[
0
],
xyz
[
1
],
xyz
[
2
]);
var
mark
=
new
X3L
({
x
:
parseFloat
(
xyz
[
0
])
||
0
,
y
:
parseFloat
(
xyz
[
1
])
||
0
,
z
:
parseFloat
(
xyz
[
2
])
||
0
,
color
:
SETTINGS
.
markercolor
,
size
:
SETTINGS
.
markersize
,
});
mark
.
d_x3d
=
Math
.
sqrt
(
mark
.
x
*
mark
.
x
+
mark
.
z
*
mark
.
z
);
mark
.
d_map
=
"<font style='color:red;'>drag over map</font>"
;
mark
.
align
=
{
latitude
:
0
,
longitude
:
0
,
x
:
mark
.
x
,
y
:
mark
.
y
,
z
:
mark
.
z
};
Data
.
markers
.
push
(
mark
);
X3DOMObject
.
displayMarkInfo
(
Data
.
markers
.
length
-
1
);
// Create marker on the scene
new
X3DOMObject
.
Marker
(
mark
.
x
,
mark
.
y
,
mark
.
z
);
var
da
=
x3dom_getDistAngle
(
mark
.
x
,
mark
.
y
,
mark
.
z
);
var
distance
=
da
[
0
];
var
angle
=
da
[
1
];
// Create marker on the map
Camera
.
createMeasureMarker
(
angle
,
distance
);
var
map_mark
=
Camera
.
_measureMarkers
[
Camera
.
_measureMarkers
.
length
-
1
];
// Update marker in Data
mark
.
latitude
=
map_mark
.
_latlng
.
lat
;
mark
.
longitude
=
map_mark
.
_latlng
.
lng
;
// register events for a new marker in Data
X3DOMObject
.
MapMarker
.
registerEvents
(
map_mark
);
// need?
Camera
.
_syncMeasureMarkersToBasePoint
();
});
});
...
@@ -1365,3 +1327,54 @@ X3DOMObject.displayMarkInfo = function(index){
...
@@ -1365,3 +1327,54 @@ X3DOMObject.displayMarkInfo = function(index){
}
}
}
}
X3DOMObject
.
createNewMarker
=
function
(
x
,
y
,
z
){
var
Camera
=
Map
.
marker
;
// Create marker for Data
var
mark
=
new
X3L
({
x
:
parseFloat
(
x
)
||
0
,
y
:
parseFloat
(
y
)
||
0
,
z
:
parseFloat
(
z
)
||
0
,
color
:
SETTINGS
.
markercolor
,
size
:
SETTINGS
.
markersize
,
});
mark
.
d_x3d
=
Math
.
sqrt
(
mark
.
x
*
mark
.
x
+
mark
.
z
*
mark
.
z
);
mark
.
d_map
=
"<font style='color:red;'>drag over map</font>"
;
mark
.
align
=
{
latitude
:
0
,
longitude
:
0
,
x
:
mark
.
x
,
y
:
mark
.
y
,
z
:
mark
.
z
};
Data
.
markers
.
push
(
mark
);
X3DOMObject
.
displayMarkInfo
(
Data
.
markers
.
length
-
1
);
// Create marker on the scene
new
X3DOMObject
.
Marker
(
mark
.
x
,
mark
.
y
,
mark
.
z
);
var
da
=
x3dom_getDistAngle
(
mark
.
x
,
mark
.
y
,
mark
.
z
);
var
distance
=
da
[
0
];
var
angle
=
da
[
1
];
// Create marker on the map
Camera
.
createMeasureMarker
(
angle
,
distance
);
var
map_mark
=
Camera
.
_measureMarkers
[
Camera
.
_measureMarkers
.
length
-
1
];
// Update marker in Data
mark
.
latitude
=
map_mark
.
_latlng
.
lat
;
mark
.
longitude
=
map_mark
.
_latlng
.
lng
;
// register events for a new marker in Data
X3DOMObject
.
MapMarker
.
registerEvents
(
map_mark
);
// need?
Camera
.
_syncMeasureMarkersToBasePoint
();
}
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