forked from sysoppl/Cities-Skylines-heightmap-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
213 lines (205 loc) · 12.9 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Heightmap Generator</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/destyle.css@1.0.15/destyle.css"/>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js'></script>
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.css'/>
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.4.2/mapbox-gl-geocoder.min.js"></script>
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.4.2/mapbox-gl-geocoder.css" type="text/css" />
<script src="https://kit.fontawesome.com/9051d1b58c.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body class="row">
<div class="sideBar column">
<ul>
<li><a onclick="togglePanel(0)" title="Settings"><i class="icon fas fa-info-circle"></i></a></li>
<li><a onclick="togglePanel(1)" title="Change map style"><i class="icon fas fa-layer-group"></i></a></li>
<li><a onclick="togglePanel(2)" title="Set lng/lat"><i class="icon fas fa-map-marker-alt"></i></a></li>
</ul>
<ul class="fill">
<li><a onclick="getHeightmap(0)" title="Download RAW height map"><i class="fas fa-file-download"></i></a></li>
<li><a onclick="getHeightmap(1)" title="Download PNG height map"><i class="fas fa-file-image"></i></a></li>
<li><a onclick="getMapImage()" title="Download map image"><i class="fas fa-map"></i></a></li>
<li><a onclick="getHeightmap(3)" title="Download ZIP with PNG and lng/lat informations"><i class="fas fa-file-archive"></i></a></li>
<li><a onclick="getOSMData()" title="Download OSM map (long wait)"><i class="fas fa-road"></i></a></li>
</ul>
<ul class="fill">
<li><a onclick="showHeightContours(this)" title="Show height contours" id="showHeightContours"><i class="fas fa-mountain"></i></a></li>
<li><a onclick="showWaterContours(this)" title="Show water contours" id="showWaterContours"><i class="fas fa-water"></i></a></li>
</ul>
<ul class="fill" id="dcBox">
<li><a onclick="deleteCaches()" title="Delete caches" id="deleteCaches"><i class="fas fa-database"></i><i class="fas fa-times"></i></a></li>
</ul>
<ul>
<li><a onclick="zoomIn()" title="Zoom in"><i class="fas fa-search-plus"></i></a></li>
<li><a onclick="zoomOut()" title="Zoom out"><i class="fas fa-search-minus"></i></a></li>
</ul>
<ul>
<li><a href="#" onclick="getHeightmap(255)" title="Dwnload tiles map (Terrain-RGB)"><i class="fas fa-bug"></i></a></li>
</ul>
</div>
<div class="fill wrapper">
<div id="map" class="content"></div>
<canvas id="wMap-canvas" width="400" height="400" ></canvas> <!-- for debug -->
<div id="infoPanel" class="panel slide-out hidden">
<div id="geocoder" class="geocoder"></div>
<div class="infotable">
<div class="info">
<dl class="lnglat">
<div><dt>Longitude:</dt><dd class="unit" id="lng"></dd><dd><abbr>°</abbr></dd></div>
<div><dt>Latitude:</dt><dd class="unit" id="lat"></dd><dd><abbr>°</abbr></dd></div>
</dl>
<dl class="height">
<div><dt>Min. height:</dt><dd class="unit" id="minh"></dd><dd><abbr>m</abbr></dd></div>
<div><dt>Max. height:</dt><dd class="unit" id="maxh"></dd><dd><abbr>m</abbr></dd></div>
</dl>
</div>
<div class="settings">
<header><h4>Size and scale</h4><hr></header>
<dl>
<dt>Map size:</dt>
<dd><input type="range" data-model="mapSize" min="6.65" max="69.12" step="0.01" id="mapSize"
onkeyup="changeMapsize(this)" onmouseup="changeMapsize(this)"></dd>
<dd><input type="number" data-model="mapSize" min="6.65" max="69.12" step="0.01"
onkeyup="changeMapsize(this)" onmouseup="changeMapsize(this)"></dd>
<dd><abbr>km</abbr></dd>
<dt>Base level:</dt>
<dd><input type="range" data-model="baseLevel" min="-1023.9" max="1023.9" step="0.1" id="baseLevel"></dd>
<dd><input type="number" data-model="baseLevel" min="-1023.9" max="1023.9" step="0.1"></dd>
<dd><abbr>m</abbr></dd>
<dd><button class="calc" onclick="setBaseLevel()"
title="Set to the same value as Min. height"><i class="fas fa-calculator"></i></button></dd>
<dt>Height scale:</dt>
<dd><input type="range" data-model="heightScale" min="0" max="500" step="1" id="heightScale"></dd>
<dd><input type="number" data-model="heightScale" step="1"></dd>
<dd><abbr>%</abbr></dd>
<dd><button class="calc" onclick="setHeightScale()"
title="Set to the maximum scale possible with the current settings"><i class="fas fa-calculator"></i></button></dd>
<dt class="withUnit">Reference height scale:</dt>
<dd class="unit2" id="rHeightscale">100.0</dd>
<dd><abbr>%</abbr></dd>
</dl>
<header><h4>Water area</h4><hr></header>
<dl>
<dt>Water depth:</dt>
<dd><input type="range" data-model="waterDepth" min="0" max="60" step="1" id="waterDepth"></dd>
<dd><input type="number" data-model="waterDepth" min="0" max="60" step="1"></dd>
<dd><abbr>m</abbr></dd>
<dt>Center of gravity:</dt>
<dd class="wsSlp">
<select data-model="gravityCenter">
<option value="0">None</option>
<option value="1">Center</option>
<option value="2">North center</option>
<option value="10">North side</option>
<option value="3">North-East</option>
<option value="4">East center</option>
<option value="11">East side</option>
<option value="5">South-East</option>
<option value="6">South center</option>
<option value="12">South side</option>
<option value="7">South-West</option>
<option value="8">West center</option>
<option value="13">West side</option>
<option value="9">North-West</option>
</select><i class="fas fa-chevron-down"></i>
</dd>
<dd>@ </dd>
<dd><input type="number" min="0" max="250" step="1" id="tiltHeight"></dd>
<dd><abbr>m</abbr></dd>
<dt class="withCb">Streams:</dt>
<dd><input type="checkbox" id="drawStrm"><i class="fas fa-check"></i></dd>
</dl>
<header><h4>Draw options</h4><hr></header>
<dl>
<dt class="withCb">Marker: </dt>
<dd><input type="checkbox" id="drawMarker"><i class="fas fa-check"></i></dd>
<dt></dt>
<dt class="withCb">Grid: </dt>
<dd><input type="checkbox" id="drawGrid"><i class="fas fa-check"></i></dd>
</dl>
<header><h4>Smoothing & leveling</h4><hr></header>
<div class="row">
<div>
<div class="vertinput">To (m)</div>
<div><dd><input type="number" min="0" max="250" step="10" id="plainsHeight"></dd></div>
</div>
<div>
<div class="vertinput">Passes</div>
<div><dd><input type="number" min="0" max="25" step="1" id="blurPasses"></dd></div>
</div>
<div>
<div class="vertinput">Post pas.</div>
<div><dd><input type="number" min="0" max="10" step="1" id="blurPostPasses"></dd></div>
</div>
<div>
<div class="vertinput">Stream depth</div>
<div><dd><input type="number" min="0" max="10" step="1" id="streamDepth"></dd></div>
</div>
</div>
<br>
<div class="row">
<dl>
<dt>Level correction:</dt>
<dd class="wsSlp wideSelect">
<select data-model="levelCorrection">
<option value="0">None</option>
<option value="1">Testing</option>
<option value="2">Coastline & plains</option>
<option value="3">Agressive coast & plains</option>
<option value="9">Plains & dramatic mountains</option>
</select><i class="fas fa-chevron-down"></i>
</dd>
<dd> </dd>
</dl>
</div>
</div>
</div>
<hr>
<div class="footer">
<progress id="progress" value="0" max="500"></progress>
<!-- <p class="fill"></p> -->
<button onclick="getHeightmap(2)"><i class="fas fa-sync-alt"></i>Refresh</button>
<button onclick="autoSettings()"><i class="fas fa-cog"></i>Auto</button>
</div>
</div>
<div id="stylePanel" class="panel slide-out hidden">
<h3>Map style:</h3>
<div id="mapstyle">
<label for="streets-v11"><input id="streets-v11" type="radio" name="msGroup" value="streets" onclick="setMapStyle(this)">Streets</label>
<label for="outdoors-v11"><input id="outdoors-v11" type="radio" name="msGroup" value="outdoors" onclick="setMapStyle(this)">Outdoors</label>
<label for="satellite-v9"><input id="satellite-v9" type="radio" name="msGroup" value="satellite" onclick="setMapStyle(this)">Satellite</label>
<label for="light-v10"><input id="light-v10" type="radio" name="msGroup" value="light" onclick="setMapStyle(this)">Light</label>
<label for="dark-v10"><input id="dark-v10" type="radio" name="msGroup" value="dark" onclick="setMapStyle(this)">Dark</label>
</div>
</div>
<div id="pinPanel" class="panel slide-out hidden">
<h3>Lng / Lat:</h3>
<dl>
<div><dt>Longitude:</dt><dd><input type="text" id="lngInput"></dd><dd><abbr>°</abbr></dd></div>
<div><dt>Latitude:</dt><dd><input type="text" id="latInput"></dd><dd><abbr>°</abbr></dd></div>
</dl>
<hr>
<div class="footer">
<p class="fill"></p>
<button onclick="setLngLat(0)" class="outline">Current pos.</button>
<button onclick="setLngLat(1)" class="outline">Clear</button>
<button onclick="setLngLat(2)"><i class="fas fa-check"></i>Apply</button>
</div>
</div>
</div>
<script src="lib.js"></script>
<script src="jszip.js"></script>
<script src="pako.min.js"></script>
<script src="upng.js"></script>
<script src='tiles.js'></script>
<script src="binding.js"></script>
<script src="app.js"></script>
</body>
</html>