-
Notifications
You must be signed in to change notification settings - Fork 22
/
32-google-map-point-simple.html
92 lines (77 loc) · 1.83 KB
/
32-google-map-point-simple.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#map {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="//maps.googleapis.com/maps/api/js?key=AIzaSyDgF_xU8tLp-GwUUlKWa8iTSqOhN1ff7Mg"></script>
<script type="text/javascript" src="../../js/mapv.js"></script>
<script type="text/javascript">
var customMapType = new google.maps.StyledMapType([
{
stylers: [
{hue: '#890000'},
{visibility: 'simplified'},
{gamma: 0.5},
{weight: 0.5}
]
},
{
elementType: 'labels',
stylers: [{visibility: 'off'}]
},
{
featureType: 'water',
stylers: [{color: '#890000'}]
}
], {
name: 'Custom Style'
});
var customMapTypeId = 'custom_style';
// Create a map object and specify the DOM element for display.
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(39.3, -95.8),
scrollwheel: false,
zoom: 4
});
map.mapTypes.set(customMapTypeId, customMapType);
map.setMapTypeId(customMapTypeId);
var resolutionScale = window.devicePixelRatio || 1;
var randomCount = 500;
var data = [];
while (randomCount--) {
data.push({
geometry: {
type: 'Point',
coordinates: [-125.8 + Math.random() * 50, 30.3 + Math.random() * 20]
},
count: 30 * Math.random()
});
}
var dataSet = new mapv.DataSet(data);
var options = {
fillStyle: 'rgba(255, 250, 50, 0.7)',
shadowColor: 'rgba(255, 255, 50, 1)',
shadowBlur: 10,
size: 3,
draw: 'simple'
}
var mapvLayer = new mapv.googleMapLayer(map, dataSet, options);
</script>
</body>
</html>