map.vue 916 字节
<template>
	<view :style="{height:mapHeight}">
		<map style="width: 100%; height: 100%;" :latitude="latitude" :longitude="longitude"></map>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mapHeight:0,
				latitude: 0,
				longitude: 0
			}
		},
		onLoad() {
			uni.getSystemInfo({
				success: (res) => {
					//#ifdef APP-PLUS
					this.mapHeight = res.windowHeight*2 + res.statusBarHeight*2 +'rpx'
					//#endif
					//#ifdef H5
					this.mapHeight = res.windowHeight*2+'rpx'
					//#endif
				}
			})
			//#ifdef APP-PLUS
			uni.getLocation({
			    type: 'gcj02',
				geocode: true,
			    success: (res) => {
					this.latitude = res.latitude
					this.longitude = res.longitude
			    }
			});
			//#endif
			//#ifdef H5
			this.latitude = 39.086126
			this.longitude = 117.122802
			//#endif
		},
		methods: {
			
		}
	}
</script>

<style>
	.mapWrap{background: #007AFF;}
</style>