Commit 5cac88b3 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

initial -db support

parent 132cc4a4
<?php
/********************************************************************************
*! FILE NAME : call_filter.php
*! DESCRIPTION: blocks direct calls, useless against fake referer.
*! VERSION: 1.0
*! AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! The four essential freedoms with GNU GPL software:
*! * the freedom to run the program for any purpose
*! * the freedom to study how the program works and change it to make it do what you wish
*! * the freedom to redistribute copies so you can help your neighbor
*! * the freedom to distribute copies of your modified versions to others
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*! $Log: call_filter.php,v $
*!
*/
// $check = strpos($_SERVER['HTTP_REFERER'],"http://127.0.0.1");
//
// if (($check!=0) || ($check===false)) {
// header("HTTP/1.1 404 File Not Found", 404); die();
// }
?>
\ No newline at end of file
<?php
/********************************************************************************
*! FILE NAME : copy_kml.php
*! DESCRIPTION: gets a list of kmls in the directory
*! VERSION: 1.0
*! AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! The four essential freedoms with GNU GPL software:
*! * the freedom to run the program for any purpose
*! * the freedom to study how the program works and change it to make it do what you wish
*! * the freedom to redistribute copies so you can help your neighbor
*! * the freedom to distribute copies of your modified versions to others
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*! $Log: copy_kml.php,v $
*!
*/
include("pano_db_functions.php");
require_once("call_filter.php");
if (!isset($_GET['proto'])) die();
if (!isset($_GET['kml'])) die();
if (count(search_kmls())>=10) die("Max file limit");
$proto = $_GET['proto'];
$kml = $_GET['kml'];
if (substr($kml,-3,3)!="kml") die();
if (is_file("kml_files/".$proto)) {
copy("kml_files/".$proto,"kml_files/".$kml);
chmod("kml_files/".$kml,0777);
echo "Done";
}else{
ConnectMySQL();
$Nodes = GetNodesByRoute($proto);
$kml_str = "";
if (isset($Nodes['error'])) {
echo "Error1";
die();
}
foreach ($Nodes as $Node) {
if (!isset($Node['error'])) $kml_str .= CreateKMLEntry($Node);
else {
send_response(CreateXMLStringFromArray($Node['error']));
die();
}
}
if ($kml_str!="") {
$result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$result .= "<kml xmlns=\"http://earth.google.com/kml/2.2\">\n";
$result .= "<Document>\n";
$result .= $kml_str;
$result .= "</Document></kml>";
file_put_contents("kml_files/".$kml,$result);
chmod("kml_files/".$kml,0777);
echo "Done";
}else
echo "Error";
}
?>
\ No newline at end of file
<?php
/********************************************************************************
*! FILE NAME : display_kml.php
*! DESCRIPTION: displays KML records on the page
*! VERSION: 1.0
*! AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! The four essential freedoms with GNU GPL software:
*! * the freedom to run the program for any purpose
*! * the freedom to study how the program works and change it to make it do what you wish
*! * the freedom to redistribute copies so you can help your neighbor
*! * the freedom to distribute copies of your modified versions to others
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*! $Log: display_kml.php,v $
*!
*/
include("pano_db_functions.php");
if (isset($_GET['id'])) $id = $_GET['id'];
else die("Error Code: 13542");
if (is_file("kml_files/".$id)) {
$content = file_get_contents("kml_files/".$id);
header("Content-Type: text/xml\n");
header("Content-Length: ".strlen($content)."\n");
header("Pragma: no-cache\n");
echo $content;
}else{
ConnectMySQL();
$Nodes = GetNodesByRoute($id);
$kml = "";
if (isset($Nodes['error'])) {
send_response("<?xml version=\"1.0\"?>\n<result><node><error>".$Nodes['error']."</error></node></result>");
die();
}
foreach ($Nodes as $Node) {
if (!isset($Node['error'])) $kml .= CreateKMLEntry($Node);
else {
send_response(CreateXMLStringFromArray($Node['error']));
die();
}
}
if ($kml!="") PrintKML2($kml);
else send_response("<?xml version=\"1.0\"?>\n<result><node><error>Some error, no apologies</error></node></result>");
}
function PrintKML2($kml) {
$content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$content .= "<kml xmlns=\"http://earth.google.com/kml/2.2\">\n";
$content .= "<Document>\n";
$content .= $kml;
$content .= "</Document></kml>";
header("Content-Type: text/xml\n");
header("Content-Length: ".strlen($content)."\n");
header("Pragma: no-cache\n");
echo $content;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
/********************************************************************************
*! FILE NAME : filelist.php
*! DESCRIPTION: gets a list of kmls in the directory
*! VERSION: 1.0
*! AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! The four essential freedoms with GNU GPL software:
*! * the freedom to run the program for any purpose
*! * the freedom to study how the program works and change it to make it do what you wish
*! * the freedom to redistribute copies so you can help your neighbor
*! * the freedom to distribute copies of your modified versions to others
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*! $Log: filelist.php,v $
*!
*/
require_once("call_filter.php");
//$type = $_GET["type"];
$type = "kml";
$filelist = scandir("kml_files/");
$pre_res_xml="";
foreach ($filelist as $value) {
//printf($value."\n");
process_folder($value,$type);
}
flush_xml($pre_res_xml);
function process_folder($file,$type) {
global $pre_res_xml;
$ext=get_file_extension("kml_files/".$file);
// exclude "." & ".."
if ($ext==$type && (substr($file,0,1)!=".")) {
$pre_res_xml .= "<f>$file</f>\n";
}
}
function get_file_extension($filename) {
//return substr(strrchr($filename, '.'), 1);
return pathinfo($filename, PATHINFO_EXTENSION);
}
function flush_xml($pre_res_xml) {
$res_xml = "<?xml version='1.0' standalone='yes'?>\n";
$res_xml .="<folder_list>\n";
$res_xml .= $pre_res_xml;
$res_xml .="</folder_list>\n";
header("Content-Type: text/xml");
header("Content-Length: ".strlen($res_xml)."\n");
header("Pragma: no-cache\n");
printf("%s", $res_xml);
flush();
}
?>
\ No newline at end of file
[Dolphin]
PreviewsShown=true
SortOrder=1
SortRole=date
Sorting=2
Timestamp=2016,12,27,10,45,34
Version=3
ViewMode=1
body{
font-family:"Times New Roman", Times, serif;
}
button {
font-family:"Times New Roman", Times, serif;
border: 0px solid black;
font-size: 16px;
/*line-height: 24px;*/
padding: 3px 20px 3px 20px;
/*border radius*/
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
/*shadow*/
-moz-box-shadow: 1px 1px 1px gray;
-webkit-box-shadow: 1px 1px 1px gray;
box-shadow: 1px 1px 1px gray;
/*text-shadow: 1px 1px 1px gray;*/
color: rgba(60,60,60,1);
text-align:center;
/*remove text selection*/
/* -webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;*/
}
button:active {
text-shadow: 0px 0px 0px gray;
color: rgba(100,100,100,1);
/*shadow*/
-moz-box-shadow: 0px 0px 0px gray;
-webkit-box-shadow: 0px 0px 0px gray;
box-shadow: 0px 0px 0px gray;
}
button:hover{
/* -moz-box-shadow: 0px 0px 10px black;
-webkit-box-shadow: 0px 0px 10px black;
box-shadow: 0px 0px 10px black; */
}
/*background gradients*/
button {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(100,200,100,0.7)), to(rgba(100,200,100,0.7))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(100,200,100,0.7), rgba(100,200,100,0.7)); /* for firefox 3.6+ */
}
button:hover {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(170,256,170,1)), to(rgba(130,230,130,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(170,256,170,1), rgba(130,230,130,1)); /* for firefox 3.6+ */
}
button:active {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(200,200,200,1)), to(rgba(150,150,150,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(200,200,200,1), rgba(150,150,150,1)); /* for firefox 3.6+ */
}
.input_text {
border: 0px solid black;
/*line-height: 22px;*/
width: 100px;
height: 24px;
-moz-line-height: 22px;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
files/dot.png

406 Bytes

/*
*! -----------------------------------------------------------------------------**
*! FILE NAME : dots.js
*! REVISION : 1.0
*! DESCRIPTION: draw lines webgl procedures (originate from drawing arrows)
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*!
*! It means that the program's users have the four essential freedoms:
*!
*! * The freedom to run the program, for any purpose (freedom 0).
*! * The freedom to study how the program works, and change it to make it do what you wish (freedom 1).
*! Access to the source code is a precondition for this.
*! * The freedom to redistribute copies so you can help your neighbor (freedom 2).
*! * The freedom to distribute copies of your modified versions to others (freedom 3).
*!
*! By doing this you can give the whole community a chance to benefit from your changes.
*! Access to the source code is a precondition for this.
*! -----------------------------------------------------------------------------**
*/
var dotTexture;
var dotVertexPositionBuffer;
var dotVertexPositionBuffer2;
var dotVertexIndexBuffer;
var dotVertexTextureCoordBuffer;
var dotVertexNormalBuffer;
function handleLoadedDotTexture(texture) {
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.bindTexture(gl.TEXTURE_2D, null);
}
function initDotTexture() {
dotTexture = gl.createTexture();
dotTexture.image = new Image();
dotTexture.image.onload = function() {
handleLoadedDotTexture(dotTexture)
}
dotTexture.image.src = "files/dot.png";
}
function initDotBuffers() {
dotVertexPositionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, dotVertexPositionBuffer);
var vertices = [
-1, 0, 0.0,
-1, 0, 0.0,
-1, 0, 0.0,
-1, 0, 0.0,
1, 0, 0.0,
1, 0, 0.0,
1, 0, 0.0
];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);
dotVertexPositionBuffer.itemSize = 3;
dotVertexPositionBuffer.numItems = 7;
dotVertexPositionBuffer2 = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, dotVertexPositionBuffer2);
var vertices2 = [
0, -1, 0.0,
0, -1, 0.0,
0, -1, 0.0,
0, -1, 0.0,
0, 1, 0.0,
0, 1, 0.0,
0, 1, 0.0
];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices2), gl.STATIC_DRAW);
dotVertexPositionBuffer2.itemSize = 3;
dotVertexPositionBuffer2.numItems = 7;
dotVertexTextureCoordBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, dotVertexTextureCoordBuffer);
var textureCoords = [
1.0, 1.0,
1.0, 1.0,
1.0, 1.0,
1.0, 0.0,
0.0, 0.0,
0.0, 1.0,
0.0, 1.0
];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoords), gl.STATIC_DRAW);
dotVertexTextureCoordBuffer.itemSize = 2;
dotVertexTextureCoordBuffer.numItems = 7;
dotVertexNormalBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, dotVertexNormalBuffer);
var vertexNormals = [
0.0, 1.0, 0.0,
0.0, 1.0, 0.0,
0.0, 1.0, 0.0,
0.0, 1.0, 0.0,
0.0, 1.0, 0.0,
0.0, 1.0, 0.0,
0.0, 1.0, 0.0
];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexNormals), gl.STATIC_DRAW);
dotVertexNormalBuffer.itemSize = 3;
dotVertexNormalBuffer.numItems = 7;
dotVertexIndexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, dotVertexIndexBuffer);
var dotVertexIndices = [
0, 1, 6,
5, 2, 3,
5, 3, 4
]
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(dotVertexIndices), gl.STATIC_DRAW);
dotVertexIndexBuffer.itemSize = 1;
dotVertexIndexBuffer.numItems = 9;
}
function drawLine(axis,angle,down, distance,someVertexPositionBuffer) {
loadIdentity();
var axisMatrix = createRotationMatrix(angle, [axis.e(1), axis.e(2), axis.e(3)]);
multMatrix(axisMatrix);
mvTranslate([0.0, -down, -distance]);
setMatrixUniforms();
gl.uniform1f(shaderProgram.alphaUniform, 1.0);
gl.disable(gl.BLEND);
gl.enable(gl.DEPTH_TEST);
gl.uniform1f(shaderProgram.alphaUniform, 1.0);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, dotTexture);
gl.uniform1i(shaderProgram.samplerUniform, 0);
gl.lineWidth(3);
gl.bindBuffer(gl.ARRAY_BUFFER, dotVertexTextureCoordBuffer);
gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, dotVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, dotVertexNormalBuffer);
gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, dotVertexNormalBuffer.itemSize, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, someVertexPositionBuffer);
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, someVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, dotVertexIndexBuffer);
gl.drawElements(gl.LINE_STRIP, dotVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);
}
\ No newline at end of file
/*
*! -----------------------------------------------------------------------------**
*! FILE NAME : extras.js
*! REVISION : 1.0
*! DESCRIPTION: additional funcions for maps, blinking (to be moved somewhere else later)
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*!
*! It means that the program's users have the four essential freedoms:
*!
*! * The freedom to run the program, for any purpose (freedom 0).
*! * The freedom to study how the program works, and change it to make it do what you wish (freedom 1).
*! Access to the source code is a precondition for this.
*! * The freedom to redistribute copies so you can help your neighbor (freedom 2).
*! * The freedom to distribute copies of your modified versions to others (freedom 3).
*!
*! By doing this you can give the whole community a chance to benefit from your changes.
*! Access to the source code is a precondition for this.
*! -----------------------------------------------------------------------------**
*/
var osm_CurrentMarker;
function initialize_maps() {
// why did I use range here?
var url=serverURL+"?kml="+settings.kml+"&range="+settings.range;
//var url=serverURL+"?kml="+settings.kml;
if (settings.mask!="") url+="&mask="+settings.mask; // use second KML file to overwrite main KML file settings
//if (settings.map!="") url+="&map="+settings.map;
url+="&map=all";
//if (settings.start!="") url+="&href="+settings.start+"&range="+settings.range;
if (settings.start!="") url+="&href="+settings.start;
if ((typeof(settings.proto)!="undefined") && (settings.proto!="")) url+="&proto="+settings.proto; // use this KML file as a prototype for kml= (copy to kml if kml does not exist)
$("#map_header").trigger('click');
$("#osmap_header").trigger('click');
requestKml(url,place_points);
//requestKml(serverURL+"?kml="+settings.kml,place_points);
/*toggle_gmap();
toggle_osmap(); */
}
function initialize_maps_nowebgl() {
var url=serverURL+"?kml="+settings.kml+"&range="+settings.range;
if (settings.mask!="") url+="&mask="+settings.mask; // use second KML file to overwrite main KML file settings
//if (settings.map!="") url+="&map="+settings.map;
url+="&map=all";
//if (settings.start!="") url+="&href="+settings.start+"&range="+settings.range;
if (settings.start!="") url+="&href="+settings.start;
if ((typeof(settings.proto)!="undefined") && (settings.proto!="")) url+="&proto="+settings.proto; // use this KML file as a prototype for kml= (copy to kml if kml does not exist)
$("#map_header").trigger('click');
$("#osmap_header").trigger('click');
requestKml(url,place_points_nowebgl);
//requestKml(serverURL+"?kml="+settings.kml,place_points);
/*toggle_gmap();
toggle_osmap(); */
}
function loading_blink(){
var d = new Date();
var curr_sec = d.getSeconds();
if (curr_sec%4==1) {
document.getElementById('status').style.color = "white";
document.getElementById('status').innerHTML = "Loading.";
}
else if (curr_sec%4==2) {
document.getElementById('status').style.color = "black";
document.getElementById('status').innerHTML = "Loading..";
}
else if (curr_sec%4==3) {
document.getElementById('status').style.color = "white";
document.getElementById('status').innerHTML = "Loading...";
}
else {
document.getElementById('status').style.color = "black";
document.getElementById('status').innerHTML = "Loading";
}
}
function pre_loading_blink() {
var top = window.innerHeight;
var left = window.innerWidth;
top = top/2;
left = left/2;
document.getElementById('status').style.top = top - $('#status').height()/2;
document.getElementById('status').style.left = left - $('#status').width()/2;
$("#status").show();
$("#status").html("Loading");
}
function place_point(node,index) {
marker = node;
osm_CurrentMarker=marker;
osm_place_point(marker,index);
}
function getMapNodes(url,href){
pre_loading_blink();
loading_intvl=setInterval("loading_blink()",1000);
//map = [];
var url=serverURL+"?kml="+settings.kml+"&range="+settings.range;
if (settings.mask!="") url+="&mask="+settings.mask; // use second KML file to overwrite main KML file settings
//if (settings.map!="") url+="&map="+settings.map;
url+="&map=all";
//if (settings.start!="") url+="&href="+settings.start+"&range="+settings.range;
url+="&href="+href;
requestKml(url,kmlGot);
//requestKml(url+req,kmlGot);
}
/*
*! -----------------------------------------------------------------------------**
*! FILE NAME : extras.js
*! REVISION : 1.0
*! DESCRIPTION: additional funcions for maps, blinking (to be moved somewhere else later)
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*!
*! It means that the program's users have the four essential freedoms:
*!
*! * The freedom to run the program, for any purpose (freedom 0).
*! * The freedom to study how the program works, and change it to make it do what you wish (freedom 1).
*! Access to the source code is a precondition for this.
*! * The freedom to redistribute copies so you can help your neighbor (freedom 2).
*! * The freedom to distribute copies of your modified versions to others (freedom 3).
*!
*! By doing this you can give the whole community a chance to benefit from your changes.
*! Access to the source code is a precondition for this.
*! -----------------------------------------------------------------------------**
*/
var osm_CurrentMarker;
function initialize_maps() {
// why did I use range here?
var url=serverURL+"?kml="+settings.kml+"&range="+settings.range;
//var url=serverURL+"?kml="+settings.kml;
if (settings.mask!="") url+="&mask="+settings.mask; // use second KML file to overwrite main KML file settings
//if (settings.map!="") url+="&map="+settings.map;
url+="&map=all";
//if (settings.start!="") url+="&href="+settings.start+"&range="+settings.range;
if (settings.start!="") url+="&href="+settings.start;
if ((typeof(settings.proto)!="undefined") && (settings.proto!="")) url+="&proto="+settings.proto; // use this KML file as a prototype for kml= (copy to kml if kml does not exist)
$("#map_header").trigger('click');
$("#osmap_header").trigger('click');
requestKml(url,place_points);
//requestKml(serverURL+"?kml="+settings.kml,place_points);
/*toggle_gmap();
toggle_osmap(); */
}
function initialize_maps_nowebgl() {
var url=serverURL+"?kml="+settings.kml+"&range="+settings.range;
if (settings.mask!="") url+="&mask="+settings.mask; // use second KML file to overwrite main KML file settings
//if (settings.map!="") url+="&map="+settings.map;
url+="&map=all";
//if (settings.start!="") url+="&href="+settings.start+"&range="+settings.range;
if (settings.start!="") url+="&href="+settings.start;
if ((typeof(settings.proto)!="undefined") && (settings.proto!="")) url+="&proto="+settings.proto; // use this KML file as a prototype for kml= (copy to kml if kml does not exist)
$("#map_header").trigger('click');
$("#osmap_header").trigger('click');
requestKml(url,place_points_nowebgl);
//requestKml(serverURL+"?kml="+settings.kml,place_points);
/*toggle_gmap();
toggle_osmap(); */
}
function loading_blink(){
var d = new Date();
var curr_sec = d.getSeconds();
if (curr_sec%4==1) {
document.getElementById('status').style.color = "white";
document.getElementById('status').innerHTML = "Loading.";
}
else if (curr_sec%4==2) {
document.getElementById('status').style.color = "black";
document.getElementById('status').innerHTML = "Loading..";
}
else if (curr_sec%4==3) {
document.getElementById('status').style.color = "white";
document.getElementById('status').innerHTML = "Loading...";
}
else {
document.getElementById('status').style.color = "black";
document.getElementById('status').innerHTML = "Loading";
}
}
function pre_loading_blink() {
var top = window.innerHeight;
var left = window.innerWidth;
top = top/2;
left = left/2;
document.getElementById('status').style.top = top - $('#status').height()/2;
document.getElementById('status').style.left = left - $('#status').width()/2;
$("#status").show();
$("#status").html("Loading");
}
function place_point(node,index) {
marker = node;
gm_CurrentMarker=marker;
gm_place_point(marker,index);
osm_CurrentMarker=marker;
osm_place_point(marker,index);
}
function getMapNodes(url,href){
pre_loading_blink();
loading_intvl=setInterval("loading_blink()",1000);
//map = [];
var url=serverURL+"?kml="+settings.kml+"&range="+settings.range;
if (settings.mask!="") url+="&mask="+settings.mask; // use second KML file to overwrite main KML file settings
//if (settings.map!="") url+="&map="+settings.map;
url+="&map=all";
//if (settings.start!="") url+="&href="+settings.start+"&range="+settings.range;
url+="&href="+href;
requestKml(url,kmlGot);
//requestKml(url+req,kmlGot);
}
/*!***************************************************************************
*! FILE NAME : g_map.js
*! DESCRIPTION: functions for Google Map API
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*!
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*!
*! $Log: g_map.js,v $
*!
*/
var icon_dot;
var icon_dot_blue;
var icon_eyesis;
var gm_points = new Array();
function gm_init_vars(){
icon_dot = new GIcon();
icon_dot.image = "files/map_icons/small_dot.png";
icon_dot.iconSize = new GSize(12, 12);
icon_dot.iconAnchor = new GPoint(6, 6);
icon_dot_blue = new GIcon();
icon_dot_blue.image = "files/map_icons/small_dot_blue.png";
icon_dot_blue.iconSize = new GSize(12, 12);
icon_dot_blue.iconAnchor = new GPoint(6, 6);
icon_eyesis = new GIcon();
icon_eyesis.image = "files/map_icons/eyesis_icon.png";
icon_eyesis.iconSize = new GSize(28, 40);
icon_eyesis.iconAnchor = new GPoint(14, 40);
icon_eyesis.shadow = "files/map_icons/eyesis_shadow.png";
icon_eyesis.shadowSize = new GSize(50, 40);
}
function gm_place_point(mark,n) {
if (n==0) {
gmap.setCenter(new GLatLng(mark.latitude,mark.longitude), zoom);
}
if (n==0) var icon = icon_eyesis;
else var icon = icon_dot;
gm_create_marker(mark,icon);
}
function gm_create_marker(mark,icon){
var i = mark.href;
//var i = mark.href.substr(mark.href.lastIndexOf('/')+1);
var point = new GLatLng(mark.latitude, mark.longitude);
gm_points[i] = new GMarker(point,icon);
GEvent.addListener(gm_points[i], "click", function() {
//gm_set_current_position(mark);
//var req = "?kml="+settings.kml+"&href="+mark.href;
getMapNodes(serverURL,mark.href);
});
GEvent.addListener(gm_points[i], "mouseover", function() {
if (mark.href!=gm_CurrentMarker.href) gm_points[i].setImage(icon_dot_blue.image);
});
GEvent.addListener(gm_points[i], "mouseout", function() {
if (mark.href!=gm_CurrentMarker.href) gm_points[i].setImage(icon_dot.image);
});
gmap.addOverlay(gm_points[i]);
}
function gm_set_current_position(mark){
gm_set_icon(gm_CurrentMarker,icon_dot);
gm_set_icon(mark,icon_eyesis);
gm_CurrentMarker = mark;
}
function gm_remove_marker(i){
gmap.removeOverlay(gm_points[i]);
}
function gm_set_icon(mark,icon) {
gm_remove_marker(mark.href);
//gm_remove_marker(mark.href.substr(mark.href.lastIndexOf('/')+1));
gm_create_marker(mark,icon);
}
/*! -----------------------------------------------------------------------------**
*! FILE NAME : get_kml.js
*! DESCRIPTION: Receives and parses local map information
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
**
** this program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
*/
var gXML_req;
function requestKml(url,callbacFunc) { // callbacFunc should accept array of panorama parameters as an argument
gXML_req=new XMLHttpRequest();
gXML_req.open("GET", url, true);
gXML_req.onreadystatechange = function() {
if (typeof(gXML_req)=="undefined") return; ///
if (gXML_req.readyState == 4) {
if (((gXML_req.status >= 200) && (gXML_req.status < 300)) || (gXML_req.status ==304) ||
((typeof(gXML_req.status) =='undefined' ) && ((navigator.userAgent.indexOf("Safari")>=0) ||
(navigator.userAgent.indexOf("Konqueror")>=0)))) {
parseKML(gXML_req.responseXML,callbacFunc);
return;
} else {
if (gXML_req.status) {
alert("There was a problem retrieving the XML data:\n" + (gXML_req.status?gXML_req.statusText:"gXML_req.status==0")+
"\nYou may safely ignore this message if you just reloaded this page");
}
}
}
}
gXML_req.send(null);
}
function parseKML(xml,callbacFunc) {
document.debugXML=xml;
var node;
var panos=[];
map_points= new Array();
var pano;
var cameraHeading=55; // get from KML - heading of the camera when "vehicle" is straight North
var aboveGround=2.05; // get from KML - different for car/person
var cameraType="eyesis_backpack"; // pedestrian
var isWritable=true;
if (xml.getElementsByTagName('open').length>0) {
isWritable= (parseInt(xml.getElementsByTagName('open')[0].firstChild.nodeValue)>0);
}
if (xml.getElementsByTagName('ExtendedData').length>0) { // new: added above ground and camera type
var nodeExtendedData=xml.getElementsByTagName('ExtendedData')[0];
if (nodeExtendedData.getElementsByTagName('cameraType').length>0) cameraType= nodeExtendedData.getElementsByTagName('cameraType')[0].firstChild.nodeValue;
if (nodeExtendedData.getElementsByTagName('aboveGround').length>0)aboveGround=parseFloat(nodeExtendedData.getElementsByTagName('aboveGround')[0].firstChild.nodeValue);
}
console.log(" aboveGround="+aboveGround+" cameraType="+cameraType);
if (xml.getElementsByTagName('PhotoOverlay').length>0) {
for (var numNode=0;numNode<xml.getElementsByTagName('PhotoOverlay').length;numNode++) {
node=xml.getElementsByTagName('PhotoOverlay')[numNode];
if (node.getElementsByTagName('Camera').length>0) {
nodeCam=node.getElementsByTagName('Camera')[0];
pano={};
pano.thisnode = numNode;
if (nodeCam.getElementsByTagName('longitude').length>0) pano.longitude=parseFloat(nodeCam.getElementsByTagName('longitude')[0].firstChild.nodeValue);
if (nodeCam.getElementsByTagName('latitude').length>0) pano.latitude= parseFloat(nodeCam.getElementsByTagName('latitude')[0].firstChild.nodeValue);
if (nodeCam.getElementsByTagName('altitude').length>0) pano.altitude= parseFloat(nodeCam.getElementsByTagName('altitude')[0].firstChild.nodeValue);
if (nodeCam.getElementsByTagName('heading').length>0) pano.heading= parseFloat(nodeCam.getElementsByTagName('heading')[0].firstChild.nodeValue);
if (nodeCam.getElementsByTagName('tilt').length>0) pano.tilt= parseFloat(nodeCam.getElementsByTagName('tilt')[0].firstChild.nodeValue);
if (nodeCam.getElementsByTagName('roll').length>0) pano.roll= parseFloat(nodeCam.getElementsByTagName('roll')[0].firstChild.nodeValue);
if (node.getElementsByTagName('Icon').length>0) {
var nodeIcon=node.getElementsByTagName('Icon')[0];
if (nodeIcon.getElementsByTagName('href').length>0) pano.href=nodeIcon.getElementsByTagName('href')[0].firstChild.nodeValue;
}
if (node.getElementsByTagName('name').length>0) pano.name= (parseInt(node.getElementsByTagName('name')[0].firstChild.nodeValue)); // name is map index
if (node.getElementsByTagName('description').length>0) pano.description= node.getElementsByTagName('description')[0].firstChild.nodeValue;
if (node.getElementsByTagName('visibility').length>0) pano.visibility= (parseInt(node.getElementsByTagName('visibility')[0].firstChild.nodeValue)>0);
else pano.visibility=true; // undefined visible
if (node.getElementsByTagName('open').length>0) pano.open= (parseInt(node.getElementsByTagName('open')[0].firstChild.nodeValue)>0);
if (node.getElementsByTagName('TimeStamp').length>0) {
var nodeTimestamp=node.getElementsByTagName('TimeStamp')[0];
if (nodeTimestamp.getElementsByTagName('when').length>0) {
var whenStr=nodeTimestamp.getElementsByTagName('when')[0].firstChild.nodeValue;
var whenArr=whenStr.replace(/[:\-TZ]/ig," ").split(" ");
pano.time= {year: parseInt(whenArr[0]),
month: parseInt(whenArr[1]),
day: parseInt(whenArr[2]),
hour: parseInt(whenArr[3]),
minute: parseInt(whenArr[4]),
second: parseFloat(whenArr[5])};
}
}
// read array of 3d-visibility ranges, will use 'name' as node number
if (node.getElementsByTagName('ExtendedData').length>0) {
var nodeExtendedData=node.getElementsByTagName('ExtendedData')[0];
if (nodeExtendedData.getElementsByTagName('Visibility3d').length>0) {
var nodeVisibility3d=nodeExtendedData.getElementsByTagName('Visibility3d')[0];
pano.v3d=[];
for (var i=0; i<nodeVisibility3d.getElementsByTagName('v3Range').length;i++) {
var nodev3Range=nodeVisibility3d.getElementsByTagName('v3Range')[i];
var range={};
if (nodev3Range.getElementsByTagName('from').length>0) range.from=parseInt(nodev3Range.getElementsByTagName('from')[0].firstChild.nodeValue);
if (nodev3Range.getElementsByTagName('to').length>0) range.to= parseInt(nodev3Range.getElementsByTagName('to')[0].firstChild.nodeValue);
pano.v3d.push(range);
}
}
}
pano.cameraHeading=cameraHeading; // replace with parsing
pano.aboveGround=aboveGround; // replace with parsing
pano.cameraType=cameraType; // replace with parsing
/*
var debugstr="open: "+pano.open+"\n";
if (typeof(pano.v3d)!='undefined') for (var i=0;i<pano.v3d.length;i++) {
debugstr+="v3d["+i+"]:\n from:"+pano.v3d[i].from+"\n to:"+pano.v3d[i].to+"\n";
}
alert (debugstr);
*/
/* alert ("name="+ pano.name+"\n"+
"description="+ pano.description+"\n"+
"visibility="+ pano.visibility+"\n"+
"cameraHeading="+ pano.cameraHeading+"\n"+
"aboveGround="+ pano.aboveGround+"\n"+
"cameraType="+ pano.cameraType);
*/
// temporary, get from KML later
// alert ("pano data="+pano.toString());
panos.push(pano);
map_points.push(pano);
}
}
}
callbacFunc(panos,isWritable);
}
/*
<TimeStamp>
<when>2011-04-22T17:06:08.466930Z</when>
</TimeStamp>
*/
\ No newline at end of file
// augment Sylvester some
Matrix.Translation = function (v)
{
if (v.elements.length == 2) {
var r = Matrix.I(3);
r.elements[2][0] = v.elements[0];
r.elements[2][1] = v.elements[1];
return r;
}
if (v.elements.length == 3) {
var r = Matrix.I(4);
r.elements[0][3] = v.elements[0];
r.elements[1][3] = v.elements[1];
r.elements[2][3] = v.elements[2];
return r;
}
throw "Invalid length for Translation";
}
Matrix.prototype.flatten = function ()
{
var result = [];
if (this.elements.length == 0)
return [];
for (var j = 0; j < this.elements[0].length; j++)
for (var i = 0; i < this.elements.length; i++)
result.push(this.elements[i][j]);
return result;
}
Matrix.prototype.ensure4x4 = function()
{
if (this.elements.length == 4 &&
this.elements[0].length == 4)
return this;
if (this.elements.length > 4 ||
this.elements[0].length > 4)
return null;
for (var i = 0; i < this.elements.length; i++) {
for (var j = this.elements[i].length; j < 4; j++) {
if (i == j)
this.elements[i].push(1);
else
this.elements[i].push(0);
}
}
for (var i = this.elements.length; i < 4; i++) {
if (i == 0)
this.elements.push([1, 0, 0, 0]);
else if (i == 1)
this.elements.push([0, 1, 0, 0]);
else if (i == 2)
this.elements.push([0, 0, 1, 0]);
else if (i == 3)
this.elements.push([0, 0, 0, 1]);
}
return this;
};
Matrix.prototype.make3x3 = function()
{
if (this.elements.length != 4 ||
this.elements[0].length != 4)
return null;
return Matrix.create([[this.elements[0][0], this.elements[0][1], this.elements[0][2]],
[this.elements[1][0], this.elements[1][1], this.elements[1][2]],
[this.elements[2][0], this.elements[2][1], this.elements[2][2]]]);
};
Vector.prototype.flatten = function ()
{
return this.elements;
};
function mht(m) {
var s = "";
if (m.length == 16) {
for (var i = 0; i < 4; i++) {
s += "<span style='font-family: monospace'>[" + m[i*4+0].toFixed(4) + "," + m[i*4+1].toFixed(4) + "," + m[i*4+2].toFixed(4) + "," + m[i*4+3].toFixed(4) + "]</span><br>";
}
} else if (m.length == 9) {
for (var i = 0; i < 3; i++) {
s += "<span style='font-family: monospace'>[" + m[i*3+0].toFixed(4) + "," + m[i*3+1].toFixed(4) + "," + m[i*3+2].toFixed(4) + "]</font><br>";
}
} else {
return m.toString();
}
return s;
}
//
// gluLookAt
//
function makeLookAt(ex, ey, ez,
cx, cy, cz,
ux, uy, uz)
{
var eye = $V([ex, ey, ez]);
var center = $V([cx, cy, cz]);
var up = $V([ux, uy, uz]);
var mag;
var z = eye.subtract(center).toUnitVector();
var x = up.cross(z).toUnitVector();
var y = z.cross(x).toUnitVector();
var m = $M([[x.e(1), x.e(2), x.e(3), 0],
[y.e(1), y.e(2), y.e(3), 0],
[z.e(1), z.e(2), z.e(3), 0],
[0, 0, 0, 1]]);
var t = $M([[1, 0, 0, -ex],
[0, 1, 0, -ey],
[0, 0, 1, -ez],
[0, 0, 0, 1]]);
return m.x(t);
}
//
// gluPerspective
//
function makePerspective(fovy, aspect, znear, zfar)
{
var ymax = znear * Math.tan(fovy * Math.PI / 360.0);
var ymin = -ymax;
var xmin = ymin * aspect;
var xmax = ymax * aspect;
return makeFrustum(xmin, xmax, ymin, ymax, znear, zfar);
}
//
// glFrustum
//
function makeFrustum(left, right,
bottom, top,
znear, zfar)
{
var X = 2*znear/(right-left);
var Y = 2*znear/(top-bottom);
var A = (right+left)/(right-left);
var B = (top+bottom)/(top-bottom);
var C = -(zfar+znear)/(zfar-znear);
var D = -2*zfar*znear/(zfar-znear);
return $M([[X, 0, A, 0],
[0, Y, B, 0],
[0, 0, C, D],
[0, 0, -1, 0]]);
}
//
// glOrtho
//
function makeOrtho(left, right, bottom, top, znear, zfar)
{
var tx = - (right + left) / (right - left);
var ty = - (top + bottom) / (top - bottom);
var tz = - (zfar + znear) / (zfar - znear);
return $M([[2 / (right - left), 0, 0, tx],
[0, 2 / (top - bottom), 0, ty],
[0, 0, -2 / (zfar - znear), tz],
[0, 0, 0, 1]]);
}
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
function jquery_list(list, msg) {
var selectBoxContainer = $("#"+list);
//add the header box <div> to the list
selectBoxContainer.append("<div></div>");
//assign the default message to the list header
var selectBox = selectBoxContainer.find('div');
selectBox.html(msg);
selectBoxContainer.attr('value',msg);
//process the list
var dropDown = selectBoxContainer.find('ul');
//dropDown.css({position:'absolute'});
selectBoxContainer.append(dropDown.hide());
dropDown.bind('show',function(){
if(dropDown.is(':animated')){
return false;
}
selectBox.addClass('expanded');
dropDown.slideDown();
}).bind('hide',function(){
if(dropDown.is(':animated')){
return false;
}
selectBox.removeClass('expanded');
dropDown.slideUp();
}).bind('toggle',function(){
if(selectBox.hasClass('expanded')){
dropDown.trigger('hide');
}
else dropDown.trigger('show');
});
selectBox.click(function(){
dropDown.trigger('toggle');
return false;
});
$(document).click(function(){
dropDown.trigger('hide');
});
//process all the list elements
dropDown.find('li').each(function(i) {
var li = $(this);
li.click(function(){
selectBox.html(li.html());
selectBoxContainer.attr('value',li.html());
dropDown.trigger('hide');
return false;
});
});
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
.list
{
width: 260px;
height: 20px;
line-height: 20px; /*should be the same as height*/
font-size: 14px;
}
.list li
{
list-style-type: none;
display: block;
position: relative;
top: 8px;
left: -30px;
border: 1px dotted #eaeaea;
background: white;
padding-left: 5px;
}
.list li:hover
{
background: -webkit-gradient(linear, left top, left bottom, from(rgba(180,180,180,1)), to(rgba(210,210,210,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(210,210,210,1), rgba(180,180,180,1)); /* for firefox 3.6+ */
}
.list div
{
position:absolute;
width: 300px;
height: 20px;
background: -webkit-gradient(linear, left top, left bottom, from(rgba(210,210,210,1)), to(rgba(180,180,180,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(180,180,180,1), rgba(210,210,210,1)); /* for firefox 3.6+ */
text-align:center;
border: 1px solid black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
.list div:hover
{
background: -webkit-gradient(linear, left top, left bottom, from(rgba(180,180,180,1)), to(rgba(210,210,210,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(210,210,210,1), rgba(180,180,180,1)); /* for firefox 3.6+ */
color:rgba(255,255,255,1);
}
.list div:active
{
background: -webkit-gradient(linear, left top, left bottom, from(rgba(210,210,210,1)), to(rgba(180,180,180,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(180,180,180,1), rgba(210,210,210,1)); /* for firefox 3.6+ */
color:rgba(255,255,255,1);
}
\ No newline at end of file
[Dolphin]
Timestamp=2011,3,10,17,38,55
ViewMode=1
#all_wrap {
position: absolute;
bottom: 3px;
right: 3px;
}
#map_wrap,#osmap_wrap {
position: relative;
margin: 2px;
}
#map, #osmap {
width: 400px;
height: 300px;
font-size: 12px;
}
#map_header, #osmap_header {
display: inline-block;
padding : 2px 5px 2px 5px;
margin : 2px 2px 2px 0px;
}
#map_header:hover, #table_header:hover, #osmap_header:hover {
color: white;
cursor: pointer;
}
#map_div, #osmap_div {
padding : 2px;
background: white;
/*float: right;*/
}
.grey {
background: rgba(150,150,150,0.5);
}
#status { font-family: 'Dancing Script', arial, serif; }
.maps_header {
/*background: rgba(255,255,255,0.7);*/
background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.8)), to(rgba(225,225,225,0.5))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,0.8), rgba(255,255,255,0.5)); /* for firefox 3.6+ */
-moz-box-shadow: 2px 2px 2px black;
-webkit-box-shadow: 2px 2px 2px black;
box-shadow: 2px 2px 2px black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
\ No newline at end of file
/*
*! -----------------------------------------------------------------------------**
*! FILE NAME : modify_kml.js
*! DESCRIPTION: Sends modified map data to the server
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
*!
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*!
*/
function generateKML(nodes){
var return_string = "<kml xmlns='http://earth.google.com/kml/2.2'>\n<Document>\n";
for(var i in nodes) {
return_string += "\
\t<PhotoOverlay>\n\
\t\t<name>"+nodes[i].name+"</name>\n\
\t\t<description>"+nodes[i].description+"</description>\n\
\t\t<visibility>"+(nodes[i].visibility?1:0)+"</visibility>\n\
\t\t<Camera>\n\
\t\t\t<longitude>"+nodes[i].longitude+"</longitude>\n\
\t\t\t<latitude>"+nodes[i].latitude+"</latitude>\n\
\t\t\t<altitude>"+nodes[i].altitude+"</altitude>\n\
\t\t\t<heading>"+nodes[i].heading+"</heading>\n\
\t\t\t<tilt>"+nodes[i].tilt+"</tilt>\n\
\t\t\t<roll>"+nodes[i].roll+"</roll>\n\
\t\t</Camera>\n\
\t\t<Icon>\n\
\t\t\t<href>"+nodes[i].href+"</href>\n\
\t\t</Icon>\n";
if (typeof(nodes[i].v3d)!='undefined') {
return_string += "\
\t\t<ExtendedData>\n\
\t\t\t<Visibility3d>\n";
for (var j in nodes[i].v3d) {
return_string += "\
\t\t\t\t<v3Range>\n";
if (typeof(nodes[i].v3d[j].from)!='undefined') return_string +="\t\t\t\t\t\t<from>"+nodes[i].v3d[j].from+"</from>\n";
if (typeof(nodes[i].v3d[j].to) !='undefined') return_string +="\t\t\t\t\t\t<to>"+ nodes[i].v3d[j].to+ "</to>\n";
return_string += "\
\t\t\t\t</v3Range>\n";
}
return_string += "\
\t\t\t</Visibility3d>\n\
\t\t</ExtendedData>\n";
}
return_string += "\
\t</PhotoOverlay>\n";
}
return_string += "</Document>\n</kml>";
return return_string;
}
function postKmlData(filename, xml) {
$.ajax({
url: "modify_kml.php?kml="+filename,
type: "POST",
dataType: "xml",
data: xml,
async:false,
complete: function(response){},
contentType: "text/xml; charset=\"utf-8\""
});
}
\ No newline at end of file
/*!***************************************************************************
*! FILE NAME : os_map.js
*! DESCRIPTION: functions for OpenLayers Open Street Map API
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*!
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*!
*! $Log: os_map.js,v $
*!
*/
// globals for map
var osm_markers = new Array();
var kml_response;
var map_points = new Array();
var N=0;
var osmap;
var osm_points = new Array();
var osm_CurrentMarker;
var osm_zoom=18;
var icon_eyesis4pi;
var icon_dot_green;
var icon_dot_blue;
function osm_init(){
console.log("map init!");
icon_eyesis4pi = L.icon({
iconUrl: "files/map_icons/eyesis4pi_icon.png",
iconSize: [30,70],
iconAnchor: [15,70]
});
icon_dot_green = L.icon({
iconUrl: "files/map_icons/small_dot.png",
iconSize: [12,12],
iconAnchor: [6,6]
});
icon_dot_blue = L.icon({
iconUrl: "files/map_icons/small_dot_blue.png",
iconSize: [12,12],
iconAnchor: [6,6]
});
osmap = L.map('osmap').setView([40.723407, -111.932970], 12);
L.tileLayer('http://a.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data and images &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
maxZoom: osm_zoom,
}).addTo(osmap);
/*
L.marker([40.723407, -111.932970],{icon:icon_eyesis4pi}).addTo(osmap).on("click",function(e){
console.log("Youclicked "+e.latlng);
this.setIcon(icon_dot_green);
});
*/
}
function osm_place_points(){
console.log("Place points!");
osm_points = new Array();
for (var i=map_points.length-1;i>=0;i--) {
osm_place_point(map_points[i],i);
}
osm_CurrentMarker = map_points[0];
}
function osm_place_point(mark,n) {
var icon;
if (n==0) {
osmap.setView([mark.latitude, mark.longitude]);
}
if (n==0) var icon = icon_eyesis4pi;
else var icon = icon_dot_green;
osm_create_marker(mark,icon);
}
function osm_create_marker(mark,icon) {
var point = L.marker([mark.latitude, mark.longitude],{icon:icon});
$(point).attr("index",mark.thisnode);
point.on("click",function(){
//clearInterval(intvl);
//osm_set_current_position(mark);
osm_remove_points();
//set_image_number(mark.thisnode);
getMapNodes(serverURL,mark.href);
});
point.on("mouseover",function(){
if (mark.href!=osm_CurrentMarker.href) this.setIcon(icon_dot_blue);
});
point.on("mouseout",function(){
if (mark.href!=osm_CurrentMarker.href) this.setIcon(icon_dot_green);
});
//point.addTo(osmap);
osmap.addLayer(point);
osm_points[mark.thisnode] = point;
}
function osm_set_current_position(mark) {
console.log("setting center:");
console.log(mark);
osm_set_icon(osm_CurrentMarker,icon_dot_green);
osm_set_icon(mark,icon_eyesis4pi);
osm_CurrentMarker = mark;
}
function osm_remove_marker(i) {
osmap.removeLayer(osm_points[i]);
}
function osm_set_icon(mark,icon) {
osm_points[mark.thisnode].setIcon(icon);
}
function osm_remove_points(){
console.log("Remove points! "+map_points.length);
for (i=0;i<map_points.length;i++) {
osm_remove_marker(i);
}
}
body{
font-family:"Times New Roman", Times, serif;
}
table{
}
th{
border: 0px solid black;
background: rgba(120,200,120,0.5);
padding: 5px;
border-radius: 2px;
}
td{
border: 0px solid black;
/*background: rgba(100,200,100,0.1);*/
padding: 2px 10px 2px 10px;
text-align: center;
border-radius: 2px;
}
a:link{
color: rgba(30,100,30,1);
}
a:visited{
color: rgba(50,50,50,1);
}
#main{
position: absolute;
padding: 5px;
}
#route_list{
position: relative;
float: left;
/* width: 450px;
height: 350px;*/
/*background: rgba(100,100,200,0.4);*/
}
#action_list{
position:relative;
float: left;
}
#action_form{
position:relative;
width: 500px;
background: rgba(100,200,100,0.4);
padding: 5px;
margin: 3px;
}
#input_fn{
position: relative;
width: 200px;
border-radius: 3px;
}
#status_box{
position: relative;
background: rgba(100,200,100,0.4);
padding: 5px;
margin: 3px;
}
#status{
width: 454px;
background: white;
}
\ No newline at end of file
/*!*******************************************************************************
*! FILE NAME : pano_index.js
*! DESCRIPTION: get the routes list
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! The four essential freedoms with GNU GPL software:
*! * the freedom to run the program for any purpose
*! * the freedom to study how the program works and change it to make it do what you wish
*! * the freedom to redistribute copies so you can help your neighbor
*! * the freedom to distribute copies of your modified versions to others
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*!
*/
function postRequest(cmd, xml) {
$.ajax({
url: "pano_db_interface.php?cmd="+cmd,
type: "POST",
dataType: "xml",
data: xml,
async:false,
complete: function(response){parse_response(response.responseXML,cmd);},
contentType: "text/xml; charset=\"utf-8\""
});
}
function getRequest(rq,callback) {
$.ajax({
url: rq,
type: "GET",
// async:false,
complete: function(response){callback(response.responseText);},
});
}
var res_arr = Array();
function parse_response(xml,cmd){
var result="";
res_arr = XMLToArray(xml);
if (cmd=="GetRoutesAndKMLs") {
//get also KML files
var table_str = "<table>\
<tr>\
<th>Route ID</th>\
<th>Name</th>\
<th>Description</th>\
<th>Nodes</th>\
<th>KML</th>\
<th>Editable</th>\
</tr>";
for (var i=0;i<res_arr.length;i++){
row_color = "rgba("+(220+60*(i%2))+","+(220+60*(i%2))+","+(220+60*(i%2))+",0.2)";
var tmp_id = (res_arr[i].ID==undefined)?"":res_arr[i].ID;
var tmp_name = (res_arr[i].Name==undefined)?"":res_arr[i].Name;
var tmp_descr = (res_arr[i].Description==undefined)?"":res_arr[i].Description;
var tmp_nodes = (res_arr[i].Nodes==undefined)?"":res_arr[i].Nodes;
var tmp_edit = (res_arr[i].Editable==undefined)?"No":res_arr[i].Editable;
var tmp_kml = tmp_id;
table_str += "<tr id='r"+i+"' style='background:"+row_color+"' onclick='row_click_handler("+i+")'>\
<td><a href='webgl_panorama_editor.html?kml="+tmp_id+"'>"+tmp_id+"</a></td>\
<td><div style='width:150px;'>"+tmp_name+"</div></td>\
<td><div style='width:250px;'>"+tmp_descr+"</div></td>\
<td>"+(+tmp_nodes)+"</td>\
<td><a style='display:none;' href='display_kml.php?id="+tmp_id+"'>"+tmp_id+"</a></td>\
<td>"+tmp_edit+"</td>\
</tr>";
}
table_str +="</table>";
}
$("#route_list").html(table_str);
}
//siuda!
function row_click_handler(i){
if ($("#r"+i).attr('marked')=="true") {
$("#r"+i).attr('marked',"false");
$("#r"+i).css({background:$("#r"+i).attr('old_color')});
}else{
$("#r"+i).attr('marked',"true");
$("#r"+i).attr('old_color',$("#r"+i).css("background-color"));
$("#r"+i).css({background:"rgba(100,200,50,0.8)"});
//disable others
for (var j=0;j<res_arr.length;j++) {
if (i!=j) {
$("#r"+j).css({background:$("#r"+j).attr('old_color')});
$("#r"+j).attr('marked',"false");
}
}
}
}
function create_copy(){
found_marked = false;
$("#status").val("");
for(var i=0;i<res_arr.length;i++){
if ($("#r"+i).attr('marked')=="true") {
found_marked = true;
break;
}
}
if (!found_marked) {
$("#status").val("Please select one of the routes");
return 0;
}
if ($("#input_fn").val()=="") {
$("#status").val("Please enter the copy name");
return 0;
}
if ($("#input_fn").val().substr(-3,3)!="kml") {
$("#status").val("Incorrect file extension");
return 0;
}
if($("#input_fn").val().match(/[\<\>!@#\$%^&\*,/]+/i) ) {
$("#status").val("Unknown error");
return 0;
}
var rq = "copy_kml.php?proto="+res_arr[i].ID+"&kml="+$("#input_fn").val();
getRequest(rq,copy_done);
}
function copy_done(msg){
$("#status").val(msg);
postRequest("GetRoutesAndKMLs", "");
}
function xml_create(arr) {
var result_str = "";
for (var i=0;i<arr.length;i++) {
var tmp_str = "";
for(key in arr[i]) {
tmp_str += XMLString_CreateNode("\t\t",key,arr[i][key]);
}
result_str += XMLString_Wrap("\t","node",tmp_str);
}
return XMLString_AddXMLHeader(result_str,"data");
}
function kml_create(arr) {
var result_str = "";
for (var i=0;i<arr.length;i++) {
result_str += ArrayToXMLString(arr[i],"\t","PhotoOverlay");
}
return XMLString_AddKMLHeader(result_str,"Document");
}
This diff is collapsed.
html {
font-family:"Times New Roman", Times, serif;
}
.small_text {
font-size: 10px;
}
#idTopRightCorner {
position: absolute;
top: 5px;
right: 5px;
overflow: auto;
}
#idHeading, #idTilt, #idRoll {
width: 50px;
}
#idDialogs, #idHelpDialog {
position: absolute;
top: 30px;
right: 5px;
z-index: 1000;
}
#idViewsDialog {
padding : 2px 5px 2px 5px;
margin-top: 3px;
margin-bottom: 5px;
}
#idSettings, #idHelp, #idViews {
/*display: inline;*/
float: left;
/*background: rgba(200,200,200,0.8);*/
padding : 2px 5px 2px 5px;
margin: 0px 2px 2px 0px;
}
#idSettings:hover, #idHelp:hover, #idViews:hover {
color: white;
cursor: pointer;
}
#idSettings:active, #idHelp:active {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.5)), to(rgba(225,225,225,0.8))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,0.5), rgba(255,255,255,0.8)); /* for firefox 3.6+ */
-moz-box-shadow: 0px 0px 0px black;
-webkit-box-shadow: 0px 0px 0px black;
box-shadow: 0px 0px 0px black;
}
#idSettingsDialog {
/* width: 450px;*/
/* height: 520px;*/
padding: 5px;
margin-top: 3px;
overflow: auto;
}
#idSettingsDialogNumTextures {
width: 40px;
}
#idSettingsDialogOkButton,#idSettingsDialogCancelButton {
float:left;
padding: 2px 5px 2px 5px;
font-size: 14px;
}
#idSettingsDialogOkButton:hover,#idSettingsDialogCancelButton:hover {
color: white;
cursor: pointer;
}
#idSettingsDialogOkButton:active,#idSettingsDialogCancelButton:active {
border: 0px;
background: -webkit-gradient(linear, left top, left bottom, from(rgba(210,210,210,1)), to(rgba(180,180,180,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(180,180,180,1), rgba(210,210,210,1)); /* for firefox 3.6+ */
}
.gradient {
/*background: rgba(255,255,255,0.7);*/
background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.9)), to(rgba(225,225,225,0.6))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(255,255,255,0.6)); /* for firefox 3.6+ */
-moz-box-shadow: 2px 2px 2px black;
-webkit-box-shadow: 2px 2px 2px black;
box-shadow: 2px 2px 2px black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
.input_field {
border: 1px solid black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
padding: 2px 1px 2px 1px;
}
.input_field:disabled {
color: black;
}
.button {
font-size: 12px;
border: 0px;
background: -webkit-gradient(linear, left top, left bottom, from(rgba(180,180,180,1)), to(rgba(210,210,210,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(210,210,210,1), rgba(180,180,180,1)); /* for firefox 3.6+ */
-moz-box-shadow: 2px 2px 2px black;
-webkit-box-shadow: 2px 2px 2px black;
box-shadow: 2px 2px 2px black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
.button:hover {
color: white;
cursor: pointer;
}
.button:active {
border: 0px;
background: -webkit-gradient(linear, left top, left bottom, from(rgba(210,210,210,1)), to(rgba(180,180,180,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(180,180,180,1), rgba(210,210,210,1)); /* for firefox 3.6+ */
}
.button:disabled {
-moz-box-shadow: 1px 1px 1px black;
-webkit-box-shadow: 1px 1px 1px black;
box-shadow: 1px 1px 1px black;
background: -webkit-gradient(linear, left top, left bottom, from(rgba(180,180,180,1)), to(rgba(210,210,210,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(210,210,210,1), rgba(180,180,180,1)); /* for firefox 3.6+ */
}
#IdSeeThroughDiv {
margin: 5px;
}
#seeThroughInput {
width: 35px;
}
/*see through slider*/
#seeThroughSlider {
width: 10px;
margin: 5px;
}
#seeThroughSlider .ui-slider-handle {
left: -3px;
background: white;
border-color: rgba(0,0,0,1);
width: 15px;
height: 15px;
}
#idSettingsNumTextures, #idSettingsRange, #idSettingsAsCamera, #idSettingsSeeThrough, #idSettingsTransitionTime, #idSettingsTransitionSteps, #idSettingsDotSize {
width: 40px;
text-align: right;
}
#idSettingsThisColor, #idSettingsColor, #idSettingsSelectedColor, #idSettingsGhostColor, #idSettingsInvisibleColor {
width: 65px;
}
#idSettingsMap {
width: 70px;
}
#idSettingsStart {
width: 300px;
}
.small_square {
width: 19px;
height: 19px;
border: 1px solid black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
#idPlanView {
-moz-box-shadow: 2px 2px 2px black;
-webkit-box-shadow: 2px 2px 2px black;
box-shadow: 2px 2px 2px black;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
#idViewAzimuth, #idViewElevation {
width: 60px;
}
#idInfo{
position: absolute;
bottom: 3px;
left: 3px;
padding : 2px 4px 2px 4px;
overflow: auto;
}
#idInfo_toggle {
width: 67px;
padding : 2px 5px 2px 5px;
/*display: inline;*/
float: left;
}
#idInfo_toggle:hover {
color: white;
cursor: pointer;
}
#idPermanentLink_div {
/*display: inline;*/
float: left;
padding: 2px 5px 2px 5px;
}
#idHelpDialog {
padding: 2px 5px 2px 5px;
margin-top: 3px;
}
#error_no_webgl{
-moz-box-shadow: 2px 2px 6px black;
-webkit-box-shadow: 2px 2px 6px black;
box-shadow: 2px 2px 6px black;
}
#kml_proto_list {
position: absolute;
top: 30px;
left: 140px;
width: 300px;
height: 20px;
z-index: 1002;
}
#kml_mask_list {
position: absolute;
top: 78px;
left: 140px;
width: 300px;
height: 20px;
z-index: 1001;
}
#idSettingsKml{
width: 300px;
position: absolute;
left: 140px;
top: 54px;
height: 22px;
}
#idSettingsMap{
width: 300px;
position: absolute;
left: 140px;
top: 102px;
height: 22px;
}
\ No newline at end of file
This diff is collapsed.
/*
*! -----------------------------------------------------------------------------**
*! FILE NAME : seethrough_slider.js
*! REVISION : 1.0
*! DESCRIPTION: slider for viewing both textures in the edit mode
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*!
*! It means that the program's users have the four essential freedoms:
*!
*! * The freedom to run the program, for any purpose (freedom 0).
*! * The freedom to study how the program works, and change it to make it do what you wish (freedom 1).
*! Access to the source code is a precondition for this.
*! * The freedom to redistribute copies so you can help your neighbor (freedom 2).
*! * The freedom to distribute copies of your modified versions to others (freedom 3).
*!
*! By doing this you can give the whole community a chance to benefit from your changes.
*! Access to the source code is a precondition for this.
*! -----------------------------------------------------------------------------**
*/
$(function() {
$( "#seeThroughSlider" ).slider({
orientation: "vertical",
range: "min",
min: 0,
max: 99,
value: 50,
slide: function( event, ui ) {
$( "#seeThroughInput" ).val( ui.value/100 );
$( "#seeThroughInput" ).change();
}
});
$("#seeThroughInput").change(function(e){
settings.seethrough = $("#seeThroughInput").val();
drawScene();
//alert(settings.seethrough);
});
});
\ No newline at end of file
This diff is collapsed.
File added
This diff is collapsed.
This diff is collapsed.
/*
*! -----------------------------------------------------------------------------**
*! FILE NAME : translate.js
*! REVISION : 1.0
*! DESCRIPTION: ajax request for translation
*! Copyright (C) 2011 Elphel, Inc.
*!
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*!
*! It means that the program's users have the four essential freedoms:
*!
*! * The freedom to run the program, for any purpose (freedom 0).
*! * The freedom to study how the program works, and change it to make it do what you wish (freedom 1).
*! Access to the source code is a precondition for this.
*! * The freedom to redistribute copies so you can help your neighbor (freedom 2).
*! * The freedom to distribute copies of your modified versions to others (freedom 3).
*!
*! By doing this you can give the whole community a chance to benefit from your changes.
*! Access to the source code is a precondition for this.
*! -----------------------------------------------------------------------------**
*/
function translate_request(language){
$.ajax({
url: "translate.php",
type: "GET",
data: "language="+language,
async: false,
success: function(xml){
var child;
var titles = xml.getElementsByTagName("Titles")[0];
var contents = xml.getElementsByTagName("Contents")[0];
//process titles
child = titles.firstChild;
for (var i=0; i<titles.childNodes.length; i++) {
if (child.nodeName=="title") document.title = child.firstChild.nodeValue;
$("#"+child.nodeName).attr("title",child.firstChild.nodeValue);
child = child.nextSibling;
}
//process contents
child = contents.firstChild;
for (var i=0; i<contents.childNodes.length; i++) {
$("#"+child.nodeName).html(child.firstChild.nodeValue);
child = child.nextSibling;
}
}
});
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<html>
<head>
<title>Elphel Panorama Index</title>
<script src="files/jquery-1.6.4.min.js"></script>
<script src="files/useful_functions.js"></script>
<script src="files/pano_index.js"></script>
<link href="files/button.css" rel="stylesheet" type="text/css">
<link href="files/pano_index.css" rel="stylesheet" type="text/css">
<style>
</style>
</head>
<body>
<h3>Elphel Panorama Routes Index</h3>
<div id=main >
<div id='route_list'>
</div>
<div id='action_list'>
<div id='action_form' >
New copy name: <input type=text id=input_fn class="input_text" />
<button id=do_things onclick="create_copy()" >Create Editable Copy</button>
</div>
<div id=status_box>
Status:&nbsp;<input type=text id=status class="input_text" disabled />
</div>
</div>
</div>
<script>
postRequest("GetRoutesAndKMLs", "");
</script>
</body>
</html>
\ No newline at end of file
<?php
/********************************************************************************
*! FILE NAME : map_pano.php
*! DESCRIPTION: db / file multiplexor
*! VERSION: 1.0
*! AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
*! Copyright (C) 2011 Elphel, Inc
*! -----------------------------------------------------------------------------**
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! The four essential freedoms with GNU GPL software:
*! * the freedom to run the program for any purpose
*! * the freedom to study how the program works and change it to make it do what you wish
*! * the freedom to redistribute copies so you can help your neighbor
*! * the freedom to distribute copies of your modified versions to others
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*! -----------------------------------------------------------------------------**
*! $Log: map_pano.php,v $
*!
*/
require_once("call_filter.php");
if (isset($_GET['kml'])) {
if (is_file("kml_files/".$_GET['kml'])) require("map_pano_file.php");
else require("map_pano_db.php");
}else{
echo "Hahaha, well";
}
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment