Skip to content

Commit

Permalink
feat: add contrib mode to list #142
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Feb 13, 2024
1 parent d4b6283 commit 4d9a1df
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/Fields/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ export default defineNuxtComponent({
{{ $t('fields.osm_note') }}
</ExternalLink>

<ExternalLink
v-else-if="field.field === 'mapillary_link'"
:href="properties[field.field]"
target="_blank"
>
{{ $t('poiDetails.mapillaryExplore') }}
</ExternalLink>

<div
v-for="item in properties[field.field]"
v-else-if="field.field === 'download'"
Expand Down
17 changes: 17 additions & 0 deletions pages/category/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@ export default defineNuxtComponent({
mounted() {
this.locale = this.$i18n.locale
if (siteStore().contribMode) {
this.pois.features.map((poi) => {
const { coordinates } = poi.geometry as GeoJSON.Point
if (poi.properties.metadata.osm_id && poi.properties.metadata.osm_type) {
if (poi.properties.mapillary) {
poi.properties.mapillary_link = `https://www.mapillary.com/app/?pKey=${poi.properties.mapillary}&focus=photo`
poi.properties.editorial?.list_fields?.push({ field: 'mapillary_link' })
}
poi.properties.editor_id = `https://www.openstreetmap.org/edit?node=${poi.properties.metadata.osm_id}`
poi.properties.osm_note = `https://www.openstreetmap.org/note/new#map=19/${coordinates[1]}/${coordinates[0]}&layers=N`
poi.properties.editorial?.list_fields?.push({ field: 'editor_id' }, { field: 'osm_note' }, { field: 'mapillary_link' })
}
return poi
})
}
this.handleCategoryUpdate(useRoute().params.id as string)
},
methods: {
Expand Down

0 comments on commit 4d9a1df

Please sign in to comment.