diff --git a/src/components/map/map.vue b/src/components/map/map.vue index 0efe7f2f..64b72558 100644 --- a/src/components/map/map.vue +++ b/src/components/map/map.vue @@ -92,6 +92,7 @@ + @@ -104,6 +105,7 @@ import { LMap, LTileLayer, LGeoJson } from 'vue2-leaflet' import sideView from '@/components/map/sideView' import compareButton from '@/components/map/compareButton' import prompt from '@/components/map/map_prompt' +import prompt_error from '@/components/map/prompt_error' import compareSide from '@/components/map/map_compareside' import L from 'leaflet' import switchButtons from '@/components/map/switch_buttons' @@ -127,6 +129,7 @@ export default { sideView, LGeoJson, prompt, + prompt_error, compareSide, switchButtons, leftBuildingMenu, @@ -170,6 +173,7 @@ export default { rKey: 1, message: this.message, askingForComparison: false, + building_compare_error: false, selected: [ 'Residence', 'Athletics & Rec', @@ -307,8 +311,18 @@ export default { console.log( this.compareStories[0] ) if ( this.compareStories[0] === undefined ) { this.compareStories.shift() + if ( this.compareStories[0] === undefined ) { + this.showSide = false + this.building_compare_error = true + } } + console.log( this.compareStories[0] ) let path = this.$store.getters['map/building']( this.compareStories[0] ).path + console.log( this.$store.getters['map/building']( this.compareStories[0] ).description ) + if ( this.$store.getters['map/building']( this.compareStories[0] ).description !== 'Electricity' ) { + this.showSide = false + this.building_compare_error = true + } if ( target === 'q' ) { let mgId = this.$store.getters[path + '/primaryGroup']( 'Electricity' ).id @@ -373,6 +387,12 @@ export default { this.compareStories = [] this.removeAllMarkers() }, + stopCompareError: function () { + this.building_compare_error = false + this.showSide = true + this.compareStories = [] + this.removeAllMarkers() + }, isDisplayed: function ( v ) { if ( this.selected.indexOf( v ) >= 0 ) { return true diff --git a/src/components/map/prompt_error.vue b/src/components/map/prompt_error.vue new file mode 100644 index 00000000..b349b07e --- /dev/null +++ b/src/components/map/prompt_error.vue @@ -0,0 +1,72 @@ + + + + +