-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
63 lines (55 loc) · 1.48 KB
/
index.js
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
var map;
var x;
function loadmaps() {
$.getJSON(
'https://api.thingspeak.com/channels/2170596/fields/5/last.json?api_key=BW06UDS74KGO48UV',
function (result) {
var m = result;
x = Number(m.field1);
//alert(x);
}
);
$.getJSON(
'https://api.thingspeak.com/channels/2170596/fields/6/last.json?api_key=BW06UDS74KGO48UV',
function (result) {
var m = result;
y = Number(m.field2);
}
).done(function () {
initialize();
});
}
window.setInterval(function () {
loadmaps();
}, 9000);
function initialize() {
//alert(y);
var mapOptions = {
zoom: 18,
center: { lat: x, lng: y },
};
map = new google.maps.Map(document.getElementById('map'), mapOptions);
var marker = new google.maps.Marker({
position: { lat: x, lng: y },
map: map,
});
var infowindow = new google.maps.InfoWindow({
content: '<p>Marker Location:' + marker.getPosition() + '</p>',
});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map, marker);
});
}
google.maps.event.addDomListener(window, 'load', initialize);
// ('use strict');
// $(document).ready(function () {
// $(window).bind('scroll', function (e) {
// parallaxScroll();
// });
// });
// function parallaxScroll() {
// const scrolled = $(window).scrollTop();
// $('#team-image').css('top', 0 - scrolled * 0.2 + 'px');
// $('.img-1').css('top', 0 - scrolled * 0.35 + 'px');
// $('.img-2').css('top', 0 - scrolled * 0.05 + 'px');
// }