source: subversion/applications/mobile/healthwhere/inc_head_html.php @ 34887

Last change on this file since 34887 was 21241, checked in by avantman42, 9 years ago

Removed source column in OS-created postcode DB. No need for it, and should make DB file smaller
Now using OS postcode data (OS OpenData? Code-Point® Open)
Re-licensed (GPL v2) because PHPCoord is licensed under GPL v2

File size: 1.4 KB
Line 
1<html>
2<head>
3<title>Healthwhere</title>
4<!-- viewport meta tag is used to inform Mobile Safari that the page is *not* 980px wide -->
5<meta name="viewport" content="user-scalable=no, width=device-width" />
6<link rel="stylesheet" type="text/css" href="style.css" media="all" />
7<?php
8if (basename ($_SERVER["SCRIPT_FILENAME"]) == "index.php") {
9?>
10        <!-- Geo-location code for compatible browsers -->
11        <script type="text/javascript">
12        <!--
13        function successCallback(position) {
14                var latitude = position.coords.latitude
15                var longitude = position.coords.longitude
16
17                document.getElementById ("txtLatitude").value = latitude
18                document.getElementById ("txtLongitude").value = longitude
19                sURL = "http://www.openstreetmap.org/?mlat=" + latitude + "&mlon=" + longitude + "&zoom=17"
20                document.getElementById ("divLatLon").innerHTML = "<i><a href = '" + sURL + "' title = 'map of your location'>Your location</a> has been filled in automatically. Note that this may not be accurate. <a href = 'geolocation.php'>More information</a></i>"
21        }
22
23        function errorCallback(error) {
24                // do nothing
25        }
26
27        function getlocation () {
28                if (typeof navigator.geolocation != "undefined")
29                        navigator.geolocation.getCurrentPosition (successCallback, errorCallback)
30        }
31        // -->
32        </script>
33<?php
34}
35?>
36</head>
37<?php
38if (basename ($_SERVER["SCRIPT_FILENAME"]) == "index.php")
39        echo "<body onload = 'getlocation ()'>\n";
40else
41        echo "<body>\n";
42?>
Note: See TracBrowser for help on using the repository browser.