diff --git a/src/views/admin/components/lists/items-list.vue b/src/views/admin/components/lists/items-list.vue index a3f546d72..18f493d8a 100644 --- a/src/views/admin/components/lists/items-list.vue +++ b/src/views/admin/components/lists/items-list.vue @@ -1366,13 +1366,13 @@ :lat-lng="itemLocation.location" :opacity="selectedMarkerIndexes.length > 0 && !selectedMarkerIndexes.includes(index) ? 0.35 : 1.0" @click="showItemByLocation(index)"> - - - + + + @@ -1491,7 +1491,8 @@ class="actions-area" :label="$i18n.get('label_actions')"> aMetadatum['display'] && aMetadatum['metadata_type'] == 'Tainacan\\Metadata_Types\\GeoCoordinate') : []; + let geocoordinateMetadata = []; + + this.displayedMetadata.forEach((aMetadatum) => { + + if ( aMetadatum['display'] && aMetadatum['metadata_type'] == 'Tainacan\\Metadata_Types\\GeoCoordinate' ) + geocoordinateMetadata.push(aMetadatum); + + if ( aMetadatum['display'] && aMetadatum['metadata_type'] == 'Tainacan\\Metadata_Types\\Compound' && + aMetadatum['metadata_type_options']['children_objects'] && aMetadatum['metadata_type_options']['children_objects'].length + ) { + for ( let i = 0; i < aMetadatum['metadata_type_options']['children_objects'].length; i++ ) + if ( aMetadatum['metadata_type_options']['children_objects'][i]['metadata_type'] == 'Tainacan\\Metadata_Types\\GeoCoordinate' ) + geocoordinateMetadata.push(aMetadatum['metadata_type_options']['children_objects'][i]); + } + }); + + return geocoordinateMetadata; } }, watch: { @@ -1812,6 +1829,13 @@ export default { this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true }); } }, 500) + }, + geocoordinateMetadata: { + handler() { + if ( this.geocoordinateMetadata.length > 0 ) + this.selectedGeocoordinateMetadatum = this.geocoordinateMetadata[0].slug; + }, + immediate: true } }, mounted() {