-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from scaife-viewer/develop
Prepare for v2020-07-31-001 release
- Loading branch information
Showing
45 changed files
with
1,921 additions
and
695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[context."master".environment] | ||
VUE_APP_ATLAS_GRAPHQL_ENDPOINT = "https://explorehomer-atlas.scaife-viewer.org/graphql/" | ||
[context."feature/passage-metadata-improvements".environment] | ||
VUE_APP_ATLAS_GRAPHQL_ENDPOINT = "https://explorehomer-feature-pa-bpryib.herokuapp.com/graphql/" | ||
[context."spike-apollo".environment] | ||
VUE_APP_ATLAS_GRAPHQL_ENDPOINT = "https://explorehomer-perf-dl-xxvzwupn7.herokuapp.com/graphql/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<template> | ||
<MglMap | ||
:zoom="10" | ||
:accessToken="accessToken" | ||
:mapStyle="mapStyle" | ||
:center="center" | ||
@load="onMapLoaded" | ||
> | ||
<EntityMapMarker | ||
v-for="(coordinates, idx) in coordinatesList" | ||
:key="getMarkerKey(coordinates[2], idx)" | ||
:lat="coordinates[0]" | ||
:lng="coordinates[1]" | ||
:placeId="coordinates[2]" | ||
:placeLabel="coordinates[3]" | ||
/> | ||
<MglNavigationControl position="top-right" /> | ||
</MglMap> | ||
</template> | ||
|
||
<script> | ||
import Mapbox from 'mapbox-gl'; | ||
import { MglMap, MglNavigationControl } from 'vue-mapbox'; | ||
import EntityMapMarker from './EntityMapMarker.vue'; | ||
export default { | ||
props: ['coordinatesList', 'selectedPlace'], | ||
components: { | ||
MglMap, | ||
MglNavigationControl, | ||
EntityMapMarker, | ||
}, | ||
created() { | ||
this.map = null; | ||
this.mapbox = Mapbox; | ||
}, | ||
methods: { | ||
onMapLoaded(event) { | ||
this.map = event.map; | ||
if (this.coordinatesList.length > 1) { | ||
const bbox = this.coordinatesList.map(c => { | ||
return [c[0], c[1]]; | ||
}); | ||
this.map.fitBounds(bbox); | ||
} | ||
}, | ||
getMarkerKey(entityId, idx) { | ||
// constructs a key that will be recomputed | ||
// when the value of `selectedNamedEntities` changes in the store | ||
const isSelected = | ||
this.selectedEntities.filter(id => entityId === id).length > 0; | ||
return `${entityId}::${idx}::${isSelected}`; | ||
}, | ||
}, | ||
watch: { | ||
coordinatesList: { | ||
immediate: true, | ||
handler() { | ||
this.$nextTick(() => { | ||
if (this.map !== null) { | ||
if (this.coordinatesList.length > 1) { | ||
this.map.fitBounds(this.coordinatesList); | ||
} else { | ||
this.map.setCenter(this.coordinatesList[0]); | ||
} | ||
} | ||
}); | ||
}, | ||
}, | ||
}, | ||
computed: { | ||
center() { | ||
return [this.coordinatesList[0][0], this.coordinatesList[0][1]]; | ||
}, | ||
config() { | ||
return this.$scaife.config.entityMap; | ||
}, | ||
accessToken() { | ||
return this.config.accessToken; | ||
}, | ||
mapStyle() { | ||
return this.config.mapStyle; | ||
}, | ||
selectedEntities() { | ||
return this.$store.state.selectedNamedEntities; | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<MglMarker ref="marker" :coordinates="[lat, lng]" @click="onMarkerClick"> | ||
<MglPopup | ||
ref="popup" | ||
:showed="selected" | ||
:closeButton="false" | ||
:closeOnClick="false" | ||
> | ||
<div class="label">{{ placeLabel }}</div> | ||
</MglPopup> | ||
</MglMarker> | ||
</template> | ||
|
||
<script> | ||
import { MglMarker, MglPopup } from 'vue-mapbox'; | ||
import { SELECT_NAMED_ENTITIES } from '../constants'; | ||
export default { | ||
components: { MglMarker, MglPopup }, | ||
props: { | ||
lat: Number, | ||
lng: Number, | ||
placeId: String, | ||
placeLabel: String, | ||
}, | ||
methods: { | ||
onMarkerClick() { | ||
if (!this.selected) { | ||
this.$store.dispatch(SELECT_NAMED_ENTITIES, { | ||
entities: [this.placeId], | ||
}); | ||
} | ||
}, | ||
}, | ||
computed: { | ||
selected() { | ||
return ( | ||
this.selectedEntities.filter(id => this.placeId === id).length > 0 | ||
); | ||
}, | ||
selectedEntities() { | ||
return this.$store.state.selectedNamedEntities; | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<template> | ||
<div class="entity-map-toolbar"> | ||
<a href :class="{ active: noMap }" @click.prevent="onNone"> | ||
<icon name="align-left" /> | ||
</a> | ||
<a href :class="{ active: showVertical }" @click.prevent="onVertical"> | ||
<icon name="grip-lines" /> | ||
</a> | ||
<a href :class="{ active: showHorizontal }" @click.prevent="onHorizontal"> | ||
<icon name="grip-lines-vertical" /> | ||
</a> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { | ||
MAP_STATE_HORIZONTAL, | ||
MAP_STATE_VERTICAL, | ||
MAP_STATE_NONE, | ||
} from '@/constants'; | ||
export default { | ||
props: ['mapState'], | ||
methods: { | ||
onNone() { | ||
this.$emit('show', MAP_STATE_NONE); | ||
}, | ||
onVertical() { | ||
this.$emit('show', MAP_STATE_VERTICAL); | ||
}, | ||
onHorizontal() { | ||
this.$emit('show', MAP_STATE_HORIZONTAL); | ||
}, | ||
}, | ||
computed: { | ||
noMap() { | ||
return this.mapState === MAP_STATE_NONE; | ||
}, | ||
showHorizontal() { | ||
return this.mapState === MAP_STATE_HORIZONTAL; | ||
}, | ||
showVertical() { | ||
return this.mapState === MAP_STATE_VERTICAL; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.entity-map-toolbar { | ||
display: flex; | ||
padding-bottom: 0.75rem; | ||
a { | ||
margin: 0 0.5rem; | ||
padding: 0.25rem; | ||
border-radius: 3px; | ||
border: 1px solid transparent; | ||
} | ||
a:hover { | ||
border-color: $explorehomer-brand; | ||
} | ||
a.active { | ||
font-weight: 700; | ||
background: $explorehomer-brand; | ||
color: $white; | ||
border-color: transparent; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
</template> | ||
|
||
<script> | ||
export default {} | ||
export default {}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.