This repository was archived by the owner on Jul 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathexamples.js
105 lines (101 loc) · 2.06 KB
/
examples.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
$(function()
{
$('#map').gMap();
$('#map_controls').gMap(
{
latitude: -2.206,
longitude: -79.897,
maptype: 'TERRAIN', // 'HYBRID', 'SATELLITE', 'ROADMAP' or 'TERRAIN'
zoom: 8,
controls: {
panControl: true,
zoomControl: false,
mapTypeControl: true,
scaleControl: false,
streetViewControl: false,
overviewMapControl: false
}
});
$('#map_addresses').gMap({
address: "Quito, Ecuador",
zoom: 5,
markers:[
{
latitude: -2.2014,
longitude: -80.9763,
html: "_latlng"
},
{
address: "Guayaquil, Ecuador",
html: "My Hometown",
popup: true
},
{
address: "Galapagos, Ecuador",
html: "_address"
}
]
});
$("#map_extended").gMap({
controls: false,
scrollwheel: true,
maptype: 'TERRAIN',
markers: [
{
latitude: 47.670553,
longitude: 9.588479,
icon: {
image: "images/gmap_pin_orange.png",
iconsize: [26, 46],
iconanchor: [12,46]
}
},
{
latitude: 47.65197522925437,
longitude: 9.47845458984375
},
{
latitude: 47.594996,
longitude: 9.600708,
icon: {
image: "images/gmap_pin_grey.png",
iconsize: [26, 46],
iconanchor: [12,46]
}
}
],
icon: {
image: "images/gmap_pin.png",
iconsize: [26, 46],
iconanchor: [12, 46]
},
latitude: 47.58969,
longitude: 9.473413,
zoom: 10
});
// Detect user location
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position)
{
$('#map_controls').gMap('addMarker', {
latitude: position.coords.latitude,
longitude: position.coords.longitude,
content: 'You are here!',
icon: {
image: "images/gmap_pin.png",
iconsize: [26, 46],
iconanchor: [12, 46]
},
popup: true
});
$('#map_controls').gMap('centerAt', {
latitude: position.coords.latitude,
longitude: position.coords.longitude,
zoom: 8
});
}, function()
{
//console.log('Couldn\'t find you :(');
});
}
});