增加金光农场(广西农垦育种基地)演示

master
贾肃 5 months ago
parent 6fd57f051d
commit e47bc80887
  1. 42
      src/views/system/base/mapMarkers.vue
  2. 119
      src/views/system/base/massifMap.vue

@ -1,20 +1,26 @@
<!--基地点坐标-->
<script setup>
import {ElAmap, useGeolocation ,lazyAMapApiLoaderInstance} from "@vuemap/vue-amap";
import {ElAmap, useGeolocation, lazyAMapApiLoaderInstance} from "@vuemap/vue-amap";
import BaseRightControl from "@/views/system/base/baseRightControl.vue";
const router = useRouter()
const maxHeight = ref(window.innerHeight - 100);
const zoom = ref(13);
const center = ref([
116.338461,
39.97947
107.5856025,
22.484856
]);
const baseList = ref([
{
baseId:1,
position:[116.338461, 39.97947],
label:'测试',
}
baseId: 1,
position: [116.338461, 39.97947],
label: '测试',
},
{
baseId: 2,
position: [107.5856025, 22.484856],
label: '金光农场(广西农垦育种基地)',
},
])
const control = reactive({
//
@ -39,7 +45,7 @@ const control = reactive({
const clickBase = ref(null)
const clickMarker = (value) => {
clickBase.value = value
router.push({path:'/system/base/massifMap/'+value.baseId})
router.push({path: '/system/base/massifMap/' + value.baseId})
console.log(value);
}
onBeforeMount(() => {
@ -75,19 +81,19 @@ const selectPoi = ({poi}) => {
:features="control.showPoi?['bg','point','road','building']:['bg']"
>
<!--卫星云图-->
<el-amap-layer-satellite :visible="true" />
<el-amap-layer-satellite :visible="true"/>
<!--定位控件-->
<el-amap-control-geolocation :visible="false"/>
<!--地图缩放控件-->
<el-amap-control-tool-bar :visible="true" />
<el-amap-control-tool-bar :visible="true"/>
<!--比例尺-->
<el-amap-control-scale :visible="true" />
<el-amap-control-scale :visible="true"/>
<!--灵活点标记-->
<el-amap-marker
v-for="item in baseList"
:position="item.position"
:title="item.label"
:label="{content:item.label,offset:[5,0]}"
:label="{content:item.label,offset:[0,0]}"
:visible="true"
:draggable="false"
@click="clickMarker(item)"
@ -108,22 +114,24 @@ const selectPoi = ({poi}) => {
</template>
<style scoped lang="scss">
.top-block{
.top-block {
position: absolute;
top: 0;
width: 100%;
height: 100%;
pointer-events:none;//none穿西
.operate{
pointer-events: none; //none穿西
.operate {
//
pointer-events: all;
}
}
.local-icon{
.local-icon {
width: 30px;
height: 30px;
}
:deep(.amap-marker-label){
:deep(.amap-marker-label) {
border: none;
border-radius: 5px;
padding: 5px 10px;

@ -48,7 +48,7 @@ const mouseToolRef = ref(null)
// ()
const floorSpace = ref(0)
const maxHeight = ref(window.innerHeight - 100);
const zoom = ref(17);
const zoom = ref(16);
//
const protract = ref(false)
//
@ -62,6 +62,54 @@ const gridLines = ref([])
const polygonList = reactive([
{
id: 1,
title: '地块1',
cropType: '甘蔗',
path: [
[
107.585681,
22.481152
],
[
107.585536,
22.481152
],
[
107.585524,
22.48856
],
[
107.585662,
22.48844
],
],
fillColor: undefined
},
{
id: 2,
title: '地块2',
cropType: '甘蔗',
path: [
[
107.585526,
22.481149
],
[
107.585274,
22.481137
],
[
107.585257,
22.48857
],
[
107.585515,
22.48839
]
],
fillColor: undefined
},
{
id: 3,
title: '测试地块1',
cropType: '甘蔗',
path: [
@ -89,7 +137,7 @@ const polygonList = reactive([
fillColor: undefined
},
{
id: 2,
id: 4,
title: '测试地块2',
cropType: '甘蔗',
path: [
@ -160,6 +208,66 @@ const ridgeList = ref([
]
]
},
{
id:1,
polygonId:1,
title:'垄1',
path:[
[
107.585681,
22.481152
],
[
107.585662,
22.48844
]
]
},
{
id:2,
polygonId:1,
title:'垄28',
path:[
[
107.585536,
22.481152
],
[
107.585524,
22.48856
]
]
},
{
id:3,
polygonId:2,
title:'垄1',
path:[
[
107.585526,
22.481149
],
[
107.585515,
22.48839
]
]
},
{
id:3,
polygonId:2,
title:'垄43',
path:[
[
107.585274,
22.481137
],
[
107.585257,
22.48857
]
]
},
])
//
const plantList = ref([
@ -305,8 +413,8 @@ const cancelMassif = () => {
}
//
const center = ref([
116.338461,
39.97947
107.5856025,
22.484856
]);
//
const selectPoi = ({poi}) => {
@ -477,7 +585,6 @@ const toAddMassif = () => {
:path="polygonTemp"
@addnode="updateMassif"
@removenode="updateMassif"
:zooms="[13,20]"
@adjust="updateMassif"
:visible="true"
:editable="true"
@ -496,7 +603,6 @@ const toAddMassif = () => {
<el-amap-polyline
v-if="control.massifGrid"
v-for="grid in gridLines"
:zooms="[16,20]"
stroke-color="#e36ea4"
:path="grid"
:visible="true">
@ -505,7 +611,6 @@ const toAddMassif = () => {
<el-amap-polyline
v-if="control.showRidge"
v-for="ridge in ridgeList"
:zooms="[16,20]"
:strokeWeight="5"
strokeColor="#a4e36e"
:path="ridge.path"

Loading…
Cancel
Save