Skip to content

Commit 3f3c48c

Browse files
committed
remove mapillary
add boat pitch slider background
1 parent 26aa8cd commit 3f3c48c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

pages/index.vue

+6-10
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@
5050
<div ref="styleSwitcher">
5151
<style-switcher @changed="styleChanged" />
5252
</div>
53-
<div ref="mapillary" class="mapboxgl-ctrl" style="width: 256px; height: 192px">
54-
<span style="position: absolute; z-index: 2; left: 50%; background: white; padding-left: 5px; padding-right: 5px">
55-
<a style="color: black" target="_blank" :href="`https://www.mapillary.com/app/?pKey=${imgId}`">{{ imgTime }}</a>
56-
</span>
57-
<div ref="mapillaryViewer" style="width: 100%; height: 100%" />
58-
</div>
5953
<canvas ref="sliderLine" style="position: absolute; left:-100000px" height="40" width="10000" />
6054
</div>
6155
</template>
@@ -100,6 +94,7 @@ export default {
10094
components: { Speedometer, Loading, StyleSwitcher },
10195
data () {
10296
return {
97+
pitch: 30,
10398
imgId: 0,
10499
imgTime: '',
105100
imgSrc: '',
@@ -208,7 +203,7 @@ export default {
208203
if (this.path && this.path.length) {
209204
map.getSource('route').setData(lineString(this.path))
210205
const bounds = bbox(points(this.path))
211-
map.fitBounds(bounds, { padding: boundsPadding })
206+
map.fitBounds(bounds, { padding: boundsPadding, maxZoom: 15, pitch: this.pitch })
212207
this.updateSliderBackground()
213208
this.$refs.noUiSlider.noUiSlider.updateOptions({
214209
range: {
@@ -331,10 +326,11 @@ export default {
331326
new ResizeObserver(this.updateSliderBackground).observe(this.$refs.noUiSlider)
332327
this.loading = true
333328
map = new mapboxgl.Map({
334-
container: 'map', // container ID
329+
container: 'map',
335330
style: 'mapbox://styles/mapbox/streets-v12', // style URL
336331
zoom: localStorage.getItem('zoom'),
337-
center: localStorage.getItem('center') ? JSON.parse(localStorage.getItem('center')) : [0, 0]
332+
center: localStorage.getItem('center') ? JSON.parse(localStorage.getItem('center')) : [0, 0],
333+
pitch: this.pitch
338334
})
339335
map.on('moveend', () => {
340336
localStorage.setItem('center', JSON.stringify(map.getCenter()))
@@ -580,7 +576,7 @@ export default {
580576
}
581577
.noUi-horizontal .noUi-tooltip {bottom: -150%;}
582578
.noUi-connect {
583-
background: rgba(0,0,0,0.4);
579+
background: rgba(0,0,0,0.3);
584580
}
585581
.noUi-pips {
586582
position: absolute;

static/models/boat.glb

391 KB
Binary file not shown.

utils/models3d.js

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ export function get3dModel (category) {
55
sizeScale: 50,
66
getOrientation: d => [0, -d.heading, 90],
77
sizeMinPixels: 20
8+
},
9+
boat: {
10+
sizeScale: 1,
11+
sizeMinPixels: 1.5,
12+
scenegraph: 'models/boat.glb',
13+
getOrientation: d => [0, 180 - d.heading, 90]
814
}
915
}[category] || {
1016
scenegraph: 'models/truck.gltf',

0 commit comments

Comments
 (0)