<template>
	<view class="draw-map">
		<draw @onSubmit="onSubmit"></draw>
	</view>
</template>

<script>
	import Draw from '@/components/OpenLayerMap/Draw.vue';
	export default {
		components:{
			Draw
		},
		data(){
			return {
				eventChannel:null
			}
		},
		onLoad(e) {
			this.eventChannel = this.getOpenerEventChannel();
		},
		methods:{
			onSubmit(e) {
				this.eventChannel.emit('savePolygonCoords', {
					coords: e
				})
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss">
	.draw-map{
		height: calc(100vh - var(--window-top) - 40rpx);
		background-color: $uni-user-page-bgc;
	}
</style>