维基小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 lines
931 B

<template>
<map
:latitude="latitude"
:longitude="longitude"
:markers="markers"
:polygons="polygons"
:polyline="polyline"
id="map"
ref="map"
scale="17"
show-location="true"
style="width: 100%; min-height: 1000rpx;height:100%"
/>
</template>
<script>
export default {
props: {
markers: { type: Array, default: () => [] },
polyline: { type: Array, default: () => [] },
polygons: { type: Array, default: () => [] },
},
data() {
return {
latitude: 37.87059,
longitude: 112.55067,
};
},
watch: {
markers: {
deep: true,
handler(value) {
if (value && value.length) {
const { latitude, longitude } = value[0];
this.latitude = latitude;
this.longitude = longitude;
} else {
this.latitude = 37.87059;
this.longitude = 112.55067;
}
},
},
},
};
</script>