Subversion Repositories eFlore/Applications.cel

Rev

Rev 3240 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3240 Rev 3260
Line 8... Line 8...
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>
Line 11... Line 11...
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"
-
 
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"
15
  id="tb-geolocation"
26
    map_quest_api_key="mG6oU5clZHRHrOSnAV0QboFI7ahnGg34"
16
    >
27
    >
Line -... Line 28...
-
 
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">
Line 17... Line 35...
17
  </tb-geolocation-element>
35
    <input id="altitude" type="text" placeholder="altitude">
18
  
36
  </form>
19
  
37
  
20
  <script>
38
  <script>
-
 
39
    var tbGeolocation = document.getElementById('tb-geolocation');
-
 
40
    tbGeolocation.addEventListener("location", function(location) {
-
 
41
      console.log(location.detail);
-
 
42
      document.getElementById('locality').value = location.detail.locality;
-
 
43
      document.getElementById('postcode').value = location.detail.osmPostcode;
21
    var tbGeolocation = document.getElementById('tb-geolocation');
44
      document.getElementById('latitude').value = location.detail.geometry.coordinates[1];
22
    tbGeolocation.addEventListener("location", function(location) {
45
      document.getElementById('longitude').value = location.detail.geometry.coordinates[0];
Line 23... Line 46...
23
  		console.log(location.detail);
46
      document.getElementById('altitude').value = location.detail.elevation;