Skip to content

Commit 0ccd6d2

Browse files
committed
feat(street): use imageProvider, process url, provide fallback for mapcomplete panoramax
1 parent 7ecbf69 commit 0ccd6d2

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/components/StreetProject.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ export default defineComponent({
173173
</project-info>
174174
</project-header>
175175
<street-project-task-panoramax
176-
v-if="project.tileServer?.name == 'panoramax'"
176+
v-if="project.imageProvider?.name == 'panoramax'"
177177
:taskId="taskId"
178-
:endpoint="project.tileServer?.url"
178+
:endpoint="(project.imageProvider?.url || '').replace(/\/$/, '') + '/api'"
179179
@dataloading="(e) => (isLoading = e)"
180180
@imageError="handleImageError()"
181181
style="position: relative; height: calc(100vh - 390px)"

src/components/StreetProjectTaskPanoramax.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import { defineComponent } from 'vue'
33
import '@panoramax/web-viewer/build/index.css'
44
import '@panoramax/web-viewer'
55
6+
const DEFAULT_ENDPOINT = 'https://api.panoramax.xyz/api'
7+
68
export default defineComponent({
79
props: {
810
containerId: {
911
type: String,
1012
default: 'panoramax',
1113
},
1214
taskId: { type: String, required: true },
13-
endpoint: { type: String, default: 'https://api.panoramax.xyz/api' },
15+
endpoint: { type: String, default: DEFAULT_ENDPOINT },
1416
},
1517
data() {
1618
return {
@@ -46,6 +48,11 @@ export default defineComponent({
4648
if (arrows) arrows.remove()
4749
},
4850
},
51+
computed: {
52+
defaultEndpoint() {
53+
return DEFAULT_ENDPOINT
54+
},
55+
},
4956
mounted() {
5057
this.initialiseViewer()
5158
this.moveViewer(this.taskId)
@@ -57,7 +64,7 @@ export default defineComponent({
5764
<v-container :id="`${containerId}`" class="ma-0 pa-0">
5865
<pnx-photo-viewer
5966
ref="viewer"
60-
:endpoint="endpoint"
67+
:endpoint="endpoint.includes('mapcomplete') ? defaultEndpoint : endpoint"
6168
widgets="false"
6269
url-parameters="false"
6370
keyboard-shortcuts="false"

src/components/StreetProjectTutorial.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ export default defineComponent({
218218
<v-row justify="center">
219219
<v-col>
220220
<street-project-task-panoramax
221-
v-if="taskId && tutorial && tutorial.tileServer?.name == 'panoramax'"
221+
v-if="taskId && tutorial && tutorial.imageProvider?.name == 'panoramax'"
222222
:key="taskId"
223223
:taskId="taskId"
224-
:endpoint="tutorial.tileServer?.url"
224+
:endpoint="(tutorial.imageProvider?.url || '').replace(/\/$/, '') + '/api'"
225225
:containerId="'panoramax_tutorial'"
226226
@dataloading="(e) => (isLoading = e)"
227227
style="position: relative; height: calc(70vh - 390px)"

0 commit comments

Comments
 (0)