77
88 b-form-select(
99 v-model ="selectedRegion"
10+ :disabled ="disabled"
1011 :options ="options"
1112 )
1213
1314 b-form-select(
1415 v-model ="selectedProvince"
16+ :disabled ="disabled"
1517 :options ="optionsProvince"
1618 )
1719</template >
@@ -28,6 +30,8 @@ export default {
2830 previousRegion: ' ' ,
2931 previousIsland: ' ' ,
3032
33+ disabled: false ,
34+
3135 options: [
3236 { value: null , text: ' Please select a region' }
3337 ],
@@ -133,6 +137,17 @@ export default {
133137
134138 // this.previousIsland = this.selectedIsland
135139 this .previousRegion = this .selectedIsland
140+
141+ // Disable the UI
142+ this .disabled = true
143+ const that = this
144+ const time = setInterval (() => {
145+ if (! window .MBL .isLoading ) {
146+ console .log (' map loaded!' )
147+ that .disabled = false
148+ clearInterval (time)
149+ }
150+ }, 200 )
136151 },
137152
138153 selectedProvince () {
@@ -153,7 +168,8 @@ export default {
153168
154169 mounted () {
155170 this .getRegionOptions ()
156- console .log (' ---INITIALIZING LIVELIHOOD ZONES' )
171+
172+ // Initialize the mapbox basemap
157173 window .MBL .initMap ({
158174 mapContainer: ' map' ,
159175 style: ' mapbox://styles/mapbox/streets-v11' ,
@@ -170,7 +186,6 @@ export default {
170186 return
171187 }
172188
173- console .log (` --PROCESSING ${ str} ` )
174189 let string = str
175190 if (string .includes (' -' )) {
176191 string = Array .from (string .split (' -' ), (x ) => ` ${ x[0 ].toUpperCase ()}${ x .substr (1 , x .length )} ` ).join (' -' )
@@ -214,8 +229,6 @@ export default {
214229 this .optionsProvince .push ({ value: item, text: provinceValue })
215230 })
216231 }
217-
218- console .log (this .optionsProvince )
219232 }
220233 }
221234}
0 commit comments