-
Notifications
You must be signed in to change notification settings - Fork 0
/
maps.html
65 lines (56 loc) · 1.71 KB
/
maps.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 90%;
}
#slider {
height: 10%;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="slider"></div>
<script>
function initMap() {
var myLatLng = {lat: 1.34393, lng: 103.684601};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 16,
center: myLatLng
});
var image = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png';
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'Hello World!',
icon: image
});
$(function() {
$( "#slider" ).slider({
slide: function( event, ui ) {
myLatLng['lat'] += ui.value / 1000;
marker.setPosition(myLatLng);
myLatLng['lat'] -= ui.value / 1000;
}
});
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAB3d1ApqDl_JcNDeFQ-Kk5YZlrigmxhng&callback=initMap">
</script>
</body>
</html>