Welcome to mirror list, hosted at ThFree Co, Russian Federation.

geo_json_viewer.vue « geo_json « blob_viewers « components « repository « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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>