diff --git a/src/views/next/screen-content-map/cpt/point.json b/src/views/next/screen-content-map/cpt/point.json index e9f3fe9..07b852e 100644 --- a/src/views/next/screen-content-map/cpt/point.json +++ b/src/views/next/screen-content-map/cpt/point.json @@ -15,7 +15,7 @@ "type": "Point", "coordinates": [ 120.21399, - 36.54200 + 36.54900 ] } }, @@ -30,8 +30,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.207301, - 36.559783 + 120.197301, + 36.561783 ] } }, @@ -46,7 +46,7 @@ "geometry": { "type": "Point", "coordinates": [ - 120.206376, + 120.193301, 36.555345 ] } @@ -62,8 +62,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.21425, - 36.56496 + 120.20325, + 36.56896 ] } }, @@ -78,8 +78,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.203251, - 36.468723 + 120.190251, + 36.465723 ] } }, @@ -110,31 +110,31 @@ "geometry": { "type": "Point", "coordinates": [ - 120.207032, - 36.565412 + 120.190301, + 36.550345 ] } }, { "type": "Feature", "properties": { - "name": "青岛浩丰生物科技有限公司", + "name": "山东汉研种业科技有限公司", "type": "marker", "category": "unit", - "id": "11" + "id": "1777617911371534337" }, "geometry": { "type": "Point", "coordinates": [ - 120.243555, - 36.483133 + 120.22399, + 36.55500 ] } }, { "type": "Feature", "properties": { - "name": "青岛海育种业有限公司", + "name": "青岛浩丰生物科技有限公司", "type": "marker", "category": "unit", "id": "11" @@ -142,15 +142,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.24024, - 36.465497 + 120.23414, + 36.48609 ] } }, { "type": "Feature", "properties": { - "name": "青岛顺发种业有限公司", + "name": "青岛海育种业有限公司", "type": "marker", "category": "unit", "id": "11" @@ -158,15 +158,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.208949, - 36.58008 + 120.24024, + 36.465497 ] } }, { "type": "Feature", "properties": { - "name": "青岛信利来种业有限公司", + "name": "青岛顺发种业有限公司", "type": "marker", "category": "unit", "id": "11" @@ -174,31 +174,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.227448, - 36.451863 + 120.19725, + 36.57996 ] } }, { "type": "Feature", "properties": { - "name": "山东汉研种业科技有限公司", - "type": "marker", - "category": "unit", - "id": "1777617911371534337" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 120.23914, - 36.48409 - ] - } - }, - { - "type": "Feature", - "properties": { - "name": "青岛顺发种业有限公司", + "name": "青岛信利来种业有限公司", "type": "marker", "category": "unit", "id": "11" @@ -206,15 +190,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.254949, - 36.54008 + 120.20414, + 36.47609 ] } }, { "type": "Feature", "properties": { - "name": "青岛信利来种业有限公司", + "name": "即墨良种中心", "type": "marker", "category": "unit", "id": "11" @@ -222,8 +206,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.247448, - 36.451863 + 120.22810, + 36.49461 ] } }, @@ -238,8 +222,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.217448, - 36.551863 + 120.19525, + 36.56996 ] } } @@ -260,15 +244,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.202739, - 36.558909 + 120.195139, + 36.555909 ] } }, { "type": "Feature", "properties": { - "name": "青岛旺禾农业科技有限公司", + "name": "青岛地平线现代农业科技有限公司", "type": "marker", "category": "unit", "id": "1" @@ -276,15 +260,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.18472, - 36.564018 + 120.188286, + 36.563778 ] } }, { "type": "Feature", "properties": { - "name": "青岛旺禾农业科技有限公司", + "name": "即墨区新盛禾种苗场", "type": "marker", "category": "unit", "id": "1" @@ -292,8 +276,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.18472, - 36.504018 + 120.19078, + 36.53914 ] } }, @@ -308,15 +292,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.282739, - 36.528909 + 120.18272, + 36.559018 ] } }, { "type": "Feature", "properties": { - "name": "青岛旺禾农业科技有限公司", + "name": "青岛鑫诚农业发展有限公司", "type": "marker", "category": "unit", "id": "1" @@ -324,8 +308,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.24472, - 36.564018 + 120.22327, + 36.54890 ] } } @@ -370,7 +354,7 @@ { "type": "Feature", "properties": { - "name": "青岛地平线蔬菜专业合作社", + "name": "青岛真野种植专业合作社", "type": "marker", "category": "unit", "id": "1774615823391416321" @@ -378,95 +362,95 @@ "geometry": { "type": "Point", "coordinates": [ - 120.188286, - 36.563778 + 120.16360, + 36.51482 ] } }, { "type": "Feature", "properties": { - "name": "青岛诚一果蔬现代农业专业合作社", + "name": "青岛地平线蔬菜专业合作社", "type": "marker", "category": "unit", - "id": "1774615189523030018" + "id": "1774615823391416321" }, "geometry": { "type": "Point", "coordinates": [ - 120.207973, - 36.538222 + 120.188316, + 36.563782 ] } }, { "type": "Feature", "properties": { - "name": "青岛浩丰生物科技有限公司", + "name": "青岛金元斗农业开发有限公司", "type": "marker", "category": "unit", - "id": "1" + "id": "1774615823391416321" }, "geometry": { "type": "Point", "coordinates": [ - 120.240555, - 36.483133 + 120.16330, + 36.51273 ] } }, { "type": "Feature", "properties": { - "name": "青岛贸润蔬菜瓜果专业合作社", + "name": "青岛太平盛丰果蔬专业合作社", "type": "marker", "category": "unit", - "id": "1777604628077875202" + "id": "1774615823391416321" }, "geometry": { "type": "Point", "coordinates": [ - 120.162582, - 36.54486 + 120.18992, + 36.52368 ] } }, { "type": "Feature", "properties": { - "name": "青岛沽河青青蔬菜专业合作社", + "name": "青岛园泉生态农业专业合作社", "type": "marker", "category": "unit", - "id": "1" + "id": "1774615823391416321" }, "geometry": { "type": "Point", "coordinates": [ - 120.188286, - 36.563778 + 120.19193, + 36.53453 ] } }, { "type": "Feature", "properties": { - "name": "青岛恒源顺生态果蔬种植专业合作社", + "name": "青岛诚一果蔬现代农业专业合作社", "type": "marker", "category": "unit", - "id": "1" + "id": "1774615189523030018" }, "geometry": { "type": "Point", "coordinates": [ - 120.196259, - 36.51241 + 120.212873, + 36.553622 ] } }, { "type": "Feature", "properties": { - "name": "青岛佳蔬蔬菜专业合作社", + "name": "青岛浩丰生物科技有限公司", "type": "marker", "category": "unit", "id": "1" @@ -474,31 +458,31 @@ "geometry": { "type": "Point", "coordinates": [ - 120.16755, - 36.531503 + 120.240555, + 36.483133 ] } }, { "type": "Feature", "properties": { - "name": "青岛春花秋实蔬菜专业合作社", + "name": "青岛贸润蔬菜瓜果专业合作社", "type": "marker", "category": "unit", - "id": "1" + "id": "1777604628077875202" }, "geometry": { "type": "Point", "coordinates": [ - 120.267973, - 36.538222 + 120.162582, + 36.54486 ] } }, { "type": "Feature", "properties": { - "name": "青岛大丰收蔬菜专业合作社", + "name": "青岛沽河青青蔬菜专业合作社", "type": "marker", "category": "unit", "id": "1" @@ -506,15 +490,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.20645, - 36.489536 + 120.168286, + 36.553778 ] } }, { "type": "Feature", "properties": { - "name": "青岛大欧庄户绿色食品有限公司", + "name": "青岛恒源顺生态果蔬种植专业合作社", "type": "marker", "category": "unit", "id": "1" @@ -522,15 +506,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.189507, - 36.456081 + 120.196259, + 36.51241 ] } }, { "type": "Feature", "properties": { - "name": "即墨区兆硕家庭农场", + "name": "青岛佳蔬蔬菜专业合作社", "type": "marker", "category": "unit", "id": "1" @@ -538,15 +522,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.208705, - 36.481948 + 120.16755, + 36.531503 ] } }, { "type": "Feature", "properties": { - "name": "青岛湍湾生态农业科技发展有限公司", + "name": "青岛康辉德果树种植专业合作社", "type": "marker", "category": "unit", "id": "1" @@ -554,15 +538,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.264708, - 36.477422 + 120.21664, + 36.44843 ] } }, { "type": "Feature", "properties": { - "name": "青岛佳蔬蔬菜专业合作社", + "name": "青岛春花秋实蔬菜专业合作社", "type": "marker", "category": "unit", "id": "1" @@ -570,15 +554,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.18755, - 36.501503 + 120.267973, + 36.538222 ] } }, { "type": "Feature", "properties": { - "name": "青岛春花秋实蔬菜专业合作社", + "name": "青岛大丰收蔬菜专业合作社", "type": "marker", "category": "unit", "id": "1" @@ -586,15 +570,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.187973, - 36.508222 + 120.20645, + 36.489536 ] } }, { "type": "Feature", "properties": { - "name": "青岛大丰收蔬菜专业合作社", + "name": "青岛大欧庄户绿色食品有限公司", "type": "marker", "category": "unit", "id": "1" @@ -602,15 +586,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.25645, - 36.489536 + 120.189507, + 36.456081 ] } }, { "type": "Feature", "properties": { - "name": "青岛大欧庄户绿色食品有限公司", + "name": "即墨区兆硕家庭农场", "type": "marker", "category": "unit", "id": "1" @@ -618,15 +602,15 @@ "geometry": { "type": "Point", "coordinates": [ - 120.189507, - 36.486081 + 120.208705, + 36.481948 ] } }, { "type": "Feature", "properties": { - "name": "即墨区兆硕家庭农场", + "name": "青岛昌瑞农业科技有限公司", "type": "marker", "category": "unit", "id": "1" @@ -634,8 +618,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.248705, - 36.481948 + 120.21928, + 36.56231 ] } }, @@ -651,7 +635,7 @@ "type": "Point", "coordinates": [ 120.264708, - 36.483422 + 36.477422 ] } } @@ -688,8 +672,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.22248, - 36.550282 + 120.21918, + 36.55805 ] } }, @@ -736,8 +720,8 @@ "geometry": { "type": "Point", "coordinates": [ - 120.208412, - 36.585586 + 120.213612, + 36.584086 ] } }, diff --git a/src/views/next/screen-content-map/cpt/zdyf-map.vue b/src/views/next/screen-content-map/cpt/zdyf-map.vue index b6a9b64..56212e2 100644 --- a/src/views/next/screen-content-map/cpt/zdyf-map.vue +++ b/src/views/next/screen-content-map/cpt/zdyf-map.vue @@ -32,6 +32,7 @@ import jdbandaoJson from './jdbandao.json' import point from './point.json' import chinaMap from './chinaMap.vue' import { selectConfigList } from '@/api/home' +import { seedCompanyList } from '@/api/zdyf' import { mapActions, mapGetters } from 'vuex' const width = 0 const height = 0 @@ -41,6 +42,7 @@ let polygonLayer let polygonLayer1 let lineLayer let dotLayer +let textLayer let dotLayer1 let dotLayer2 let dotLayer3 @@ -109,6 +111,7 @@ export default { { name: '年平均降水', units: '毫升', num: '687' }, { name: '土壤有机质', units: '含量', num: '1.5%' } ], + companyList: [], mapType: '', showPage: false, width: 1920, @@ -151,6 +154,9 @@ export default { } }) }) + seedCompanyList().then(res => { + this.companyList = res.data + }) }, methods: { ...mapActions({ @@ -159,9 +165,9 @@ export default { }), ...mapActions({}), openCompanyDetail (item) { - console.log('item::', item) + const row = this.companyList.filter(item1 => item1.name === item.name) this.set_qyjj(true) - this.set_gsxq_id(item.id) + this.set_gsxq_id(row[0].id) }, async switcMapType1 (arr) { this.removeDotLayers() @@ -184,7 +190,6 @@ export default { myMapZd = new GaodeMap({ pitch: 40.24716321414439, mapStyle: 'amap://styles/blue', - // style: styleConfig.style, showLabel: false, center: [120.220563, 36.496127], token: 'fc14b42e0ca18387866d68ebd4f150c1', @@ -193,7 +198,6 @@ export default { showIndoorMap: false, showBuildingBlock: false, resizeEnable: true, - // doubleClickZoom: false, showRoad: false, viewMode: '3D' }) @@ -317,10 +321,7 @@ export default { .source(data['育种企业']) .shape(images['育种企业']) .size('name', (val) => { - if (gaoliang.some((item) => item === val)) { - return 12 - } - return 10 + return 8 }) scene.addLayer(dotLayer) } @@ -329,10 +330,7 @@ export default { .source(data['育苗企业']) .shape(images['育苗企业']) .size('name', (val) => { - if (gaoliang.some((item) => item === val)) { - return 12 - } - return 10 + return 8 }) scene.addLayer(dotLayer1) } @@ -341,45 +339,49 @@ export default { .source(data['种植企业']) .shape(images['种植企业']) .size('name', (val) => { - if (gaoliang.some((item) => item === val)) { - return 12 - } - return 10 + return 8 }) scene.addLayer(dotLayer2) + // textLayer = new PolygonLayer({ + // zIndex: 20 + // }) + // .source(data['种植企业']) + // .color('name', 'rgba(126, 187, 255, 1)') + // .shape('name', 'text') + // .size(14) + // .style({ + // textAnchor: 'left', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + // // textOffset: [0, 40], // 文本相对锚点的偏移量 [水平, 垂直] + // spacing: 2, // 字符间距 + // padding: [2, 2], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 + // stroke: '#666', // 描边颜色 + // strokeWidth: 0.1, // 描边宽度 + // raisingHeight: 300, + // textAllowOverlap: true + // }) + // .active(true) + // scene.addLayer(textLayer) } if (arr.some((item) => item === '加工企业')) { dotLayer3 = new PointLayer({ zIndex: 30 }) .source(data['加工企业']) .shape(images['加工企业']) .size('name', (val) => { - if (gaoliang.some((item) => item === val)) { - return 12 - } - return 10 + return 8 }) scene.addLayer(dotLayer3) } dotLayer.on('click', (e) => { - console.log('e::', e) - if (gaoliang.some((item) => item === e.feature.properties.name)) { - this.openCompanyDetail(e.feature.properties) - } + this.openCompanyDetail(e.feature.properties) }) dotLayer1.on('click', (e) => { - if (gaoliang.some((item) => item === e.feature.properties.name)) { - this.openCompanyDetail(e.feature.properties) - } + this.openCompanyDetail(e.feature.properties) }) dotLayer2.on('click', (e) => { - if (gaoliang.some((item) => item === e.feature.properties.name)) { - this.openCompanyDetail(e.feature.properties) - } + this.openCompanyDetail(e.feature.properties) }) dotLayer3.on('click', (e) => { - if (gaoliang.some((item) => item === e.feature.properties.name)) { - this.openCompanyDetail(e.feature.properties) - } + this.openCompanyDetail(e.feature.properties) }) } }, @@ -414,7 +416,7 @@ export default { .map-legeng { position: absolute; - top: 550px; + top: 535px; left: 654px; transform: scale(0.7) translate(-50%); width: 140px;