<template>
    <el-dialog
        :title="title"
        :visible.sync="show"
        destroy-on-close
        :before-close="handleClose">
        <position-map :coor="coor"></position-map>
        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="handleClose">确 定</el-button>
        </span>
    </el-dialog>
</template>

<script>
import PositionMap from './PositionMap'

export default {
    props: {
        title: {
            type: String,
            default: '位置'
        },
        show: {
            type: Boolean,
            default: false,
        },
        coor: {
            type: Object,
            default: () => {
                return {
                    lat: 0.0,
                    lng: 0.0
                }
            },
            required: true,
        },
    },
    components: {
        PositionMap
    },
    methods: {
        handleClose() {
            this.$emit('update:show', false);
        }
    }
}
</script>