czfgmap |
Subversion Repositories: |
Rev 6 | Rev 8 | |
---|---|---|
Line 60... | Line 60... | |
var NodeOrder = "ASC"; |
var NodeOrder = "ASC"; | |
var NodeSortBy = "name"; |
var NodeSortBy = "name"; | |
var Where = ""; |
var Where = ""; | |
var LoadedNodes = new Array(); |
var LoadedNodes = new Array(); | |
var map; |
var map; | |
var NodeIcon =new Array(); |
var NodeIcon = new Array(); | |
var DatabaseNodeTables =new Array(); |
var DatabaseNodeTables = new Array(); | |
var AutoFetchMode = true; |
var AutoFetchMode = true; | |
var AutoClearMode = true; |
var AutoClearMode = true; | |
var NumLoadedNodes = 0; |
var NumLoadedNodes = 0; | |
var NumAddedNodes = 0; |
var NumAddedNodes = 0; | |
var NumLoadedLinks = 0; |
var NumLoadedLinks = 0; | |
var NumAddedLinks = 0; |
var NumAddedLinks = 0; | |
var NumVisibleLinks = 0; |
var NumVisibleLinks = 0; | |
var NumInVisibleLinks = 0; |
var NumInVisibleLinks = 0; | |
var PtA = new Array(); | ||
var PtB = new Array(); | ||
var PtC = new Array(); | ||
var PtPt = 1; | ||
var PtNum = 0; | ||
|
| |
var LinkColType =new Array(); |
var LinkColType = new Array(); | |
LinkColType["00000001"] = "#00aa00"; |
LinkColType["00000001"] = "#00aa00"; | |
LinkColType["00000001"] = "#00FF00"; |
LinkColType["00000001"] = "#00FF00"; | |
var LinkColTypeWifiBackbone = "#fafa00"; |
var LinkColTypeWifiBackbone = "#fafa00"; | |
LinkColType["00000002"] = "#be0000"; |
LinkColType["00000002"] = "#be0000"; | |
LinkColType["00000006"] = "#ff5050"; |
LinkColType["00000006"] = "#ff5050"; | |
Line 117... | Line 122... | |
map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20))); |
map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20))); | |
//tohle zajisti znovunacteni nodu po presunu |
//tohle zajisti znovunacteni nodu po presunu | |
GEvent.addListener(map, "moveend", HandleMapMoveEnd); |
GEvent.addListener(map, "moveend", HandleMapMoveEnd); | |
|
| |
//ziskani souradnic po kliknuti |
//ziskani souradnic po kliknuti | |
GEvent.addListener(map, \'click\', function(overlay, point) { if(point) { document.getElementById("NodeCoordinates").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); }} ); |
GEvent.addListener(map, \'click\', function(overlay, point) { if(point) { HandleNextPoint(point) }} ); | |
|
| |
//tohle zajisti vypis pri startu |
//tohle zajisti vypis pri startu | |
var center = map.getCenter(); |
var center = map.getCenter(); | |
document.getElementById("souradnice").innerHTML = CurrentDatabase + "<br>Souradnice stredu:" + center.toString() + "<br>Rozsah: " + map.getBounds()+"<br>Zvetseni: " + map.getZoom(); |
document.getElementById("souradnice").innerHTML = CurrentDatabase + "<br>Souradnice stredu:" + center.toString() + "<br>Rozsah: " + map.getBounds()+"<br>Zvetseni: " + map.getZoom(); | |
|
| |
Line 144... | Line 149... | |
|
| |
// pts.push (new GLatLng(50.120771, 14.486246)); |
// pts.push (new GLatLng(50.120771, 14.486246)); | |
pts.push (new GLatLng(50.118212, 14.484079)); |
pts.push (new GLatLng(50.118212, 14.484079)); | |
pts.push (new GLatLng(50.118707, 14.491160)); |
pts.push (new GLatLng(50.118707, 14.491160)); | |
|
| |
poly = new BDCCPolyline(pts,"#FF0000",3,0.3,"Tohle je pokusny objekt","dash"); |
||
|
||
map.addOverlay(poly); |
||
|
||
GEvent.addListener(poly,"click",function(){alert(poly.tooltip);}); |
||
GEvent.addListener(poly,"mouseover",function(){poly.setOpacity(0.8);}); |
||
GEvent.addListener(poly,"mouseout",function(){poly.setOpacity(0.3);}); |
||
} |
} | |
} |
} | |
|
| |
//### Ostatni funkce ########################### |
//### Ostatni funkce ########################### | |
|
| |
Line 247... | Line 245... | |
NumAddedLinks = NumAddedLinks + 1; |
NumAddedLinks = NumAddedLinks + 1; | |
} |
} | |
} |
} | |
document.getElementById("NumLinks").innerHTML = "Nacteno " + NumAddedLinks + " linku a zobrazeno " + NumVisibleLinks + " linku a " + NumInVisibleLinks + " nezobrazeno."; |
document.getElementById("NumLinks").innerHTML = "Nacteno " + NumAddedLinks + " linku a zobrazeno " + NumVisibleLinks + " linku a " + NumInVisibleLinks + " nezobrazeno."; | |
}); |
}); | |
} | ||
| ||
//############################## | ||
function HandleNextPoint(point) { | ||
var Distance = 0; | ||
| ||
document.getElementById("NodeCoordinates").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
| ||
if ( PtPt == 1 ) { | ||
document.getElementById("NodeCoordinatesA").innerHTML = (\'A \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
PtA = point; | ||
} | ||
if ( PtPt == 2 ) { | ||
document.getElementById("NodeCoordinatesB").innerHTML = (\'B \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
PtB = point; | ||
} | ||
if ( PtPt == 3 ) { | ||
document.getElementById("NodeCoordinatesC").innerHTML = (\'C \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
PtC = point; | ||
} | ||
| ||
| ||
PtPt = PtPt + 1; | ||
if ( PtPt > 3 ) { PtPt = 1; } | ||
PtNum = PtNum + 1; | ||
| ||
// document.getElementById("NodeDistanceBC").innerHTML = (\'C \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
// document.getElementById("NodeDistanceABC").innerHTML = (\'ss\'); | ||
if ( PtNum > 1 ) { | ||
Distance = Math.round(GetLineLength(PtA.lat(), PtA.lng(), PtB.lat(), PtB.lng())); | ||
document.getElementById("NodeDistanceAB").innerHTML = Distance; | ||
document.getElementById("NodeDistanceBA").innerHTML = Distance; | ||
} | ||
if ( PtNum > 2 ) { | ||
Distance = Math.round(GetLineLength(PtC.lat(), PtC.lng(), PtB.lat(), PtB.lng())); | ||
document.getElementById("NodeDistanceBC").innerHTML = Distance; | ||
document.getElementById("NodeDistanceCB").innerHTML = Distance; | ||
document.getElementById("NodeDistanceABC").innerHTML = 1 * Distance + 1 * document.getElementById("NodeDistanceBA").innerHTML; | ||
Distance = Math.round(GetLineLength(PtC.lat(), PtC.lng(), PtA.lat(), PtA.lng())); | ||
document.getElementById("NodeDistanceAC").innerHTML = Distance; | ||
document.getElementById("NodeDistanceCA").innerHTML = Distance; | ||
| ||
} | ||
| ||
document.getElementById("NodeAngleACB").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
document.getElementById("NodeAngleBAC").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
document.getElementById("NodeAngleCBA").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); | ||
| ||
| ||
} |
} | |
|
| |
//############################## |
//############################## | |
function GetLineLength(Lat1, Lon1, Lat2, Lon2) { |
function GetLineLength(Lat1, Lon1, Lat2, Lon2) { | |
var R = 6371; // km |
var R = 6371; // km | |
Line 409... | Line 456... | |
<option value="60">60</option> |
<option value="60">60</option> | |
<option value="200">200</option> |
<option value="200">200</option> | |
<option value="500">500</option> |
<option value="500">500</option> | |
<option value="1000">1000</option> |
<option value="1000">1000</option> | |
</select> |
</select> | |
<table border="1"> | ||
<tr> | ||
<td> | ||
<div id="NodeDistanceABC">ABC</div> | ||
</td> | ||
<td> | ||
A | ||
</td> | ||
<td> | ||
B | ||
</td> | ||
<td> | ||
C | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div id="NodeCoordinatesA">A</div> | ||
</td> | ||
<td> | ||
<div id="NodeAngleACB">ACB</div> | ||
</td> | ||
<td> | ||
<div id="NodeDistanceAB">AB</div> | ||
</td> | ||
<td> | ||
<div id="NodeDistanceAC">AC</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div id="NodeCoordinatesB">B</div> | ||
</td> | ||
<td> | ||
<div id="NodeDistanceBA">BA</div> | ||
</td> | ||
<td> | ||
<div id="NodeAngleBAC">BAC</div> | ||
</td> | ||
<td> | ||
<div id="NodeDistanceBC">BC</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div id="NodeCoordinatesC">C</div> | ||
</td> | ||
<td> | ||
<div id="NodeDistanceCA">CA</div> | ||
</td> | ||
<td> | ||
<div id="NodeDistanceCB">CB</div> | ||
</td> | ||
<td> | ||
<div id="NodeAngleCBA">BAC</div> | ||
</td> | ||
</tr> | ||
</table> | ||
|
| |
</td> |
</td> | |
</tr> |
</tr> | |
|
| |
<tr> |
<tr> |