-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.js
37 lines (30 loc) · 1 KB
/
demo.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
window.onload = function() {
var side = document.getElementById("side-panel");
var map = document.getElementById("map-canvas");
var main = document.getElementById("main-wrapper");
side.onclick = function() {
map.style.display = "block";
main.style.display = "none";
}
google.maps.event.addDomListener(side, 'click', initialize);
}
function initialize() {
var geoCode = new google.maps.Geocoder().geocode({
address: "Suite 508, 35 Buckingham Street, Surry Hills, NSW"
}, function(result, status) {
var mapOptions = {
center: result[0].geometry.location,
zoom: 8,
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
map.fitBounds(result[0].geometry.viewport);
var marker = new google.maps.Marker({
position: result[0].geometry.location,
animation: google.maps.Animation.BOUNCE,
title: "You're about here, yes?",
map: map
});
}
);
}