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
dbfa2f03
Commit
dbfa2f03
authored
Jul 14, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kml save with error codes
parent
89aabfd0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
19 deletions
+27
-19
index.js
js/index.js
+20
-17
ui_init.js
js/ui_init.js
+1
-1
modify_kml.php
modify_kml.php
+6
-1
No files found.
js/index.js
View file @
dbfa2f03
...
...
@@ -100,35 +100,35 @@ function parse_list(res){
//row.append("<td class='acell' valign='top'><div>"+vlist+"</div></td>");
row
.
attr
(
"index"
,
index
);
row
.
attr
(
"vlist"
,
vlist
);
register_row_events
(
row
);
$
(
"#model_table"
).
append
(
row
);
//place markers
var
subindex
=
0
;
$
(
this
).
find
(
"Camera"
).
each
(
function
(){
var
lat
=
$
(
this
).
find
(
"latitude"
).
text
();
var
lng
=
$
(
this
).
find
(
"longitude"
).
text
();
if
(
markers
[
lat
+
lng
]
==
undefined
){
var
marker
=
L
.
marker
([
lat
,
lng
]).
addTo
(
map
);
marker
.
bindPopup
(
name
+
": "
+
vlist
,{
direction
:
"top"
,
});
marker
.
index
=
index
;
markers
[
lat
+
lng
]
=
marker
;
}
else
{
console
.
log
(
markers
[
lat
+
lng
]);
var
content
=
markers
[
lat
+
lng
].
_popup
.
getContent
();
markers
[
lat
+
lng
].
_popup
.
setContent
(
content
+
"<br/>"
+
name
+
": "
+
vlist
);
marker
.
on
(
'click'
,
function
(){
//console.log("clicked"+this.index);
$
(
".arow[index="
+
this
.
index
+
"]"
).
click
();
});
if
(
markers
[
index
]
==
undefined
)
{
markers
[
index
]
=
[];
}
markers
[
index
][
subindex
]
=
marker
;
subindex
++
;
});
...
...
@@ -152,6 +152,8 @@ function register_row_events(elem){
});
var
index
=
$
(
this
).
attr
(
"index"
);
var
vlist
=
$
(
this
).
attr
(
"vlist"
);
var
name
=
$
(
this
).
find
(
"td"
).
attr
(
"title"
);
var
list
=
$
(
List
).
find
(
"model"
);
var
item
=
list
[
index
];
...
...
@@ -160,8 +162,9 @@ function register_row_events(elem){
map
.
panTo
(
new
L
.
LatLng
(
lat
,
lng
));
if
(
markers
[
lat
+
lng
]
!=
undefined
){
markers
[
lat
+
lng
].
openPopup
();
if
(
markers
[
index
]
!=
undefined
){
markers
[
index
][
0
].
_popup
.
setContent
(
name
+
": "
+
vlist
);
markers
[
index
][
0
].
openPopup
();
}
}
...
...
js/ui_init.js
View file @
dbfa2f03
...
...
@@ -226,7 +226,7 @@ function light_init(){
function
reset_to_initial_position
(){
$
.
ajax
({
url
:
SETTINGS
.
basepath
+
"/"
+
SETTINGS
.
path
+
"/"
+
SETTINGS
.
path
+
".kml"
,
url
:
SETTINGS
.
files
.
kml
+
"?"
+
Date
.
now
()
,
success
:
function
(
response
){
var
longitude
=
parseFloat
(
$
(
response
).
find
(
"Camera"
).
find
(
"longitude"
).
text
());
...
...
modify_kml.php
View file @
dbfa2f03
...
...
@@ -43,8 +43,13 @@ if (substr($target_filename,-4,4)!=".kml"){
if
(
!
is_file
(
$target_filename
)){
die
(
"-2"
);
}
if
(
!
is_writable
(
$target_filename
)){
die
(
"-3"
);
}
}
$target_xml
=
simplexml_load_file
(
$target_filename
);
$changes_xml
=
simplexml_load_file
(
'php://input'
);
...
...
@@ -92,6 +97,6 @@ foreach ($new_PhotoOverlay as $new_node) {
file_put_contents
(
$target_filename
,
$target_xml
->
asXML
());
echo
"ok"
;
die
(
"0"
)
;
?>
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