@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
|
@@ -22,62 +22,50 @@
|
|
|
22
22
|
</row>
|
|
23
23
|
<row>
|
|
24
24
|
<column>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
217
|
-
location[item.
|
|
212
|
+
if (location[item.LGA]) {
|
|
213
|
+
location[item.LGA].deaths++
|
|
218
214
|
} else {
|
|
219
|
-
let pc = this.
|
|
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.
|
|
222
|
-
center: { lat: pc.
|
|
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
|
-
|
|
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() {
|