forked from googlemaps/js-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.njk
149 lines (130 loc) · 4.35 KB
/
index.njk
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
<!--
Copyright 2019 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta charset="utf-8"/>
<title>Google Maps JavaScript Samples</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
<style>
.is-sidebar-menu {
overflow-y: scroll;
}
.is-main-content,
body,
html,
iframe {
height: 100%;
width: 100%;
}
.is-full-height {
height: 100%;
}
@media only screen and (max-width: 600px) {
.is-sidebar-menu {
max-height: 250px;
}
}
.menu-list li ul {
transition: opacity 1s ease-out;
opacity: 0;
height: 0;
overflow: hidden;
margin: 0;
}
a.is-active + ul {
opacity: 1;
height: auto;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
}
</style>
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
{% include 'shared/analytics.njk' %}
</head>
<body>
<div class="columns has-text-centered is-paddingless is-marginless is-full-height">
<div class="column is-narrow is-sidebar-menu">
<h1 class="title">Google Maps<br/>JavaScript Samples</h1>
<aside class="menu has-text-left">
<p class="menu-label">Samples</p>
<ul class="menu-list">
{% for title, path in packages|dictsort %}
<li>
<a id="{{ path }}" onClick="setIframe('{{ path }}', '{{ title }}')">{{ title }}</a>
<ul>
<li>
<a href="https://github.com/googlemaps/js-samples/tree/master/samples/{{ path }}/src" target="_blank">
<i class="fab fa-github"></i>
View Source</a>
</li>
<li>
<a href="https://github.com/googlemaps/js-samples/issues/new?assignees=&labels=type%3A+bug%2C+triage+me&template=bug_report.md&title={{ '[sample] '|urlencode }}{{ title|urlencode}}" target="_blank">
<i class="fas fa-bug"></i>
Report Bug</a>
</li>
<li>
<a href="./samples/{{ path }}/index.html" target="_blank">
<i class="fas fa-external-link-alt"></i>
Open in New Window</a>
</li>
</ul>
</li>
{% endfor %}
</ul>
<p class="menu-label">Links </p>
<ul class="menu-list">
<li>
<a href="https://developers.google.com/maps/documentation/javascript/tutorial">Documentation</a>
</li>
<li>
<a href="https://github.com/googlemaps/js-samples">Github</a>
</li>
</ul>
</aside>
</div>
<div class="column is-main-content is-paddingless">
<iframe id="iframe"></iframe>
</div>
</div>
</div>
<script>
let active = "";
function setIframe(package, title) {
if (active === package) {
return
}
const iframe = document.getElementById('iframe');
iframe.src = "./samples/" + package + "/index.html";
iframe.setAttribute('title', `Map Sample: ${title}`);
const previous = document.getElementById(active)
if (previous) {
previous
.classList
.remove("is-active");
}
const current = document.getElementById(package)
current
.classList
.add("is-active");
active = package;
}
// initialize
setIframe("aerial-simple", "45° Imagery");
</script>
</body>
</html>