Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorighi committed May 16, 2022
1 parent cdc3dc5 commit 3ec435d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
18 changes: 10 additions & 8 deletions client/src/components/base/MapContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ export default {
updateSource(geojson) {
const view = this.olMap.getView()
const source = this.vectorLayer.getSource()
const features = new GeoJSON({
const features = geojson ? new GeoJSON({
featureProjection: 'EPSG:3857',
}).readFeatures(geojson)
}).readFeatures(geojson) : null
source.clear();
source.addFeatures(features);
if(features){
source.addFeatures(features);
// this zooms the view on the created object
view.fit(source.getExtent(), {
size: this.olMap.getSize(),
maxZoom: 4
});
}
// this zooms the view on the created object
view.fit(source.getExtent(), {
size: this.olMap.getSize(),
maxZoom: 4
});
},
closePopup(){
this.overlay.setPosition(undefined)
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/organism/OrganismsComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<b-dropdown-item :disabled="selectedOrganisms.lenght === 0" @click="deleteOrganisms(selectedOrganisms)" variant="danger">Delete selected organisms</b-dropdown-item>
</b-dropdown>
</template>
<template v-if="bioprojects.lenght" #cell(bioprojects)="data">
<template #cell(bioprojects)="data">
<b-link target="_blank" v-for="bioproject in data.item.bioprojects" :key="bioproject" :href="'https://www.ebi.ac.uk/ena/browser/view/'+bioproject">
{{bioproject}}
</b-link>
Expand Down
3 changes: 3 additions & 0 deletions client/src/views/MapPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export default {
if(resp && resp.data){
this.geoJson = resp.data
}
else{
this.geoJson = null
}
this.$store.dispatch('portal/hideLoading')
})
.catch(e=>{
Expand Down

0 comments on commit 3ec435d

Please sign in to comment.