<script>
import BaseDatasource from '../BaseDatasource'
export default {
  name: 'vue-datasource-geojson',
  mixins: [BaseDatasource],
  props: {
    data: {
      type: String | Object,
      required: true
    },
    options: {
      type: Object,
      default: () => {
        return {
          markerSize: 48,
          strokeWidth: 2,
          clampToGround: false
        }
      }
    }
  },
  methods: {
    async createCesiumObject () {
      const { $props, transformProps } = this
      const options = transformProps($props)
      return new Cesium.GeoJsonDataSource.load(options.data, options.options)
    }
  }
}
</script>
