-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
73 lines (63 loc) · 3.53 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
<link rel="stylesheet" href="style.css">
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<link rel="stylesheet" href="vendor/Leaflet.MapCenterCoord-v0.7/dist/L.Control.MapCenterCoord.min.css" />
<script src="vendor/Leaflet.MapCenterCoord-v0.7/src/L.Control.MapCenterCoord.js"></script>
<link rel="stylesheet" href="https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.css">
<script src="https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css">
<script src="https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster.js"></script>
</head>
<body>
<div class="container">
<h1>BM finder by radius</h1>
<div id="statusDiv"></div>
<form id="bmRequestForm">
<input id="btnGetCurrentPosition" type='button' value="Use Current Location">
<input type="text" id="lat" placeholder="Latitude" value="">
<input type="text" id="lon" placeholder="Longitude" value="">
<input type="text" id="radius" placeholder="Radius (miles)" value="">
<input type="button" value="Submit" onclick="handlers.getInputValues()" />
<!-- <button type="submit" onclick="getInputValue()">Add waypoint</button> -->
<div id="alert" style="color: red"></div>
</form>
<div id="waypointsDiv">
<!--<button onclick="handlers.toggleAll()" style="margin: 1em 0;">Toggle all</button>-->
<table></table>
</div>
<div id="results"></div>
<div id="map"></div>
</div>
<script>
// Below is for keypress - can also add another button for getting current location - might be better.
// document.addEventListener('keydown', logKey);
// function logKey(e) {
// if (e.code == "KeyL") {
// window.navigator.geolocation
// .getCurrentPosition(handlers.getCurrentLocation, console.log);
// // handlers.getCurrentLocation();
// // https://www.udemy.com/course/display-and-analyze-gis-data-on-the-web/learn/lecture/7280474#overview
// // https://dev.to/codebubb/how-to-get-a-user-s-location-with-javascript-362o
// }
// }
var btn = document.getElementById("btnGetCurrentPosition");
btn.addEventListener('click', getCurrentPosition);
function getCurrentPosition(e) {
window.navigator.geolocation
.getCurrentPosition(handlers.getCurrentLocation, console.log);
}
</script>
<script src="script.js"></script>
</body>
</html>