@worksafevictoria/wcl7.5 1.1.0-beta.109 → 1.1.0-beta.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.1.0-beta.109",
3
+ "version": "1.1.0-beta.110",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,62 +22,50 @@
22
22
  </row>
23
23
  <row>
24
24
  <column>
25
- <div>
26
- <GoogleMap
27
- api-key="AIzaSyD76GAmQQ6DuxKWf-aLXPZ9pwdz4nOvs2c"
28
- :style="`width: 100%; height: ${mapHeight}`"
29
- :center="center"
30
- :zoom="zoom"
31
- :zoom-control="true"
32
- :mapTypeControl="false"
33
- :streetViewControl="false"
34
- :fullscreenControl="true"
35
- >
36
- <!-- <CustomControl
37
- position="TOP_CENTER"
38
- class="mt-4"
39
- style="background-color: rgba(0, 0, 0, 0.2); border-radius: 5px"
40
- ><row>
41
- <column class="py-2 px-3">
42
- <single-taxonomy
43
- v-for="(t, i) in computedPropFilters"
44
- :key="i"
45
- :ref="`${t.record_id}`"
46
- :data="t"
47
- :results="filteredList.length"
48
- :loading="isFiltering"
49
- class="wcl-directory-filters__filterButton"
50
- @onFilter="onFilter"
51
- />
52
- <filter-button
53
- v-if="!hideReset"
54
- :is-reset="true"
55
- class="wcl-directory-filters__filterButton"
56
- @clicked="reset"
57
- />
58
- </column>
59
- </row>
60
- </CustomControl> -->
61
- <!-- <MarkerCluster> -->
62
- <Marker
63
- v-for="(location, i) in postcodes"
64
- :options="{
65
- position: location.center,
66
- label: `${location.deaths}`,
67
- title: `${location.deaths} ${location.deaths > 1 ? 'deaths' : 'death'}`,
68
- }"
69
- :key="i"
70
- />
71
- <!-- </MarkerCluster> -->
72
- </GoogleMap>
73
- </div>
25
+ <GoogleMap
26
+ api-key="AIzaSyD76GAmQQ6DuxKWf-aLXPZ9pwdz4nOvs2c"
27
+ map-id="18650d0e6b0daeb1"
28
+ :style="`width: 100%; height: ${mapHeight}`"
29
+ :center="center"
30
+ :zoom="zoom"
31
+ :zoom-control="true"
32
+ :mapTypeControl="false"
33
+ :streetViewControl="false"
34
+ :fullscreenControl="true"
35
+ >
36
+ <Polygon
37
+ v-for="(location, i) in lgaBoundaries"
38
+ :options="location"
39
+ :key="i + polygonKey"
40
+ />
41
+ <CustomControl position="BOTTOM_CENTER">
42
+ <h4 v-if="unknownLGA">
43
+ <BBadge variant="light"> Unknown LGA {{ unknownLGA }} </BBadge>
44
+ </h4>
45
+ </CustomControl>
46
+ <AdvancedMarker
47
+ v-for="(location, i) in centerLGA"
48
+ :options="{
49
+ position: location.center,
50
+ title: `${location.lga} (${location.deaths} ${location.deaths > 1 ? 'fatalities' : 'fatality'})`,
51
+ }"
52
+ :key="i"
53
+ :pin-options="{
54
+ background: '#fdcd59',
55
+ glyph: `${location.deaths}`,
56
+ glyphColor: 'black',
57
+ borderColor: '#000000',
58
+ scale: 1,
59
+ }"
60
+ />
61
+ </GoogleMap>
74
62
  </column>
75
63
  </row>
76
64
  </container>
77
65
  </template>
78
66
 
79
67
  <script>
80
- import postcode from './postcode_location.json'
68
+ import lga from './lga-map.json'
81
69
  import {
82
70
  GoogleMap,
83
71
  Marker,
@@ -85,13 +73,15 @@ import {
85
73
  Circle,
86
74
  CustomControl,
87
75
  InfoWindow,
76
+ Polygon,
77
+ AdvancedMarker,
88
78
  } from 'vue3-google-map'
89
79
  import Container from '../../Containers/Container/index.vue'
90
80
  import Column from '../../Containers/Column/index.vue'
91
81
  import Row from '../../Containers/Row/index.vue'
92
82
  import FilterButton from '../../Common/FilterButton/index.vue' // Reset
93
83
  import SingleTaxonomy from '../../Global/DirectoryFilters/SingleTaxonomy/index.vue'
94
- import { BFormGroup, BFormSelect, BButton } from 'bootstrap-vue-next'
84
+ import { BFormGroup, BFormSelect, BButton, BBadge } from 'bootstrap-vue-next'
95
85
 
96
86
  export default {
97
87
  name: 'GeoChart',
@@ -110,6 +100,9 @@ export default {
110
100
  CustomControl,
111
101
  InfoWindow,
112
102
  BButton,
103
+ Polygon,
104
+ AdvancedMarker,
105
+ BBadge,
113
106
  },
114
107
  props: {
115
108
  statsData: { type: Array, default: () => [] },
@@ -118,7 +111,7 @@ export default {
118
111
  },
119
112
  data() {
120
113
  return {
121
- postcode,
114
+ lga,
122
115
  zoom: 7,
123
116
  mapHeight: '700px',
124
117
  center: { lat: -36.5, lng: 145.3 },
@@ -129,6 +122,8 @@ export default {
129
122
  selected: {},
130
123
  availableBundles: [],
131
124
  },
125
+ unknownLGA: 0,
126
+ polygonKey: 1,
132
127
  }
133
128
  },
134
129
  mounted() {
@@ -209,27 +204,50 @@ export default {
209
204
  })
210
205
  return list
211
206
  },
212
- postcodes: function () {
207
+ centerLGA: function () {
213
208
  if (this.filteredList.length > 1) {
214
209
  let location = {}
210
+ this.unknownLGA = 0
215
211
  this.filteredList.forEach((item) => {
216
- if (location[item.POSTCODE]) {
217
- location[item.POSTCODE].deaths++
212
+ if (location[item.LGA]) {
213
+ location[item.LGA].deaths++
218
214
  } else {
219
- let pc = this.postcode.find((obj) => obj.postcode == item.POSTCODE)
215
+ let pc = this.lga.find(
216
+ (obj) =>
217
+ obj.name ==
218
+ item.LGA.replace('-', ' ')
219
+ .toUpperCase()
220
+ .substring(0, obj.name.length),
221
+ )
220
222
  if (pc) {
221
- location[item.POSTCODE] = {
222
- center: { lat: pc.lat, lng: pc.long },
223
+ location[item.LGA] = {
224
+ center: { lat: pc.labelpoint[0], lng: pc.labelpoint[1] },
223
225
  deaths: 1,
226
+ lga: pc.name,
224
227
  }
225
228
  } else {
226
- console.log('🚀 ~ item.POSTCODE:', item.POSTCODE)
229
+ this.unknownLGA++
227
230
  }
228
231
  }
229
232
  })
230
233
  return location
231
234
  }
232
235
  },
236
+ lgaBoundaries: function () {
237
+ let lgaData = lga.map((item) => {
238
+ return {
239
+ strokeColor: '#000000',
240
+ strokeOpacity: 0.8,
241
+ strokeWeight: 1,
242
+ fillColor: '#bababa',
243
+ fillOpacity: 0.5,
244
+ paths: item.boundaries.map((item) => {
245
+ return { lng: item[0], lat: item[1] }
246
+ }),
247
+ }
248
+ })
249
+ return lgaData
250
+ },
233
251
  },
234
252
  methods: {
235
253
  resize() {