blob: 1c9fccc2c19620b9332814d70c3d8217752917df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<script>
import { createAlert } from '~/alert';
import { RENDER_ERROR_MSG } from './constants';
import { initLeafletMap } from './utils';
export default {
props: {
blob: {
type: Object,
required: true,
},
},
data() {
return {
hasError: false,
loading: true,
};
},
mounted() {
try {
initLeafletMap(this.$refs.map, JSON.parse(this.blob.rawTextBlob));
} catch (error) {
createAlert({ message: RENDER_ERROR_MSG });
this.hasError = true;
}
},
};
</script>
<template>
<div v-if="!hasError" ref="map" class="gl-h-100vh gl-z-index-0" data-testid="map"></div>
</template>
|