This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
383 lines (348 loc) · 10.4 KB
/
index.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Web Google Maps</title>
<meta name="description" content="A Web Component to easily integrate Google Maps in your application">
<meta name="author" content="David Dal Busco">
<script type="module" src="build/webgooglemaps.esm.js"></script>
<script nomodule src="build/webgooglemaps.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Bootstrap -->
<style>
:root {
--jumbotron-padding-y: 3rem;
}
.jumbotron {
padding-top: var(--jumbotron-padding-y);
padding-bottom: var(--jumbotron-padding-y);
margin-bottom: 0;
background-color: #fff;
}
.jumbotron p:last-child {
margin-bottom: 0;
}
.jumbotron-heading {
font-weight: 300;
}
.jumbotron .container {
max-width: 40rem;
}
footer {
padding-top: 2rem;
padding-bottom: 1rem;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
</style>
</head>
<body>
<header>
<div class="collapse bg-dark" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-7 py-4">
<h4 class="text-white">About</h4>
<p class="text-muted">The goal of this project is to provide an agnostic Web Component to easily integrate
Google Maps into my project <a href="https://fluster.io"
class="text-white">Fluster</a>. This web component is published on
<a href="https://github.com/fluster/web-google-maps" class="text-white">Github</a> under license
MIT © <a href="mailto:[email protected]" class="text-white">David Dal Busco</a></p>
</div>
<div class="col-sm-4 offset-md-1 py-4">
<h4 class="text-white">Contact</h4>
<ul class="list-unstyled">
<li><a href="https://github.com/fluster/web-google-maps" class="text-white">Github</a></li>
<li><a href="http://twitter.com/daviddalbusco" class="text-white">Twitter</a></li>
<li><a href="mailto:[email protected]" class="text-white">Email me</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="navbar navbar-dark bg-dark box-shadow">
<div class="container d-flex justify-content-between">
<a href="#" class="navbar-brand d-flex align-items-center">
<strong>Web Google Maps</strong>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader"
aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</header>
<main role="main">
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">Web Google Maps</h1>
<p class="lead text-muted">Web Google Maps is a Web Component which lets you easily integrate Google Maps in your
application. The component could be embedded in the most popular frontend frameworks</p>
<p>
<a href="https://github.com/fluster/web-google-maps" class="btn btn-dark my-2"><i class="fab fa-github"></i>
Github</a>
</p>
</div>
</section>
<!-- Showcase -->
<div class="album py-5 bg-light">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="text-center mb-4">Showcase</h2>
</div>
<div class="col-md-6 mt-6">
<div class="card mb-4 box-shadow">
<div class="card-top">
<web-google-maps lat="47.36667" lng="8.55"></web-google-maps>
</div>
<div class="card-body">
<p class="card-text">Styles and Circles</p>
<p class="collapse card-text" id="demo-nofilter">
<code>
<web-google-maps lat="47.36667" lng="8.55" [mapStyle]="myStyle" [circles]="myCircles"></web-google-maps>
</code>
</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" data-toggle="collapse" data-target="#demo-nofilter"
class="btn btn-sm btn-outline-primary">View code
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 mt-6">
<div class="card mb-4 box-shadow">
<div class="card-top">
<web-google-maps lat="43.073051" lng="-89.401230"></web-google-maps>
</div>
<div class="card-body">
<p class="card-text">Markers and Info Windows</p>
<p class="collapse card-text" id="demo-sepia">
<code>
<web-google-maps lat="47.36667" lng="8.55" [markers]="myMarkers"></web-google-maps>
</code>
</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" data-toggle="collapse" data-target="#demo-sepia"
class="btn btn-sm btn-outline-primary">View code
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="text-muted">
<div class="container">
<p class="float-right">
<a href="#">Back to top</a>
</p>
<p>License MIT © <a href="mailto:[email protected]">David Dal Busco</a></p>
</div>
</footer>
<script type="text/javascript">
const mapStyle = {
styles: [
{
"featureType": "road",
"stylers": [
{
"hue": "#5e00ff"
},
{
"saturation": -79
}
]
},
{
"featureType": "poi",
"stylers": [
{
"saturation": -78
},
{
"hue": "#6600ff"
},
{
"lightness": -47
},
{
"visibility": "off"
}
]
},
{
"featureType": "road.local",
"stylers": [
{
"lightness": 22
}
]
},
{
"featureType": "landscape",
"stylers": [
{
"hue": "#6600ff"
},
{
"saturation": -11
}
]
},
{},
{},
{
"featureType": "water",
"stylers": [
{
"saturation": -65
},
{
"hue": "#1900ff"
},
{
"lightness": 8
}
]
},
{
"featureType": "road.local",
"stylers": [
{
"weight": 1.3
},
{
"lightness": 30
}
]
},
{
"featureType": "transit",
"stylers": [
{
"visibility": "simplified"
},
{
"hue": "#5e00ff"
},
{
"saturation": -16
}
]
},
{
"featureType": "transit.line",
"stylers": [
{
"saturation": -72
}
]
},
{}
],
name: "Purple Rain"
};
const circles = [
{
lat: 47.46667,
lng: 8.55,
radius: 10000,
fillColor: '#ff8ea3',
draggable: false,
editable: false,
clickable: false
},
{
lat: 47.56667,
lng: 8.75,
radius: 5000,
fillColor: '#ff65a9',
draggable: false,
editable: false,
clickable: false
}
];
const markers = [{
lat: 43.073051,
lng: -89.401230,
icon: 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png',
infoWindowOptions: {
content: "Cool"
}
},
{
lat: 43.075051,
lng: -86.425230,
icon: 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png',
infoWindowOptions: {
content: "Cool cool cool"
}
},
{
lat: 42.173051,
lng: -89.501230,
icon: 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png',
infoWindowOptions: {
content: "All good?"
}
},
{
lat: 43.373051,
lng: -88.401230,
icon: 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png',
infoWindowOptions: {
content: "Hello, what's up?"
}
}];
const firstMapOptions = {
zoom: 9
};
const secondMapOptions = {
streetViewControl: true,
fullscreenControl: true
};
document.addEventListener("DOMContentLoaded", function (event) {
const elem = document.getElementsByTagName('web-google-maps');
if (elem && elem.length > 0) {
for (let i = 0; i < elem.length; i++) {
elem[i].apiKey = 'INJECT_YOUR_GOOGLE_MAPS_API_KEY_HERE';
}
elem[0].options = firstMapOptions;
elem[0].mapStyle = mapStyle;
elem[0].circles = circles;
if (elem.length > 1) {
elem[1].options = secondMapOptions;
elem[1].markers = {
markers: markers,
fitBounds: true
};
}
}
});
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.4.1/js/all.js"
integrity="sha384-L469/ELG4Bg9sDQbl0hvjMq8pOcqFgkSpwhwnslzvVVGpDjYJ6wJJyYjvG3u8XW7"
crossorigin="anonymous"></script>
</body>
</html>