jablonka.czprosek.czf

czfgmap

Subversion Repositories:
[/] [index.php] - Blame information for rev 9

 

Line No. Rev Author Line
15simandl<?php
2//<!-- Copyright (C) 2008 Petr Simandl www.simandl.cz -->
3//<!-- This file is part of CZFGmap. -->
4//<!-- -->
5//<!-- CZFGmap is free software: you can redistribute it and/or modify -->
6//<!-- it under the terms of the GNU General Public License as published by -->
7//<!-- the Free Software Foundation, either version 3 of the License, or -->
8//<!-- (at your option) any later version. -->
9//<!-- -->
10//<!-- CZFGmap is distributed in the hope that it will be useful, -->
11//<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
12//<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
13//<!-- GNU General Public License for more details. -->
14//<!-- -->
15//<!-- You should have received a copy of the GNU General Public License -->
16//<!-- along with CZFGmap. If not, see <http://www.gnu.org/licenses/>. -->
17 
18error_reporting(7);
19 
20include("../forum/globalmap.php");
21 
22switch (@$_SERVER['SERVER_NAME']) {
23 case "connected.czf":
24 $GMapKey="ABQIAAAAvGTA14kOdSvtr3t8EjKUdxQ2n1pNbYRLwYPuGT94C-0un95jGhSkgS0a3LnGa2MzRepHicK08lDDmg";
25 break;
26 case "mapa.prosek.czf":
27 $GMapKey="ABQIAAAAlZ9uhPay2OYt2xmaN84g0BTYUdkyQZ68wktXWB9o4y2agzv8zxRyBxtFdIbLe18hmqHTwiWPXl7VxA";
28 break;
29 default:
30 $GMapKey="ABQIAAAAlZ9uhPay2OYt2xmaN84g0BTYUdkyQZ68wktXWB9o4y2agzv8zxRyBxtFdIbLe18hmqHTwiWPXl7VxA";
31}
32 
33echo '
341simandl<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
35 
36 
37<html xmlns="http://www.w3.org/1999/xhtml">
38 <head>
39 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
403simandl <title>CZFGmap</title>
411simandl <META name="AUTHOR" content="Petr Simandl, www.simandl.cz">
42 <META name="LICENSE" content="GNU General Public License">
43 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
44 <link REL="SHORTCUT ICON" HREF="favicon.ico">
45 <style type="text/css">
46 @import url("http://www.google.com/uds/css/gsearch.css");
47 @import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");
48 @import "czfgmap.css";
49 }
50 </style>
515simandl <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key='.$GMapKey.'"
521simandl type="text/javascript"></script>
53 <script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0" type="text/javascript"></script>
549simandl <script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>
551simandl <script type="text/javascript">
56 
579simandl //<![CDATA[
58 
591simandl //### Globalni promenne #################################
60 var CurrentDatabase = "czfmutf";
61 var NodeLimit = "200";
62 var NodeOrder = "ASC";
63 var NodeSortBy = "name";
64 var Where = "";
65 var LoadedNodes = new Array();
669simandl var LoadedLinks = new Array();
671simandl var map;
688simandl var NodeIcon = new Array();
69 var DatabaseNodeTables = new Array();
701simandl var AutoFetchMode = true;
71 var AutoClearMode = true;
72 var NumLoadedNodes = 0;
73 var NumAddedNodes = 0;
74 var NumLoadedLinks = 0;
75 var NumAddedLinks = 0;
76 var NumVisibleLinks = 0;
77 var NumInVisibleLinks = 0;
788simandl var PtA = new Array();
79 var PtB = new Array();
80 var PtC = new Array();
81 var PtPt = 1;
82 var PtNum = 0;
839simandl 
84 var MapSizeX = 800;
85 var MapSizeY = 600;
86 var MapCenterLat = 50.123567;
87 var MapCenterLon = 14.496258;
88 var MapZoom = 15;
89 var MapName = "Mapa";
90 var saved=[];
913simandl 
928simandl var LinkColType = new Array();
934simandl LinkColType["00000001"] = "#00aa00";
943simandl LinkColType["00000001"] = "#00FF00";
95 var LinkColTypeWifiBackbone = "#fafa00";
96 LinkColType["00000002"] = "#be0000";
97 LinkColType["00000006"] = "#ff5050";
98 LinkColType["00000003"] = "#64c8ff";
99 LinkColType["00000004"] = "#dc00dc";
100 LinkColType["00000007"] = "#c8c8c8";
101 LinkColType["00000008"] = "#ffffff";
102 LinkColType["00000009"] = "#fa8000";
103 LinkColType["00000099"] = "#0000fa";
104 var LinkColTypeNA = "#78783c";
105 LinkColType["00000005"] = "#00fafa";
1061simandl 
107 //nacteni ikon pro nody
108 var NodeType = [0,1,9,10,98,99];
109 var NodeState = [1,9,10,40,79,80,90];
110 for (type in NodeType) {
111 for (state in NodeState) {
112 i = 10000 + NodeType[type]*100 + NodeState[state];
113 NodeIcon[i] = new GIcon();
1145simandl NodeIcon[i].image = "./images/node/node-" + NodeType[type] + "-" + NodeState[state] + ".png";
1151simandl NodeIcon[i].iconSize = new GSize(15,15);
116 NodeIcon[i].iconAnchor = new GPoint(7,7);
117 NodeIcon[i].shadowSize = new GSize(22,20);
118 NodeIcon[i].infoWindowAnchor = new GPoint(5,1);
119 }
120 }
121 
122 //### Uvodni funkce #################################
123 function load() {
1249simandl MapLoad();
125 LoadSettings();
126 }
127 
128 function MapLoad() {
1291simandl if (GBrowserIsCompatible()) {
1305simandl map = new GMap2(document.getElementById("map"),{draggableCursor: \'crosshair\', draggingCursor: \'pointer\'});
1319simandl 
132 
1331simandl map.addControl(new GLargeMapControl());
134 map.addControl(new GMapTypeControl());
1359simandl var MapCenter = new GLatLng(MapCenterLat, MapCenterLon);
136 map.setCenter(MapCenter, MapZoom);
1371simandl map.enableScrollWheelZoom();
138 map.addControl(new GScaleControl());
1399simandl map.addControl(new MDControl());
140 
141 // Selecting map type
142 var MapTypes = map.getMapTypes();
143 for(var i = 0; i < MapTypes.length; i++) {
144 if (MapName == MapTypes[i].getName()) map.setMapType(MapTypes[i]);
145 }
146 
147 map.addControl(new GOverviewMapControl());
1481simandl 
149 map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));
150 //tohle zajisti znovunacteni nodu po presunu
151 GEvent.addListener(map, "moveend", HandleMapMoveEnd);
152 
1532simandl //ziskani souradnic po kliknuti
1548simandl GEvent.addListener(map, \'click\', function(overlay, point) { if(point) { HandleNextPoint(point) }} );
1552simandl 
1561simandl //tohle zajisti vypis pri startu
157 var center = map.getCenter();
1589simandl document.getElementById("SouradniceStredu").innerHTML = CurrentDatabase + "<br>Souradnice stredu:" + center.toString() + "<br>Rozsah: " + map.getBounds()+"<br>Zvetseni: " + map.getZoom();
1591simandl 
160 //tohle zajisti prubezny vypis
161 GEvent.addListener(map, "moveend", function() {
162 var center = map.getCenter();
1639simandl document.getElementById("SouradniceStredu").innerHTML = CurrentDatabase + " " + map.getBounds().getSouthWest().lat() + "<br>Souradnice stredu: " + center.toString() + "<br>Rozsah: " + map.getBounds()+"<br>Zvetseni: " + map.getZoom();
1641simandl });
165 }
166 }
167 
168 //### Ostatni funkce ###########################
169 
170 function NodeLayer() {
171 //body se berou z databaze pomoci php skriptu ktery dela jen inteface a generuje xml
172 Where = "";
173 GDownloadUrl("mapa_genxml.php?db="+CurrentDatabase
174 +"&latmin="+map.getBounds().getSouthWest().lat()
175 +"&latmax="+map.getBounds().getNorthEast().lat()
176 +"&lonmin="+map.getBounds().getSouthWest().lng()
177 +"&lonmax="+map.getBounds().getNorthEast().lng()
178 +"&sortby="+NodeSortBy
179 +"&limit="+NodeLimit
180 +"&order="+NodeOrder
181 +"&where="+Where
182 +"&zoom="+map.getZoom()
183 , function(data) {
184 var xml = GXml.parse(data);
185 var nodes = xml.documentElement.getElementsByTagName("node");
186 for (var i = 0; i < nodes.length; i++) {
187 var id = nodes[i].getAttribute("id");
188 //zobrazime jen nove nody
189 if (! LoadedNodes[id]) {
190 var name = nodes[i].getAttribute("name");
191 var address = nodes[i].getAttribute("address");
192 var type = 10000 + nodes[i].getAttribute("type")*100 + nodes[i].getAttribute("status")*1;
193 var point = new GLatLng(parseFloat(nodes[i].getAttribute("lat")),
194 parseFloat(nodes[i].getAttribute("lng")));
195 var marker = CreateMarker(point, name, address, type, id);
196 map.addOverlay(marker);
197 LoadedNodes[id]=point;
198 NumAddedNodes = NumAddedNodes + 1;
199 }
200 }
201 document.getElementById("NumNodes").innerHTML = "Nacteno " + NumAddedNodes + " nodu";
202 
203 var links = xml.documentElement.getElementsByTagName("link");
204 for (var i = 0; i < links.length; i++) {
205 var id1 = links[i].getAttribute("id1");
206 var id2 = links[i].getAttribute("id2");
207 //nacteme jen pokud jde o novy link
208 if (! LoadedLinks[id1+"x"+id2] && ! LoadedLinks[id2+"x"+id1]) {
209 var backbone = links[i].getAttribute("backbone");
210 var inplanning = links[i].getAttribute("inplanning");
211 var type = links[i].getAttribute("type");
212 var status = links[i].getAttribute("status");
213 
214 //zobrazi se jen pokud jsou k dispozici oba nody
215 if ( LoadedNodes[id1] && LoadedNodes[id2]) {
2163simandl var LinkSize = (backbone * 2);
2174simandl var LinkColBg = "#000000";
2186simandl var LinkColBgOpacity = 1;
219 var LinkColOpacity = 1;
2204simandl var LinkStyle = "solid";
221 
222 if (inplanning == 1) {
223 LinkColBgOpacity = 0.1;
2245simandl LinkColOpacity = 0.2;
2254simandl LinkColBg = "#0000FF";
226 LinkStyle = "dash";
227 }
228// DebugPrint(":"+ inplanning + ":");
229 
2301simandl var polyOptions = {geodesic:false};
2315simandl var polyline = new GPolyline([LoadedNodes[id1],LoadedNodes[id2]], LinkColBg, 3 + LinkSize, LinkColBgOpacity, polyOptions);
232 map.addOverlay(polyline);
2334simandl 
2343simandl var LinkColTypeAct = LinkColTypeNA;
235 if ( LinkColType[type]) {
236 LinkColTypeAct = LinkColType[type];
237 }
2382simandl 
2395simandl LoadedLinks[id1+"x"+id2] = new GPolyline([LoadedNodes[id1],LoadedNodes[id2]], LinkColTypeAct, 1 + LinkSize, LinkColOpacity, polyOptions);
2404simandl map.addOverlay(LoadedLinks[id1+"x"+id2]);
241 
2421simandl NumVisibleLinks = NumVisibleLinks + 1;
243 } else {
244 //zde se pokusime donahrat nod ktery nam chybi
245 
246 
247 NumInVisibleLinks = NumInVisibleLinks + 1;
248 }
249 
2504simandl// LoadedLinks[id1+"x"+id2]=polyline;
251 
2521simandl NumAddedLinks = NumAddedLinks + 1;
253 }
254 }
255 document.getElementById("NumLinks").innerHTML = "Nacteno " + NumAddedLinks + " linku a zobrazeno " + NumVisibleLinks + " linku a " + NumInVisibleLinks + " nezobrazeno.";
256 });
257 }
258 
259 //##############################
2608simandl function HandleNextPoint(point) {
261 
262 document.getElementById("NodeCoordinates").innerHTML = (point.y.toFixed(6)+\'x\'+point.x.toFixed(6));
263 
264 if ( PtPt == 1 ) {
265 document.getElementById("NodeCoordinatesA").innerHTML = (\'A \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6));
266 PtA = point;
267 }
268 if ( PtPt == 2 ) {
269 document.getElementById("NodeCoordinatesB").innerHTML = (\'B \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6));
270 PtB = point;
271 }
272 if ( PtPt == 3 ) {
273 document.getElementById("NodeCoordinatesC").innerHTML = (\'C \'+point.y.toFixed(6)+\'x\'+point.x.toFixed(6));
274 PtC = point;
275 }
276 
277 
278 PtPt = PtPt + 1;
279 if ( PtPt > 3 ) { PtPt = 1; }
280 PtNum = PtNum + 1;
281 
282 if ( PtNum > 1 ) {
2839simandl var DistanceAB = Math.round(GetLineLength(PtA, PtB));
284 document.getElementById("NodeDistanceAB").innerHTML = DistanceAB+\'m\';
285 document.getElementById("NodeDistanceBA").innerHTML = DistanceAB+\'m\';
2868simandl }
287 if ( PtNum > 2 ) {
2889simandl var DistanceBC = Math.round(GetLineLength(PtC, PtB));
289 document.getElementById("NodeDistanceBC").innerHTML = DistanceBC+\'m\';
290 document.getElementById("NodeDistanceCB").innerHTML = DistanceBC+\'m\';
291 var DistanceAC = Math.round(GetLineLength(PtC, PtA));
292 document.getElementById("NodeDistanceAC").innerHTML = DistanceAC+\'m\';
293 document.getElementById("NodeDistanceCA").innerHTML = DistanceAC+\'m\';
2948simandl 
2959simandl document.getElementById("NodeAngleACB").innerHTML = Math.round(GetAngle(PtA, PtC, PtB))+\'st\';
296 document.getElementById("NodeAngleBAC").innerHTML = Math.round(GetAngle(PtB, PtC, PtA))+\'st\';
297 document.getElementById("NodeAngleCBA").innerHTML = Math.round(GetAngle(PtC, PtA, PtB))+\'st\';
298 
299 document.getElementById("NodeDistanceBAC").innerHTML = ( DistanceAB + DistanceAC ) +\'m\';
300 document.getElementById("NodeDistanceABC").innerHTML = ( DistanceAB + DistanceBC ) +\'m\';
301 document.getElementById("NodeDistanceBCA").innerHTML = ( DistanceBC + DistanceAC ) +\'m\';
3028simandl }
3039simandl }
3048simandl 
3059simandl //##############################
306 function GetAngle(PA, PB, PC) {
307 var a = GetLineLength(PC, PB);
308 var b = GetLineLength(PC, PA);
309 var c = GetLineLength(PA, PB);
310 var s = ( a + b + c ) / 2;
311 var alfa = (360/Math.PI)*Math.asin(Math.sqrt((s-b)*(s-c)/(b*c)));
312 return alfa;
3138simandl }
314 
315 //##############################
3169simandl function GetLineLength(PA, PB) {
317 var Lat1 = PA.lat();
318 var Lon1 = PA.lng();
319 var Lat2 = PB.lat();
320 var Lon2 = PB.lng();
3214simandl var R = 6371; // km
322 var dLat = (Lat2-Lat1) * Math.PI / 180;
323 var dLon = (Lon2-Lon1) * Math.PI / 180;
324 var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
325 Math.cos(Lat1 * Math.PI / 180) * Math.cos(Lat2 * Math.PI / 180) *
326 Math.sin(dLon/2) * Math.sin(dLon/2);
327 var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
328 var LineLength = 1000 * R * c;
329 return LineLength;
330 }
331 
332 //##############################
3331simandl function HandleMapMoveEnd() {
334 if (AutoFetchMode) {
335 ClearOverlayAndData();
336 FetchOverlayAndData();
337 }
338 document.getElementById("status").innerHTML = "Po presunu mame celkem " + NumAddedNodes + " nodu";
339 }
340 
341 //##############################
342 function CreateMarker(point, name, address, type, id) {
343 var marker = new GMarker(point, {draggable: true, bounce: true, icon: NodeIcon[type]});
344 var html = "<b>" + id + " " + name + "</b> <br/>" + address +" <br/>" + type;
345 GEvent.addListener(marker, "dragstart", function() {
346 map.closeInfoWindow();
347 });
3485simandl GEvent.addListener(marker, \'click\', function() {
3491simandl marker.openInfoWindowHtml(html);
350 });
351 return marker;
352 }
353 
354 //##############################
355 function SwitchDatabase(NewDatabase) {
356 CurrentDatabase = NewDatabase;
3579simandl document.getElementById("SouradniceStredu").innerHTML = CurrentDatabase;
3581simandl ClearOverlayAndData();
359 FetchOverlayAndData();
360 document.getElementById("status").innerHTML = "Databaze zmenena na "+CurrentDatabase;
361 document.getElementById("databaze").innerHTML = CurrentDatabase;
362 }
363 
364 //##############################
365 function ChangeNodeLimit(NewNodeLimit) {
366 NodeLimit = NewNodeLimit;
367 FetchOverlayAndData();
368 document.getElementById("status").innerHTML = "Limit zmenen na "+NewNodeLimit;
3699simandl document.getElementById("NodeLimitSelectBox").value = NodeLimit;
3701simandl }
371 
372 //##############################
3739simandl function ChangeMapSizeX(NewMapSizeX) {
374 MapSizeX = NewMapSizeX;
375 FetchOverlayAndData();
376 document.getElementById("status").innerHTML = "Rozmer X zmenen na "+MapSizeX;
377 document.getElementById("map").style.width = MapSizeX+"px";
378 
379 ClearOverlayAndData();
380 MapLoad();
381 FetchOverlayAndData();
382 }
383 
384 //##############################
385 function ChangeMapSizeY(NewMapSizeY) {
386 MapSizeY = NewMapSizeY;
387 FetchOverlayAndData();
388 document.getElementById("status").innerHTML = "Rozmer Y zmenen na "+MapSizeY;
389 document.getElementById("map").style.height = MapSizeY+"px";
390 
391 ClearOverlayAndData();
392 MapLoad();
393 FetchOverlayAndData();
394 }
395 
396 //##############################
3974simandl function DebugPrint(Text) {
398 document.getElementById("debug").innerHTML = document.getElementById("debug").innerHTML + Text;
399 }
400 
401 //##############################
4021simandl function Fetch() {
403 NodeLayer();
404 document.getElementById("status").innerHTML = "Nacteno";
405 }
406 
407 //##############################
408 function FetchOverlayAndData() {
409 if (AutoFetchMode) {
410 Fetch();
411 };
412 }
413 
414 //##############################
415 function ClearOverlayAndData() {
416 if (AutoClearMode) {
4179simandl ForceClear();
4181simandl };
419 }
420 
421 //##############################
4229simandl function ForceClear() {
4231simandl document.getElementById("status").innerHTML = "Smazano " + NumAddedNodes + " nodu";
424 map.clearOverlays();
425 LoadedNodes=Array();
426 LoadedLinks=Array();
427 NumAddedNodes=0;
428 document.getElementById("NumNodes").innerHTML = "Nacteno " + NumAddedNodes + " nodu";
429 NumAddedLinks=0;
430 NumVisibleLinks=0;
4315simandl NumInVisibleLinks=0;
4321simandl document.getElementById("NumLinks").innerHTML = "Nacteno " + NumAddedLinks + " linku";
433 }
434 
435 //##############################
436 function ToggleAutoFetchMode(NewAutoFetchMode) {
437 AutoFetchMode = NewAutoFetchMode;
438 if (AutoFetchMode) {
439 document.getElementById("status").innerHTML = "Automaticke nacitani zapnuto.";
440 }
441 else {
442 document.getElementById("status").innerHTML = "Automaticke nacitani vypnuto.";
443 }
4449simandl document.getElementById("AutoFetchModeCheckButton").checked = AutoFetchMode;
4451simandl }
446 
447 //##############################
448 function ToggleAutoClearMode(NewAutoClearMode) {
449 AutoClearMode = NewAutoClearMode;
450 if (AutoClearMode) {
451 document.getElementById("status").innerHTML = "Automaticke mazani zapnuto.";
452 }
453 else {
454 document.getElementById("status").innerHTML = "Automaticke mazani vypnuto.";
4559simandl }
456 document.getElementById("AutoClearModeCheckButton").checked = AutoClearMode;
4571simandl }
458 
4599simandl //##############################
460 function SetCookie(Name, Data, Validity) {
461 var Day = 24 * 3600 * 1000;
462 var Expiration = new Date();
463 Expiration.setTime(Expiration.getTime() + Validity * Day);
464 document.cookie = Name + "=" + escape(Data) + "; expires=" + Expiration.toGMTString() + "; path=/";
465 }
466 
467 //##############################
468 function GetCookie(Name) {
469 var Prefix = Name + "=";
470 var Begin = document.cookie.indexOf(Prefix);
471 if ( Begin == -1 )
472 return "";
473 Begin += Prefix.length;
474 if ( Begin >= document.cookie.length )
475 return "";
476 var End = document.cookie.indexOf(";", Begin);
477 if ( End == -1 )
478 End = document.cookie.length;
479 return unescape(document.cookie.substring(Begin, End));
480 }
481 
482 //##############################
483 function SaveSettingsCookieText() {
484 var Text = "db=" + CurrentDatabase
485 + "&map=" + map.getCurrentMapType().getName()
486 + "&sizex=" + MapSizeX
487 + "&sizey=" + MapSizeY
488 + "&lat=" + map.getCenter().lat()
489 + "&lon=" + map.getCenter().lng()
490 + "&zoom=" + map.getZoom()
491 + "&autofetch=" + AutoFetchMode
492 + "&autoclear=" + AutoClearMode
493 + "&nodelimit=" + NodeLimit
494 + "&";
495 return Text;
496 }
497 
498 //##############################
499 function LoadSettings() {
500 var Text = GetCookie("default");
501 var Begin = 0;
502 var End = 0;
503 
504 End = Text.indexOf("&",Begin);
505 while (End > -1) {
506 var Parameter = Text.substring(Begin,End);
507 var EqualPosition = Parameter.indexOf("=");
508 if ((EqualPosition > -1) && (EqualPosition < Parameter.length)) {
509 var ParameterName = Parameter.substring(0,EqualPosition);
510 var ParameterValue = Parameter.substring(EqualPosition+1,Parameter.length);
511 if (ParameterName == "db") CurrentDatabase = ParameterValue;
512 if (ParameterName == "map") MapName = ParameterValue;
513 if (ParameterName == "sizex") MapSizeX = 1*ParameterValue;
514 if (ParameterName == "sizey") MapSizeY = 1*ParameterValue;
515 if (ParameterName == "lat") MapCenterLat = 1*ParameterValue;
516 if (ParameterName == "lon") MapCenterLon = 1*ParameterValue;
517 if (ParameterName == "zoom") MapZoom = 1*ParameterValue;
518 if ((ParameterName == "autofetch") && ParameterValue == "true" ) ToggleAutoFetchMode(true);
519 if ((ParameterName == "autofetch") && ParameterValue == "false" ) ToggleAutoFetchMode(false);
520 if ((ParameterName == "autoclear") && ParameterValue == "true" ) ToggleAutoClearMode(true);
521 if ((ParameterName == "autoclear") && ParameterValue == "false" ) ToggleAutoClearMode(false);
522 if (ParameterName == "nodelimit") ChangeNodeLimit(ParameterValue);
523 }
524 Begin = End + 1;
525 End = Text.indexOf("&",Begin);
526 }
527 
528 document.getElementById("AutoFetchModeCheckButton").checked = AutoFetchMode;
529 document.getElementById("AutoClearModeCheckButton").checked = AutoClearMode;
530 document.getElementById("NodeLimitSelectBox").value = NodeLimit;
531 document.getElementById("databaze").innerHTML = CurrentDatabase;
532 
533 document.getElementById("MapSizeXSelectBox").value = MapSizeX;
534 document.getElementById("MapSizeYSelectBox").value = MapSizeY;
535 document.getElementById("map").style.width = MapSizeX+"px";
536 document.getElementById("map").style.height = MapSizeY+"px";
537 ForceClear();
538 MapLoad();
539 FetchOverlayAndData();
540 }
541 
542 //##############################
543function MDControl() { }
544 MDControl.prototype = new GControl();
545 MDControl.prototype.initialize = function(map) {
546 var container = document.createElement("div");
547 var savepos= document.createElement("div");
548 savepos.title= "Save actual position and zoomlevel";
549 savepos.className= "MDbuttons";
550 container.appendChild(savepos);
551 savepos.appendChild(document.createTextNode("Save Position"));
552 GEvent.addDomListener(savepos, "click", function() {
553 var center = map.getCenter(); var zoom = map.getZoom();
554 saved.splice(0,2,center,zoom);
555// alert("Saved Position: "+center.toUrlValue()+"\nZoomlevel: "+zoom);
556 });
557 
558 var tosaved=document.createElement("div");
559 tosaved.title= "Back to saved position";
560 tosaved.className= "MDbuttons";
561 container.appendChild(tosaved);
562 tosaved.appendChild(document.createTextNode("To Saved"));
563 GEvent.addDomListener(tosaved, "click", function() {
564 if(saved.length > 0) { map.setZoom(saved[1]); map.panTo(saved[0]); }
565 });
566 map.getContainer().appendChild(container);
567 return container;
568}
569 
570MDControl.prototype.getDefaultPosition = function() {
571 return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7,31));
572}
573 
574 
575 //]]>
576 </script>
5771simandl </head>
578 
579 <body onload="load()" onunload="GUnload()">
580 <table>
581 <tr>
582 <td>
5839simandl <div id="map" class="gmaparea"></div>
5841simandl </td>
585 
5869simandl <td valign="top" class="controlarea">
5875simandl <div id="UserInfo">';
588 
589 echo "Prihlasen jako:<br>";
590 echo $bbuserinfo['username']."&nbsp;";
591 echo $bbuserinfo['userid']."&nbsp;";
592 echo $bbuserinfo['mapperms']."&nbsp;";
593 echo $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']."&nbsp;";
594 
595 echo '</div>
5961simandl Prepnout databazi:
597 <div id="databaze">0</div>
5985simandl <input type="button" value="ajax" onClick="SwitchDatabase(\'ajax\');"/>
599 <input type="button" value="czfmutf" onClick="SwitchDatabase(\'czfmutf\');"/>
600 <input type="button" value="gendb" onClick="SwitchDatabase(\'gendb\');"/>
6011simandl <br>
602 <div id="NumNodes">0</div>
603 <div id="NumLinks">0</div>
604 <input type="button" value="Nacist ted" onClick="Fetch();"/>
6059simandl <input type="button" value="Smazat ted" onClick="ForceClear();"/>
6061simandl <br>
607 Automaticke nacitani:
608 <input id="AutoFetchModeCheckButton" type="checkBox" onclick="ToggleAutoFetchMode(this.checked)">
609 <br>
610 Automaticke mazani:
611 <input id="AutoClearModeCheckButton" type="checkBox" onclick="ToggleAutoClearMode(this.checked)">
612 <br>
613 Limit nodu:
614 <select id="NodeLimitSelectBox" onchange="ChangeNodeLimit(this.value)">
615 <option value="0">0</option>
616 <option value="30" selected="selected">30</option>
617 <option value="60">60</option>
618 <option value="200">200</option>
619 <option value="500">500</option>
620 <option value="1000">1000</option>
621 </select>
6223simandl 
6239simandl <input type="button" value=\'Save settings\' onclick=\'SetCookie("default", SaveSettingsCookieText() , 365);\'>
624 <input type="button" value=\'Load settings\' onclick=\'LoadSettings();\'>
625 <div>
626 <select id="MapSizeXSelectBox" onchange="ChangeMapSizeX(this.value)">
627 <option value="800" selected="selected">800</option>
628 <option value="900">900</option>
629 <option value="1000">1000</option>
630 <option value="1100">1100</option>
631 <option value="1200">1200</option>
632 <option value="1300">1300</option>
633 <option value="1400">1400</option>
634 </select>
635 X
636 <select id="MapSizeYSelectBox" onchange="ChangeMapSizeY(this.value)">
637 <option value="600" selected="selected">600</option>
638 <option value="700">700</option>
639 <option value="800">800</option>
640 <option value="900">900</option>
641 <option value="1000">1000</option>
642 </select>
643 </div>
644 
6451simandl </td>
646 </tr>
647 
648 <tr>
6499simandl <td class="statusarea" >
6501simandl 
6514simandl <div id="debug"></div>
6521simandl <div id="status">Hotovo!</div>
653 <div id="data"></div>
6542simandl <div id="NodeCoordinates">aaa</div>
6559simandl <div id="SouradniceStredu">Souradnice stredu:<br>Rozsah:<br>Zvetseni:</div>
6564simandl <a href="http://code.google.com/apis/maps/documentation/examples/">http://code.google.com/apis/maps/documentation/examples/</a>
6571simandl <br>
6584simandl <a href="http://code.google.com/apis/kml/documentation/kml_tut.html">http://code.google.com/apis/kml/documentation/kml_tut.html</a>
659 <br>
660 <a href="http://mapki.com/wiki/Knowledge_Base">http://mapki.com/wiki/Knowledge_Base</a>
661 <br>
662 <a href="http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm">http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm</a>
663 <br>
6645simandl http://www.czfree.net/forum/showthread.php?postid=197732#post197732
6659simandl <td>
666 <table border="1">
667 <tr>
668 <td>Mereni vzdalenosti a uhlu</td><td>A</td><td>B</td><td>C</td>
669 </tr>
670 <tr>
671 <td><div id="NodeCoordinatesA">A klikni na mapu</div></td><td><div id="NodeAngleACB">ACB</div></td>
672 <td><div id="NodeDistanceAB">AB</div></td><td><div id="NodeDistanceAC">AC</div></td>
673 </tr>
674 <tr>
675 <td><div id="NodeCoordinatesB">B klikni podruhe</div></td><td><div id="NodeDistanceBA">BA</div></td>
676 <td><div id="NodeAngleBAC">BAC</div></td><td><div id="NodeDistanceBC">BC</div></td>
677 </tr>
678 <tr>
679 <td><div id="NodeCoordinatesC">C klikni potreti</div></td><td><div id="NodeDistanceCA">CA</div></td>
680 <td><div id="NodeDistanceCB">CB</div></td><td><div id="NodeAngleCBA">BAC</div></td>
681 </tr>
682 <tr>
683 <td></td><td><div id="NodeDistanceBAC">B-A-C</div></td>
684 <td><div id="NodeDistanceABC">A-B-C</div></td><td><div id="NodeDistanceBCA">B-C-A</div></td>
685 </tr>
686 </table>
6871simandl </td>
6889simandl 
689 </td>
6901simandl </tr>
691 
692 <tr>
693 <td colspan=2>
694 <br>
695 CZFGmap (c) Petr Simandl - GNU General Public License
696 <br>
697 <a href="http://websvn.prosek.czf/">websvn.prosek.czf</a>
698 </td>
699 </tr>
700 
701 </table>
702 
703 </body>
704</html>
7055simandl';
706?>

Powered by WebSVN 2.2.1