Subversion Repositories eFlore/Applications.cel

Rev

Rev 3240 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3240 Rev 3260
1
<!doctype html>
1
<!doctype html>
2
<html lang="">
2
<html lang="">
3
 
3
 
4
<head>
4
<head>
5
  <base href=".">
5
  <base href=".">
6
  <meta charset="utf-8">
6
  <meta charset="utf-8">
7
  <title>TB Geolocation</title>
7
  <title>TB Geolocation</title>
8
  <link rel="stylesheet" href="./styles.css">
8
  <link rel="stylesheet" href="./styles.css">
9
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
9
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
10
</head>
10
</head>
11
 
11
 
12
<body>
12
<body>
13
  <script src="./tb-geoloc-lib-app_.js"></script>
13
  <script src="./tb-geoloc-lib-app.js"></script>
14
  <tb-geolocation-element  
14
  <tb-geolocation-element
15
  id="tb-geolocation"
15
    id="tb-geolocation"
-
 
16
    layer='opentopomap'
-
 
17
    zoom_init="4"
-
 
18
    lat_init="46.5"
-
 
19
    lng_init="2.9"
-
 
20
    marker="true"
-
 
21
    polyline="false"
-
 
22
    polygon="false"
-
 
23
    show_lat_lng_elevation_inputs="false"
-
 
24
    osm_class_filter=""
-
 
25
    elevation_provider="mapquest"
-
 
26
    map_quest_api_key="mG6oU5clZHRHrOSnAV0QboFI7ahnGg34"
16
    >
27
    >
17
  </tb-geolocation-element>
28
  </tb-geolocation-element>
-
 
29
  
-
 
30
  <form style="display:inline-flex;flex-direction:row;margin:5px;padding:5px;justify-content:space-between;width:80%;border:2px solid grey;">
-
 
31
    <input id="locality" type="text" placeholder="locality">
-
 
32
    <input id="postcode" type="text" placeholder="postcode">
-
 
33
    <input id="latitude" type="text" placeholder="latitude">
-
 
34
    <input id="longitude" type="text" placeholder="longitude">
-
 
35
    <input id="altitude" type="text" placeholder="altitude">
18
  
36
  </form>
19
  
37
  
20
  <script>
38
  <script>
21
    var tbGeolocation = document.getElementById('tb-geolocation');
39
    var tbGeolocation = document.getElementById('tb-geolocation');
22
    tbGeolocation.addEventListener("location", function(location) {
40
    tbGeolocation.addEventListener("location", function(location) {
23
  		console.log(location.detail);
41
      console.log(location.detail);
-
 
42
      document.getElementById('locality').value = location.detail.locality;
-
 
43
      document.getElementById('postcode').value = location.detail.osmPostcode;
-
 
44
      document.getElementById('latitude').value = location.detail.geometry.coordinates[1];
-
 
45
      document.getElementById('longitude').value = location.detail.geometry.coordinates[0];
-
 
46
      document.getElementById('altitude').value = location.detail.elevation;
24
    });
47
    });
25
  </script>
48
  </script>
26
 
49
 
27
</body>
50
</body>
28
 
51
 
29
</html>
52
</html>