Rev 175 | Rev 180 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 175 | Rev 178 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | max-width: 100%; |
85 | max-width: 100%; |
86 | } |
86 | } |
87 | --> |
87 | --> |
88 | </style> |
88 | </style> |
89 | 89 | ||
90 | <script type="text/javascript" src="scripts/builder?src=object,dom,dom/storage,dom/events,dom/timeout,dom/window<?php
|
90 | <script type="text/javascript" src="scripts/builder?src=object,dom,dom/storage,dom/events,dom/timeout,dom/widgets,dom/window,http,lcars<?php
|
91 | if ($isLocal) |
91 | if ($isLocal) |
92 | {
|
92 | {
|
93 | ?>&verbose=1&debug=1<?php |
93 | ?>&verbose=1&debug=1<?php |
94 | }
|
94 | }
|
95 | ?>"></script>
|
95 | ?>"></script>
|
Line 370... | Line 370... | ||
370 | <div class="bow mid right"> </div> |
370 | <div class="bow mid right"> </div> |
371 | </div> |
371 | </div> |
372 | <div class="multi-display"> |
372 | <div class="multi-display"> |
373 | <div class="upper"> |
373 | <div class="upper"> |
374 | <div class="content"> |
374 | <div class="content"> |
375 | <div class="title"><span>Home</span></div> |
375 | <div class="title" id="title"><span>Home</span></div> |
376 | <div class="analysis"> |
376 | <div class="analysis"> |
377 | <table> |
377 | <table> |
378 | <tr> |
378 | <tr> |
379 | <th><?php echo tr('Display'); ?>:</th> |
379 | <th><?php echo tr('Display'); ?>:</th> |
380 | <td><script type="text/javascript"> |
380 | <td><script type="text/javascript"> |
Line 499... | Line 499... | ||
499 | <tr> |
499 | <tr> |
500 | <th><?php echo tr('Features'); ?>:</th> |
500 | <th><?php echo tr('Features'); ?>:</th> |
501 | <td><script type="text/javascript"> |
501 | <td><script type="text/javascript"> |
502 | var fullscreen = jsx.dom.window.fullscreen; |
502 | var fullscreen = jsx.dom.window.fullscreen; |
503 | 503 | ||
- | 504 | var map, circle; |
|
- | 505 | ||
- | 506 | function initGMap () |
|
- | 507 | { |
|
- | 508 | var coords = jsx.dom.geolocation.position.coords; |
|
- | 509 | //var title = document.getElementById("title"); |
|
- | 510 | //title.firstChild.textContent = [coords.latitude.toFixed(), "° ", coords.longitude, "° (", coords.accuracy, "\xA0m)"].join(""); |
|
- | 511 | var center = new google.maps.LatLng(coords.latitude, coords.longitude); |
|
- | 512 | var zoom = 9; |
|
- | 513 | ||
- | 514 | var zoomAccuracy = [ |
|
- | 515 | 1e7, 5e6, 2e6, 2e6, 1e6, 5e5, 2e5, 1e5, 5e4, |
|
- | 516 | 2e4, 1e4, 5e3, 2000, 2000, 1000, 500, 200, |
|
- | 517 | 100, 50, 20 |
|
- | 518 | ]; |
|
- | 519 | ||
- | 520 | var accuracy = coords.accuracy; |
|
- | 521 | if (!isNaN(accuracy)) |
|
- | 522 | { |
|
- | 523 | for (var i = 0, len = zoomAccuracy.length; i < len; ++i) |
|
- | 524 | { |
|
- | 525 | if (accuracy > zoomAccuracy[i]) |
|
- | 526 | { |
|
- | 527 | zoom = i; |
|
- | 528 | break; |
|
- | 529 | } |
|
- | 530 | } |
|
- | 531 | } |
|
- | 532 | ||
- | 533 | if (!map) |
|
- | 534 | { |
|
- | 535 | var mapOptions = { |
|
- | 536 | center: center, |
|
- | 537 | zoom: zoom, |
|
- | 538 | mapTypeId: google.maps.MapTypeId.HYBRID, |
|
- | 539 | backgroundColor: "#000", |
|
- | 540 | noClear: true, |
|
- | 541 | scaleControl: true |
|
- | 542 | }; |
|
- | 543 | ||
- | 544 | map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); |
|
- | 545 | } |
|
- | 546 | else |
|
- | 547 | { |
|
- | 548 | map.setCenter(center); |
|
- | 549 | map.setZoom(zoom); |
|
- | 550 | } |
|
- | 551 | ||
- | 552 | if (!circle) |
|
- | 553 | { |
|
- | 554 | if (!isNaN(coords.accuracy)) |
|
- | 555 | { |
|
- | 556 | circle = new google.maps.Circle({ |
|
- | 557 | map: map, |
|
- | 558 | center: center, |
|
- | 559 | radius: coords.accuracy, |
|
- | 560 | fillColor: "white", |
|
- | 561 | fillOpacity: 0.125, |
|
- | 562 | strokeColor: "white", |
|
- | 563 | strokeOpacity: 0.5 |
|
- | 564 | }); |
|
- | 565 | } |
|
- | 566 | } |
|
- | 567 | else |
|
- | 568 | { |
|
- | 569 | if (!isNaN(coords.accuracy)) |
|
- | 570 | { |
|
- | 571 | circle.setCenter(center); |
|
- | 572 | circle.setRadius(coords.accuracy); |
|
- | 573 | } |
|
- | 574 | else |
|
- | 575 | { |
|
- | 576 | circle.setMap(null); |
|
- | 577 | } |
|
- | 578 | } |
|
- | 579 | ||
- | 580 | /* Restore transition */ |
|
- | 581 | document.getElementById("content").style.transition = ""; |
|
- | 582 | } |
|
- | 583 | ||
504 | jsx.dom.geolocation = { |
584 | jsx.dom.geolocation = { |
505 | getText: function (position) { |
585 | getText: function (position) { |
506 | var coords = position.coords; |
586 | var coords = position.coords; |
507 | var latitude = coords.latitude; |
587 | var latitude = coords.latitude; |
508 | var longitude = coords.longitude; |
588 | var longitude = coords.longitude; |
Line 521... | Line 601... | ||
521 | "<?php echo tr('Heading:'); ?> " + (heading != null && !isNaN(heading) ? heading + "°" : TEXT_NOT_AVAILABLE) |
601 | "<?php echo tr('Heading:'); ?> " + (heading != null && !isNaN(heading) ? heading + "°" : TEXT_NOT_AVAILABLE) |
522 | ].join("\n"); |
602 | ].join("\n"); |
523 | }, |
603 | }, |
524 | 604 | ||
525 | show: function (position) { |
605 | show: function (position) { |
- | 606 | this.position = position; |
|
526 | window.alert("<?php echo tr('Your current coordinates on Terra'); ?>\n\n" + this.getText(position)); |
607 | //document.getElementById("content").innerHTML = "<?php echo tr('Your current coordinates on Terra'); ?>\n\n" + this.getText(position); |
- | 608 | var title = document.getElementById("title"); |
|
- | 609 | title.firstChild.textContent = "<?php echo tr('Geolocation'); ?>"; |
|
- | 610 | var content = document.getElementById("content"); |
|
- | 611 | ||
- | 612 | if (!map) |
|
- | 613 | { |
|
- | 614 | /* Disable transition while map is loading */ |
|
- | 615 | content.style.transition = "none"; |
|
- | 616 | content.className = "fixed"; |
|
- | 617 | content.innerHTML = |
|
- | 618 | // '<select><option>Google Maps</option><option>OpenStreetMap</option></select>' |
|
- | 619 | '<div id="map-canvas" style="position: absolute; width: 100%; height: 100%"></div>'; |
|
- | 620 | } |
|
- | 621 | ||
- | 622 | var scriptId = "google-maps"; |
|
- | 623 | var script = document.getElementById(scriptId); |
|
- | 624 | if (!script) |
|
- | 625 | { |
|
- | 626 | script = document.createElement("script"); |
|
- | 627 | script.id = scriptId; |
|
- | 628 | script.type = "text/javascript"; |
|
- | 629 | script.src = "http://maps.googleapis.com/maps/api/js?key=AIzaSyCpW3bu57j4V7_vcK_cVpvFkXMmKkKgADI&sensor=true&callback=initGMap&language=<?php echo $language; ?>"; |
|
- | 630 | document.body.appendChild(script); |
|
- | 631 | } |
|
- | 632 | else |
|
- | 633 | { |
|
- | 634 | initGMap(); |
|
- | 635 | } |
|
527 | } |
636 | } |
528 | }; |
637 | }; |
529 | 638 | ||
530 | (function () { |
639 | (function () { |
531 | function getFeatures () |
640 | function getFeatures () |