-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
133 lines (116 loc) · 5.25 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" href=//carto.com/favicon.ico>
<title>Vue.js Intro - Step 8 - Events</title>
<!-- Airship CSS-->
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v1.0.3/airship.css">
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-icons/v1.0.3/icons.css">
<!-- Mapbox CSS -->
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<link href="https://carto.com/developers/carto-vl/examples/maps/style.css" rel="stylesheet">
<!-- Application CSS-->
<link rel="stylesheet" href="../common/styles.css">
</head>
<body class="as-app-body">
<div id="app" class="as-app">
<!-- Toolbar -->
<header class="as-toolbar">
<div class="as-toolbar__item">
<a href="https://carto.com">
<img alt="CARTO Logo" src="../common/logo-circle.svg"/>
</a>
</div>
<div class="as-toolbar__group">
<div class="as-toolbar__item">
<a v-bind:href="'../step_0' + (step - 1) + '/index.html'">prev</a>
</div>
<div class="as-toolbar__item">
<h3 class="as-title">Vue.js intro ({{ step }})</h3>
</div>
<div class="as-toolbar__item">
<a v-bind:href="'../step_0' + (step + 1) + '/index.html'">next</a>
</div>
</div>
<div class="as-toolbar__item">
<a href="https://github.com/CartoDB/labs_vuejs_intro">
<img alt="Github repo" src="../common/GitHub-Mark-Light-32px.png"/>
</a>
</div>
</header>
<!-- Content -->
<as-responsive-content>
<!-- Left Sidebar-->
<aside class="as-sidebar as-sidebar--left as-bg--ui-04" data-name="Widgets">
<div class="as-container as-container--border">
<section class="as-box">
<h3 class="as-subheader">Map</h3>
<ul class="as-body">
<li><span class="as-font--bold">Lng:</span> {{ formatNumber(longitude) }}</li>
<li><span class="as-font--bold">Lat:</span> {{ formatNumber(latitude) }}</li>
<li><span class="as-font--bold">Zoom:</span> {{ formatNumber(zoomLevel) }}
<span v-if="zooming == 0">➔</span>
<span v-else-if="zooming == -1">➘</span>
<span v-else>➚</span>
</li>
</ul>
</section>
<section class="as-box" v-bind:class="{ 'is-disabled': noCities }">
<h3 class="as-subheader">Number Places</h3>
<p class="as-title" v-if="totalCount == null">loading...</p>
<p class="as-title" v-else-if="totalCount>=0"> {{ formatNumber(totalCount) }}</p>
</section>
<section class="as-box" v-bind:class="{ 'is-disabled': noCities }">
<h3 class="as-subheader">Population</h3>
<p class="as-title" v-if="totalPop == null">loading...</p>
<p class="as-title" v-else-if="totalPop>=0"> {{ formatNumber(totalPop) }}</p>
</section>
<section class="as-box" v-bind:class="{ 'is-disabled': noCities }">
<h3 class="as-subheader">Population average</h3>
<p class="as-title" v-if="avgPop == null">N/A</p>
<p class="as-title" v-else-if="avgPop>=0"> {{ formatNumber(avgPop) }}</p>
</section>
</div>
</aside>
<!-- Right Sidebar-->
<aside class="as-sidebar as-sidebar--right as-bg--ui-04" data-name="Top places">
<div class="as-container as-container--border">
<section class="as-box" v-bind:class="{ 'is-disabled': noCities }">
<h3 class="as-subheader">Top {{topCitiesCount}} places</h3>
<p>
<span v-on:click="topCitiesCount++" class="as-badge">More</span>
<span v-on:click="topCitiesCount--" class="as-badge">Less</span>
</p>
<p class="as-title" v-if="noCities">loading...</p>
<table class="as-table as-table--stripped" v-else>
<tr><th>Name</th><th>Pop (max)</th></tr>
<tr v-for="place in topPlaces">
<td>{{ place.name }}</td>
<td style="text-align: right;">{{ formatNumber(place.pop_max) }}</td>
</tr>
</table>
</section>
</div>
</aside>
<!-- Main map area-->
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
</as-responsive-content>
</div>
<!-- Libraries -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://libs.cartocdn.com/airship-components/v1.0.3/airship.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.1.1/carto-vl.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<script src="../common/viz.js"></script>
<script src="./vue.js"></script>
<script src="./map.js"></script>
<script src="./main.js"></script>
</body>
</html>