-
Notifications
You must be signed in to change notification settings - Fork 39
/
final.html
137 lines (117 loc) · 5.3 KB
/
final.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<html>
<head>
<title>Simple HERE Map</title>
<link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
<link rel="stylesheet" type="text/css" href="Second.css">
<style>
html, body { border: 0; margin: 0; padding: 0; }
#map { height: 100vh; width: 100vw; }
</style>
<script language="javascript" type="text/javascript" src="asd.js"></script>
<link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
<link rel="stylesheet" type="text/css" href="demo.css" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="../template.css" />
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-mapevents.js"></script>
<script type="text/javascript" src='../js-examples-rendering-helpers/iframe-height.js'></script>
<div id="loc">
<h1>Check Your Correct Location</h1>
<div>
Latitude <input type="text" id = "lati" name = "lati" value=""><br>
<br>
Longitude <input type="text" id= "long" name = "long" value=""><br>
<br>
</div>
<br>
<div id="button-layer"><button id="btnAction1" onClick="locate1()">LOCATE</button></div>
<br>
<div id="button-layer"><button id="btnAction2" onClick="locate2()">FIND HOTELS</button></div>
<br>
<div id="button-layer"><button id="btnAction3" onClick="locate3()">PARKS AND OUTDOORS</button></div>
<br>
<div id="button-layer"><button id="btnAction4" onClick="locate4()">ARTS AND ENTERTAINMENT</button></div>
<br>
</div>
<div id="map-layer"></div>
<div id="map"></div>
<script src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
<script src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
<script src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
<script src="https://js.api.here.com/v3/3.1/mapsjs-mapevents.js"></script>
<script>
var alat=lati;
var alng=long;
/*if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};*/
function locate1(){
var blat= document.getElementById('lati').value
var blng= document.getElementById('long').value
const platform = new H.service.Platform({ apikey: 'dQQRqagDl2qUnDMl8fOxg0os_RzPintTTnCYTIxYzjk' });
const defaultLayers = platform.createDefaultLayers();
var map = new H.Map(document.getElementById('map'),
defaultLayers.vector.normal.map, {
center: {lat: blat, lng: blng},
zoom: 13,
pixelRatio: window.devicePixelRatio || 1
});
var parisMarker = new H.map.Marker({lat: blat, lng:blng});
map.addObject(parisMarker);
window.addEventListener('resize', () => map.getViewPort().resize());
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));
var ui = H.ui.UI.createDefault(map, defaultLayers);
window.onload = function()
{
addMarkersToMap(map);
}
}
//displaying ends
function locate2(){
var blat= document.getElementById('lati').value
var blng= document.getElementById('long').value
const Http = new XMLHttpRequest();
const url='https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=json&category=Hotel,Motel,Bed and Breakfast,Resort&location='+blat+','+blng+'&outFields=Place_addr, PlaceName&maxLocations=10';
Http.open("GET", url);
Http.send();
Http.onreadystatechange = (e) => {
console.log(Http.responseText)
console.log(url)
Http.responseText
}
}
function locate3(){
var blat= document.getElementById('lati').value
var blng= document.getElementById('long').value
const Http = new XMLHttpRequest();
const url='https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=json&category=Parks and Outdoors&location='+blat+','+blng+'&outFields=Place_addr, PlaceName&maxLocations=10';
Http.open("GET", url);
Http.send();
Http.onreadystatechange = (e) => {
console.log(Http.responseText)
console.log(url)
Http.responseText
}
}
function locate4(){
var blat= document.getElementById('lati').value
var blng= document.getElementById('long').values
const Http = new XMLHttpRequest();
const url='https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=json&category=Arts and Entertainment&location='+blat+','+blng+'&outFields=Place_addr, PlaceName&maxLocations=10';
Http.open("GET", url);
Http.send();
Http.onreadystatechange = (e) => {
console.log(Http.responseText)
console.log(url)
Http.responseText
}
}
</script>
</body>
</html>