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
5ae63a0d
Commit
5ae63a0d
authored
Jul 20, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autocolors for markers
parent
1008c131
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
ui_init.js
js/ui_init.js
+14
-1
x3dom_init.js
js/x3dom_init.js
+5
-1
No files found.
js/ui_init.js
View file @
5ae63a0d
...
@@ -67,6 +67,16 @@ var SETTINGS = {
...
@@ -67,6 +67,16 @@ var SETTINGS = {
// 'kml' : "scene.kml"
// 'kml' : "scene.kml"
}
}
var
AUTOCOLORS
=
[
"#f22"
,
//red
"#f80"
,
//orange
"#fe2"
,
//yellow
"#0e0"
,
//green
"#1ff"
,
//lblue
"#49f"
,
//blue
"#a4f"
//purple
];
var
MARKER_PREFIX
=
"my-sph-"
;
var
MARKER_PREFIX
=
"my-sph-"
;
// no comments
// no comments
...
@@ -588,10 +598,13 @@ function leaf_events(){
...
@@ -588,10 +598,13 @@ function leaf_events(){
if
(
Lm
!=
undefined
){
if
(
Lm
!=
undefined
){
var
color
=
SETTINGS
.
markercolor
;
color
=
AUTOCOLORS
[
Data
.
markers
.
length
%
AUTOCOLORS
.
length
];
var
mark
=
new
X3L
({
var
mark
=
new
X3L
({
latitude
:
Lm
.
_latlng
.
lat
,
latitude
:
Lm
.
_latlng
.
lat
,
longitude
:
Lm
.
_latlng
.
lng
,
longitude
:
Lm
.
_latlng
.
lng
,
color
:
SETTINGS
.
marker
color
,
color
:
color
,
size
:
SETTINGS
.
markersize
,
size
:
SETTINGS
.
markersize
,
});
});
...
...
js/x3dom_init.js
View file @
5ae63a0d
...
@@ -1350,11 +1350,15 @@ X3DOMObject.createNewMarker = function(x,y,z){
...
@@ -1350,11 +1350,15 @@ X3DOMObject.createNewMarker = function(x,y,z){
var
Camera
=
Map
.
marker
;
var
Camera
=
Map
.
marker
;
// Create marker for Data
// Create marker for Data
var
color
=
SETTINGS
.
markercolor
;
color
=
AUTOCOLORS
[
Data
.
markers
.
length
%
AUTOCOLORS
.
length
];
var
mark
=
new
X3L
({
var
mark
=
new
X3L
({
x
:
parseFloat
(
x
)
||
0
,
x
:
parseFloat
(
x
)
||
0
,
y
:
parseFloat
(
y
)
||
0
,
y
:
parseFloat
(
y
)
||
0
,
z
:
parseFloat
(
z
)
||
0
,
z
:
parseFloat
(
z
)
||
0
,
color
:
SETTINGS
.
marker
color
,
color
:
color
,
size
:
SETTINGS
.
markersize
,
size
:
SETTINGS
.
markersize
,
});
});
...
...
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