czfgmap |
Subversion Repositories: |
Rev 4 | Rev 5 | |
---|---|---|
Line 1... | Line 1... | |
<?php | ||
//<!-- Copyright (C) 2008 Petr Simandl www.simandl.cz --> | ||
//<!-- This file is part of CZFGmap. --> | ||
//<!-- --> | ||
//<!-- CZFGmap 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. --> | ||
//<!-- --> | ||
//<!-- CZFGmap 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 CZFGmap. If not, see <http://www.gnu.org/licenses/>. --> | ||
| ||
error_reporting(7); | ||
| ||
include("../forum/globalmap.php"); | ||
| ||
switch (@$_SERVER['SERVER_NAME']) { | ||
case "connected.czf": | ||
$GMapKey="ABQIAAAAvGTA14kOdSvtr3t8EjKUdxQ2n1pNbYRLwYPuGT94C-0un95jGhSkgS0a3LnGa2MzRepHicK08lDDmg"; | ||
break; | ||
case "mapa.prosek.czf": | ||
$GMapKey="ABQIAAAAlZ9uhPay2OYt2xmaN84g0BTYUdkyQZ68wktXWB9o4y2agzv8zxRyBxtFdIbLe18hmqHTwiWPXl7VxA"; | ||
break; | ||
default: | ||
$GMapKey="ABQIAAAAlZ9uhPay2OYt2xmaN84g0BTYUdkyQZ68wktXWB9o4y2agzv8zxRyBxtFdIbLe18hmqHTwiWPXl7VxA"; | ||
} | ||
| ||
echo ' | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
|
| |
<!-- Copyright (C) 2008 Petr Simandl www.simandl.cz --> |
||
<!-- This file is part of CZFGmap. --> |
||
<!-- --> |
||
<!-- CZFGmap 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. --> |
||
<!-- --> |
||
<!-- CZFGmap 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 CZFGmap. If not, see <http://www.gnu.org/licenses/>. --> |
||
|
| |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<title>CZFGmap</title> |
<title>CZFGmap</title> | |
Line 28... | Line 46... | |
@import url("http://www.google.com/uds/css/gsearch.css"); |
@import url("http://www.google.com/uds/css/gsearch.css"); | |
@import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css"); |
@import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css"); | |
@import "czfgmap.css"; |
@import "czfgmap.css"; | |
} |
} | |
</style> |
</style> | |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAlZ9uhPay2OYt2xmaN84g0BTYUdkyQZ68wktXWB9o4y2agzv8zxRyBxtFdIbLe18hmqHTwiWPXl7VxA" |
<script src="http://maps.google.com/maps?file=api&v=2&key='.$GMapKey.'" | |
type="text/javascript"></script> |
type="text/javascript"></script> | |
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0" type="text/javascript"></script> |
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0" type="text/javascript"></script> | |
<script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script> |
<script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script> | |
<script src="BDCCPolyline.js" type="text/javascript"></script> |
||
<script src="BDCCPolygon.js" type="text/javascript"></script> |
||
<script src="BdccGeo.js" type="text/javascript"></script> |
||
<script type="text/javascript"> |
<script type="text/javascript"> | |
|
| |
//### Globalni promenne ################################# |
//### Globalni promenne ################################# | |
var CurrentDatabase = "czfmutf"; |
var CurrentDatabase = "czfmutf"; | |
var NodeLimit = "200"; |
var NodeLimit = "200"; | |
Line 78... | Line 93... | |
var NodeState = [1,9,10,40,79,80,90]; |
var NodeState = [1,9,10,40,79,80,90]; | |
for (type in NodeType) { |
for (type in NodeType) { | |
for (state in NodeState) { |
for (state in NodeState) { | |
i = 10000 + NodeType[type]*100 + NodeState[state]; |
i = 10000 + NodeType[type]*100 + NodeState[state]; | |
NodeIcon[i] = new GIcon(); |
NodeIcon[i] = new GIcon(); | |
// NodeIcon[i].image = "/images/node/node_type-" + NodeType[type] + "_status-" + NodeState[state] + ".png"; |
NodeIcon[i].image = "./images/node/node-" + NodeType[type] + "-" + NodeState[state] + ".png"; | |
NodeIcon[i].image = "/images/node/node-" + NodeType[type] + "-" + NodeState[state] + ".png"; |
||
NodeIcon[i].iconSize = new GSize(15,15); |
NodeIcon[i].iconSize = new GSize(15,15); | |
NodeIcon[i].iconAnchor = new GPoint(7,7); |
NodeIcon[i].iconAnchor = new GPoint(7,7); | |
NodeIcon[i].shadowSize = new GSize(22,20); |
NodeIcon[i].shadowSize = new GSize(22,20); | |
NodeIcon[i].infoWindowAnchor = new GPoint(5,1); |
NodeIcon[i].infoWindowAnchor = new GPoint(5,1); | |
} |
} | |
} |
} | |
|
| |
//### Uvodni funkce ################################# |
//### Uvodni funkce ################################# | |
function load() { |
function load() { | |
if (GBrowserIsCompatible()) { |
if (GBrowserIsCompatible()) { | |
map = new GMap2(document.getElementById("map"),{draggableCursor: 'crosshair', draggingCursor: 'pointer'}); |
map = new GMap2(document.getElementById("map"),{draggableCursor: \'crosshair\', draggingCursor: \'pointer\'}); | |
map.addControl(new GLargeMapControl()); |
map.addControl(new GLargeMapControl()); | |
map.addControl(new GMapTypeControl()); |
map.addControl(new GMapTypeControl()); | |
map.addControl(new GOverviewMapControl()); |
map.addControl(new GOverviewMapControl()); | |
map.setCenter(new GLatLng(50.123567, 14.496258), 15); |
map.setCenter(new GLatLng(50.123567, 14.496258), 15); | |
map.enableScrollWheelZoom(); |
map.enableScrollWheelZoom(); | |
Line 103... | Line 117... | |
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) { document.getElementById("NodeCoordinates").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6)); }} ); | |
|
| |
//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 137... | Line 151... | |
map.addOverlay(poly); |
map.addOverlay(poly); | |
|
| |
GEvent.addListener(poly,"click",function(){alert(poly.tooltip);}); |
GEvent.addListener(poly,"click",function(){alert(poly.tooltip);}); | |
GEvent.addListener(poly,"mouseover",function(){poly.setOpacity(0.8);}); |
GEvent.addListener(poly,"mouseover",function(){poly.setOpacity(0.8);}); | |
GEvent.addListener(poly,"mouseout",function(){poly.setOpacity(0.3);}); |
GEvent.addListener(poly,"mouseout",function(){poly.setOpacity(0.3);}); | |
|
||
|
||
|
||
|
||
|
||
} |
} | |
} |
} | |
|
| |
//### Ostatni funkce ########################### |
//### Ostatni funkce ########################### | |
|
| |
Line 201... | Line 210... | |
var LinkColOpacity = 0.6; |
var LinkColOpacity = 0.6; | |
var LinkStyle = "solid"; |
var LinkStyle = "solid"; | |
|
| |
if (inplanning == 1) { |
if (inplanning == 1) { | |
LinkColBgOpacity = 0.1; |
LinkColBgOpacity = 0.1; | |
LinkColOpacity = 0.2; | ||
LinkColBg = "#0000FF"; |
LinkColBg = "#0000FF"; | |
LinkStyle = "dash"; |
LinkStyle = "dash"; | |
} |
} | |
// DebugPrint(":"+ inplanning + ":"); |
// DebugPrint(":"+ inplanning + ":"); | |
|
| |
var Linepts = new Array(); |
var Linepts = new Array(); | |
Linepts = [LoadedNodes[id1],LoadedNodes[id2]]; |
Linepts = [LoadedNodes[id1],LoadedNodes[id2]]; | |
LineLength = Math.round(GetLineLength(Linepts[0].lat(), Linepts[0].lng(), Linepts[1].lat(), Linepts[1].lng())); |
LineLength = Math.round(GetLineLength(Linepts[0].lat(), Linepts[0].lng(), Linepts[1].lat(), Linepts[1].lng())); | |
|
| |
var polyOptions = {geodesic:false}; |
var polyOptions = {geodesic:false}; | |
var polyline = new GPolyline([ |
var polyline = new GPolyline([LoadedNodes[id1],LoadedNodes[id2]], LinkColBg, 3 + LinkSize, LinkColBgOpacity, polyOptions); | |
LoadedNodes[id1], |
map.addOverlay(polyline); | |
LoadedNodes[id2] |
||
], LinkColBg, 3 + LinkSize, LinkColBgOpacity, polyOptions); |
||
// polyline = new BDCCPolyline(Linepts,LinkColBg, 3 + LinkSize, LinkColBgOpacity,LineLength + "m"); |
||
|
| |
map.addOverlay(polyline); |
||
var LinkColTypeAct = LinkColTypeNA; |
var LinkColTypeAct = LinkColTypeNA; | |
if ( LinkColType[type]) { |
if ( LinkColType[type]) { | |
LinkColTypeAct = LinkColType[type]; |
LinkColTypeAct = LinkColType[type]; | |
} |
} | |
|
| |
LoadedLinks[id1+"x"+id2] = new BDCCPolyline(Linepts,LinkColTypeAct, 1 + LinkSize, LinkColOpacity,LineLength + "m type=" + type +" backbone=" + backbone, LinkStyle); |
LoadedLinks[id1+"x"+id2] = new GPolyline([LoadedNodes[id1],LoadedNodes[id2]], LinkColTypeAct, 1 + LinkSize, LinkColOpacity, polyOptions); | |
|
||
|
||
map.addOverlay(LoadedLinks[id1+"x"+id2]); |
map.addOverlay(LoadedLinks[id1+"x"+id2]); | |
|
||
GEvent.addListener(LoadedLinks[id1+"x"+id2],"mouseover",function(){LoadedLinks[id1+"x"+id2].setOpacity(0.2);}); |
||
GEvent.addListener(LoadedLinks[id1+"x"+id2],"click",function(){alert("ahoj");}); |
||
|
||
// GEvent.addListener(LoadedLinks[id1+"x"+id2],"click", function() { |
||
//var myHtml = LineLength + "m type=" + type +" backbone=" + backbone; |
||
// var myHtml = "<b>" + LineLength + "m " + type + "</b> <br/>backbone:" + backbone +" <br/>" + type; |
||
// map.openInfoWindowHtml(LoadedLinks[id1+"x"+id2], myHtml); |
||
// }); |
||
|
| |
NumVisibleLinks = NumVisibleLinks + 1; |
NumVisibleLinks = NumVisibleLinks + 1; | |
} else { |
} else { | |
//zde se pokusime donahrat nod ktery nam chybi |
//zde se pokusime donahrat nod ktery nam chybi | |
|
| |
Line 283... | Line 278... | |
var marker = new GMarker(point, {draggable: true, bounce: true, icon: NodeIcon[type]}); |
var marker = new GMarker(point, {draggable: true, bounce: true, icon: NodeIcon[type]}); | |
var html = "<b>" + id + " " + name + "</b> <br/>" + address +" <br/>" + type; |
var html = "<b>" + id + " " + name + "</b> <br/>" + address +" <br/>" + type; | |
GEvent.addListener(marker, "dragstart", function() { |
GEvent.addListener(marker, "dragstart", function() { | |
map.closeInfoWindow(); |
map.closeInfoWindow(); | |
}); |
}); | |
GEvent.addListener(marker, 'click', function() { |
GEvent.addListener(marker, \'click\', function() { | |
marker.openInfoWindowHtml(html); |
marker.openInfoWindowHtml(html); | |
}); |
}); | |
return marker; |
return marker; | |
} |
} | |
|
| |
Line 342... | Line 337... | |
NumAddedNodes=0; |
NumAddedNodes=0; | |
document.getElementById("NumNodes").innerHTML = "Nacteno " + NumAddedNodes + " nodu"; |
document.getElementById("NumNodes").innerHTML = "Nacteno " + NumAddedNodes + " nodu"; | |
LoadedLinks=Array(); |
LoadedLinks=Array(); | |
NumAddedLinks=0; |
NumAddedLinks=0; | |
NumVisibleLinks=0; |
NumVisibleLinks=0; | |
NumInVisibleLinks=0; | ||
document.getElementById("NumLinks").innerHTML = "Nacteno " + NumAddedLinks + " linku"; |
document.getElementById("NumLinks").innerHTML = "Nacteno " + NumAddedLinks + " linku"; | |
} |
} | |
|
| |
//############################## |
//############################## | |
function ToggleAutoFetchMode(NewAutoFetchMode) { |
function ToggleAutoFetchMode(NewAutoFetchMode) { | |
Line 378... | Line 374... | |
<td> |
<td> | |
<div id="map" style="width: 800px; height: 600px"></div> |
<div id="map" style="width: 800px; height: 600px"></div> | |
</td> |
</td> | |
|
| |
<td valign="top"> |
<td valign="top"> | |
<div id="UserInfo">'; | ||
| ||
echo "Prihlasen jako:<br>"; | ||
echo $bbuserinfo['username']." "; | ||
echo $bbuserinfo['userid']." "; | ||
echo $bbuserinfo['mapperms']." "; | ||
echo $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']." "; | ||
| ||
echo '</div> | ||
Prepnout databazi: |
Prepnout databazi: | |
<div id="databaze">0</div> |
<div id="databaze">0</div> | |
<input type="button" value="ajax" onClick="SwitchDatabase('ajax');"/> |
<input type="button" value="ajax" onClick="SwitchDatabase(\'ajax\');"/> | |
<input type="button" value="czfmutf" onClick="SwitchDatabase('czfmutf');"/> |
<input type="button" value="czfmutf" onClick="SwitchDatabase(\'czfmutf\');"/> | |
<input type="button" value="gendb" onClick="SwitchDatabase('gendb');"/> |
<input type="button" value="gendb" onClick="SwitchDatabase(\'gendb\');"/> | |
<br> |
<br> | |
<div id="NumNodes">0</div> |
<div id="NumNodes">0</div> | |
<div id="NumLinks">0</div> |
<div id="NumLinks">0</div> | |
<input type="button" value="Nacist ted" onClick="Fetch();"/> |
<input type="button" value="Nacist ted" onClick="Fetch();"/> | |
<input type="button" value="Smazat ted" onClick="Clear();"/> |
<input type="button" value="Smazat ted" onClick="Clear();"/> | |
Line 424... | Line 429... | |
<br> |
<br> | |
<a href="http://mapki.com/wiki/Knowledge_Base">http://mapki.com/wiki/Knowledge_Base</a> |
<a href="http://mapki.com/wiki/Knowledge_Base">http://mapki.com/wiki/Knowledge_Base</a> | |
<br> |
<br> | |
<a href="http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm">http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm</a> |
<a href="http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm">http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm</a> | |
<br> |
<br> | |
<a href="http://www.czfree.net/forum/showthread.php?postid=197732#post197732">http://www.czfree.net/forum/showthread.php?postid=197732#post197732</a> |
http://www.czfree.net/forum/showthread.php?postid=197732#post197732 | |
</td> |
</td> | |
</tr> |
</tr> | |
|
| |
<tr> |
<tr> | |
<td colspan=2> |
<td colspan=2> | |
Line 441... | Line 446... | |
|
| |
</table> |
</table> | |
|
| |
</body> |
</body> | |
</html> |
</html> | |
'; | ||
?> | ||
|
|