-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.js
45 lines (43 loc) · 1.11 KB
/
common.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
// This example adds a marker to indicate the position of Bondi Beach in Sydney,
// Australia.
function initMap() {
var customMapType = new google.maps.StyledMapType([
{
stylers: [
{ hue: "#000" },
{ saturation: -100 }
]
},{
featureType: "road",
elementType: "geometry",
stylers: [
{ lightness: 200 },
{ visibility: "simplified" }
]
},{
featureType: "road",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
], {
name: 'Custom Style'
});
var customMapTypeId = 'custom_style';
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: {lat: 44.801800, lng: 20.463302}, // Brooklyn.
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, customMapTypeId]
}
});
var image = 'assets/images/map-ico.png';
var beachMarker = new google.maps.Marker({
position: {lat: 44.801800, lng: 20.463302},
map: map,
icon: image
});
map.mapTypes.set(customMapTypeId, customMapType);
map.setMapTypeId(customMapTypeId);
}