|
50 | 50 | <div ref="styleSwitcher">
|
51 | 51 | <style-switcher @changed="styleChanged" />
|
52 | 52 | </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> |
59 | 53 | <canvas ref="sliderLine" style="position: absolute; left:-100000px" height="40" width="10000" />
|
60 | 54 | </div>
|
61 | 55 | </template>
|
@@ -100,6 +94,7 @@ export default {
|
100 | 94 | components: { Speedometer, Loading, StyleSwitcher },
|
101 | 95 | data () {
|
102 | 96 | return {
|
| 97 | + pitch: 30, |
103 | 98 | imgId: 0,
|
104 | 99 | imgTime: '',
|
105 | 100 | imgSrc: '',
|
@@ -208,7 +203,7 @@ export default {
|
208 | 203 | if (this.path && this.path.length) {
|
209 | 204 | map.getSource('route').setData(lineString(this.path))
|
210 | 205 | const bounds = bbox(points(this.path))
|
211 |
| - map.fitBounds(bounds, { padding: boundsPadding }) |
| 206 | + map.fitBounds(bounds, { padding: boundsPadding, maxZoom: 15, pitch: this.pitch }) |
212 | 207 | this.updateSliderBackground()
|
213 | 208 | this.$refs.noUiSlider.noUiSlider.updateOptions({
|
214 | 209 | range: {
|
@@ -331,10 +326,11 @@ export default {
|
331 | 326 | new ResizeObserver(this.updateSliderBackground).observe(this.$refs.noUiSlider)
|
332 | 327 | this.loading = true
|
333 | 328 | map = new mapboxgl.Map({
|
334 |
| - container: 'map', // container ID |
| 329 | + container: 'map', |
335 | 330 | style: 'mapbox://styles/mapbox/streets-v12', // style URL
|
336 | 331 | 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 |
338 | 334 | })
|
339 | 335 | map.on('moveend', () => {
|
340 | 336 | localStorage.setItem('center', JSON.stringify(map.getCenter()))
|
@@ -580,7 +576,7 @@ export default {
|
580 | 576 | }
|
581 | 577 | .noUi-horizontal .noUi-tooltip {bottom: -150%;}
|
582 | 578 | .noUi-connect {
|
583 |
| - background: rgba(0,0,0,0.4); |
| 579 | + background: rgba(0,0,0,0.3); |
584 | 580 | }
|
585 | 581 | .noUi-pips {
|
586 | 582 | position: absolute;
|
|
0 commit comments