@@ -36,7 +36,7 @@ export default {
3636 }
3737 },
3838 async mounted () {
39- this .global_config = await this .get_global_config ()
39+ this .global_config = this .$store . state . site_config . global_config
4040 this .initMap ()
4141 },
4242 beforeDestroy () {
@@ -46,7 +46,7 @@ export default {
4646 },
4747
4848 watch: {
49- all_sites () {
49+ all_sites_real () {
5050 this .redrawMapSites ()
5151 },
5252 site_open_status () {
@@ -96,7 +96,7 @@ export default {
9696 },
9797
9898 async initMap () {
99- await this .$store . dispatch ( ' sitestatus/ getSiteOpenStatus' )
99+ await this .getSiteOpenStatus
100100 const sun_pos = { lat: nite .calculatePositionOfSun ().lat (), lng: nite .calculatePositionOfSun ().lng () }
101101 const map_center_latitude = 15 // puts sites at a more visibly comfortable location
102102 this .map = new google.maps.Map (document .getElementById (this .mapName ), {
@@ -128,11 +128,14 @@ export default {
128128 function iwClose () { iw .close () }
129129 google .maps .event .addListener (this .map , ' click' , iwClose)
130130
131- let sites = this .all_sites
131+ let sites = this .all_sites_real
132+
133+ // First, remove sites that don't have an available status
132134 sites = sites .filter (site => {
133- // First, remove sites that don't have an available status
134135 return Object .keys (this .site_open_status ).includes (site .site )
135136 })
137+
138+ // Consolidate additional data used to render sites to the map
136139 sites .forEach (site => {
137140 const markerData = {
138141 lat: site .latitude ,
@@ -304,7 +307,7 @@ export default {
304307
305308 async redrawMapSites () {
306309 // Fetch the list of sites to display on the map
307- const sites = this .all_sites .reverse ()
310+ const sites = this .all_sites_real .reverse ()
308311
309312 // For each site, draw a marker with a popup (on click) to visit the site.
310313 sites .forEach (site => {
@@ -335,7 +338,8 @@ export default {
335338 },
336339
337340 computed: {
338- ... mapGetters (' site_config' , [' all_sites' ]),
341+ ... mapState (' site_config' , [' test_sites' ]),
342+ ... mapGetters (' site_config' , [' all_sites_real' ]),
339343 ... mapState (' sitestatus' , [' site_open_status' ]),
340344 ... mapActions (' sitestatus' , [' getSiteOpenStatus' ])
341345 }
@@ -344,8 +348,6 @@ export default {
344348
345349< style lang= " scss" scoped>
346350.google - map {
347- // width: 100vw;
348- // height: 50vh;
349351 min- width: 50px ;
350352 min- height: 50px ;
351353 width: 100 % ;
0 commit comments