1515 <v-card-text >
1616 <v-row no-gutters class =" dialog-customs__row" >
1717 <v-col md =" 5" sm =" 12" class =" mr-6" >
18- <v-alert
19- type =" error"
20- v-if =" isValidGeoJson === false"
21- transition =" out-in"
22- >
23- {{ $t('DialogCustomMap.invalid') }}
24- </v-alert >
18+ <v-skeleton-loader
19+ v-if =" loading"
20+ class =" mx-auto"
21+ height =" 500"
22+ type =" image"
23+ ></v-skeleton-loader >
24+ <div v-else >
25+ <v-alert
26+ type =" error"
27+ v-if =" isValidGeoJson === false"
28+ transition =" out-in"
29+ >
30+ {{ $t('DialogCustomMap.invalid') }}
31+ </v-alert >
2532
26- <GmapMap
27- :center =" { lat: 10, lng: 10 }"
28- :zoom =" 1"
29- ref =" mapRef"
30- map-type-id =" roadmap"
31- style =" width : 100% ; height : 500px "
32- :options =" {
33- gestureHandling: 'greedy',
34- }"
35- >
36- </GmapMap >
37- <v-row >
38- <v-btn
39- class =" mt-6 mr-auto ml-auto"
40- @click =" saveGeoJson"
41- color =" secondary"
33+ <GmapMap
34+ :center =" { lat: 10, lng: 10 }"
35+ :zoom =" 1"
36+ ref =" mapRef"
37+ map-type-id =" roadmap"
38+ style =" width : 100% ; height : 500px "
39+ :options =" {
40+ gestureHandling: 'greedy',
41+ }"
4242 >
43- <v-icon left dark > mdi-cloud-download </v-icon >
44- {{ $t('DialogCustomMap.download') }}
45- </v-btn >
46- </v-row >
43+ </GmapMap >
44+ <v-row >
45+ <v-btn
46+ class =" mt-6 mr-auto ml-auto"
47+ @click =" saveGeoJson"
48+ color =" secondary"
49+ >
50+ <v-icon left dark >
51+ mdi-cloud-download
52+ </v-icon >
53+ {{ $t('DialogCustomMap.download') }}
54+ </v-btn >
55+ </v-row >
56+ </div >
4757 </v-col >
4858
4959 <v-col >
90100 rows =" 21"
91101 filled
92102 clearable
103+ :loading =" loading"
93104 >
94105 </v-textarea >
95106 </v-col >
@@ -115,17 +126,22 @@ export default {
115126 props: [' visibility' ],
116127 data () {
117128 return {
118- placeholderGeoJson: geoJsonExample,
119129 rulesUrl: [(value ) => validURL (value)],
120130 rulesTextArea: [(value ) => this .checkIfStringGeoJsonValid (value)],
121131 type: ' text' ,
122132 file: null ,
123133 url: ' ' ,
124134 initMap: false ,
125135 editMap: false ,
136+ loading: false ,
126137 };
127138 },
128- computed: { ... mapGetters ([' geoJsonString' , ' isValidGeoJson' , ' geoJson' ]) },
139+ computed: {
140+ ... mapGetters ([' geoJsonString' , ' isValidGeoJson' , ' geoJson' ]),
141+ placeholderGeoJson () {
142+ return this .loading ? ' ' : geoJsonExample;
143+ },
144+ },
129145 methods: {
130146 ... mapActions ([' loadGeoJsonFromUrl' , ' setGeoJson' , ' setGeoJsonString' ]),
131147 checkIfStringGeoJsonValid (string ) {
@@ -165,7 +181,15 @@ export default {
165181 return ;
166182 }
167183 launchParams .files [0 ].getFile ().then ((f ) => {
168- this .file = f;
184+ this .loading = true ;
185+ this .$emit (' change-visibility' );
186+ f .text ()
187+ .then ((content ) => {
188+ return this .setGeoJsonString (content);
189+ })
190+ .then (() => {
191+ this .loading = false ;
192+ });
169193 });
170194 });
171195 }
0 commit comments