更换图标及偏移量

Lvtianfang
吕天方 1 year ago
parent a75eee649b
commit 0c135a48fc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

@ -22,8 +22,12 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
img { img {
width: 54px; // width: 54px;
width: 30px;
} }
// .personImg {
// width: 30px;
// }
} }
.amap-info-content { .amap-info-content {
background-color: transparent; background-color: transparent;

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2024-01-09 23:08:15 * @Date: 2024-01-09 23:08:15
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2024-01-29 09:12:02 * @LastEditTime: 2024-01-29 16:28:49
--> -->
<template> <template>
<div class="map-main"> <div class="map-main">
@ -50,7 +50,7 @@
<el-amap-info-window <el-amap-info-window
v-if="personInfo.visible" v-if="personInfo.visible"
anchor="bottom-center" anchor="bottom-center"
:offset="[-10,-93]" :offset="[-10,-40]"
:closeWhenClickMap="true" :closeWhenClickMap="true"
:position="personInfo.position" :position="personInfo.position"
:visible.sync="personInfo.visible"> :visible.sync="personInfo.visible">
@ -66,21 +66,21 @@
<div class="dot"></div> <div class="dot"></div>
<div class="name">姓名</div> <div class="name">姓名</div>
</div> </div>
<div class="position">{{ personInfo.info.userName }}</div> <div class="position">{{ personInfo.info.userName || "-" }}</div>
</div> </div>
<div class="person-info"> <div class="person-info">
<div class="info-left"> <div class="info-left">
<div class="dot"></div> <div class="dot"></div>
<div class="name">联系方式</div> <div class="name">联系方式</div>
</div> </div>
<div class="position">{{ personInfo.personinfo.phonenumber }}</div> <div class="position">{{ personInfo.personinfo ? personInfo.personinfo.phonenumber : "-" }}</div>
</div> </div>
<div class="person-info"> <div class="person-info">
<div class="info-left"> <div class="info-left">
<div class="dot"></div> <div class="dot"></div>
<div class="name">所属部门</div> <div class="name">所属部门</div>
</div> </div>
<div class="position">{{ personInfo.personinfo.deptName }}</div> <div class="position">{{ personInfo.personinfo ? personInfo.personinfo.deptName : "-" }}</div>
</div> </div>
<div class="person-info"> <div class="person-info">
<div class="info-left"> <div class="info-left">
@ -94,7 +94,7 @@
<div class="dot"></div> <div class="dot"></div>
<div class="name">所属围栏</div> <div class="name">所属围栏</div>
</div> </div>
<div class="position">{{ personInfo.personinfo.fenceName || '-' }}</div> <div class="position">{{ personInfo.personinfo ? personInfo.personinfo.fenceName : '-' }}</div>
</div> </div>
<div class="person-info"> <div class="person-info">
<div class="info-left"> <div class="info-left">
@ -117,7 +117,7 @@
<!-- 事件弹框 --> <!-- 事件弹框 -->
<el-amap-info-window <el-amap-info-window
v-if="eventInfo.visible" v-if="eventInfo.visible"
:offset="[-10,-113]" :offset="[-10,-10]"
:closeWhenClickMap="true" :closeWhenClickMap="true"
:position="eventInfo.position" :position="eventInfo.position"
:visible.sync="eventInfo.visible" :visible.sync="eventInfo.visible"
@ -159,7 +159,7 @@
<!-- 执法车辆弹框 --> <!-- 执法车辆弹框 -->
<el-amap-info-window <el-amap-info-window
v-if="carInfo.visible" v-if="carInfo.visible"
:offset="[-10,-148]" :offset="[-10,-40]"
:closeWhenClickMap="true" :closeWhenClickMap="true"
:position="carInfo.position" :position="carInfo.position"
:visible.sync="carInfo.visible" :visible.sync="carInfo.visible"
@ -184,7 +184,7 @@
<!-- 监控视频弹框 --> <!-- 监控视频弹框 -->
<el-amap-info-window <el-amap-info-window
v-if="monitoringInfo.visible" v-if="monitoringInfo.visible"
:offset="[-10,-94]" :offset="[-10,-10]"
:closeWhenClickMap="true" :closeWhenClickMap="true"
:position="monitoringInfo.position" :position="monitoringInfo.position"
:visible.sync="monitoringInfo.visible" :visible.sync="monitoringInfo.visible"
@ -230,7 +230,7 @@
<!-- 沿街商铺分布 --> <!-- 沿街商铺分布 -->
<el-amap-info-window <el-amap-info-window
v-if="shopInfo.visible" v-if="shopInfo.visible"
:offset="[-10,-94]" :offset="[-10,-10]"
:closeWhenClickMap="true" :closeWhenClickMap="true"
:position="shopInfo.position" :position="shopInfo.position"
:visible.sync="shopInfo.visible" :visible.sync="shopInfo.visible"
@ -897,6 +897,8 @@ export default {
} else { } else {
this.componentMarker.visible = true; this.componentMarker.visible = true;
if(zoom < 13.2) { if(zoom < 13.2) {
this.layers.layer.show();
this.layers.text.show();
if(zoom < 12) { if(zoom < 12) {
this.unlightedPolygonId() this.unlightedPolygonId()
} }
@ -905,6 +907,10 @@ export default {
this.isPositioning = false; this.isPositioning = false;
} }
} else if(zoom > 13.2){ } else if(zoom > 13.2){
this.layers.layer.hide();
this.layers.text.hide();
this.layers.text1.show();
this.layers.layer3.show();
if(zoom > 14) { if(zoom > 14) {
this.layers.text1.show(); this.layers.text1.show();
this.layers.layer3.show(); this.layers.layer3.show();
@ -928,19 +934,21 @@ export default {
imgSrc = context.data[0].imgSrc == '1' ? require("../../../assets/images/icon/icon1.png") : require("../../../assets/images/icon/offLine1.png") imgSrc = context.data[0].imgSrc == '1' ? require("../../../assets/images/icon/icon1.png") : require("../../../assets/images/icon/offLine1.png")
} }
var content = `<div class="markerStyles"><div class="marker-Text" style="width:${context.data[0].text.length * 15}px">${context.data[0].text}</div><img src="${imgSrc}" alt=""></div>`; var content = `<div class="markerStyles"><div class="marker-Text" style="width:${context.data[0].text.length * 15}px">${context.data[0].text}</div><img src="${imgSrc}" alt=""></div>`;
var offset = new AMap.Pixel(-27, -94); var offset = new AMap.Pixel(-30.5, -48.5);
context.marker.setContent(content); context.marker.setContent(content);
context.marker.setOffset(offset); context.marker.setOffset(offset);
let obj = {}; // let obj = {};
obj.markers = context.marker; // obj.markers = context.marker;
obj.imei = context.data[0].info.imei; // obj.imei = context.data[0].info.imei;
this.personMarkers.push(obj) // this.personMarkers.push(obj)
context.marker.on('click',(ev)=>{ context.marker.on('click',(ev)=>{
// imei // imei
getUserByImei({imei:context.data[0].info.imei}).then(res=>{ getUserByImei({imei:context.data[0].info.imei}).then(res=>{
console.log(res,"获取人员信息");
if(res.code == 200) { if(res.code == 200) {
this.personInfo.position = context.data[0].position; this.personInfo.position = context.data[0].position;
this.personInfo.info = context.data[0].info; this.personInfo.info = context.data[0].info;
console.log(res.data[0],"res.data[0]");
this.personInfo.personinfo = res.data[0]; this.personInfo.personinfo = res.data[0];
this.personInfo.visible = true; this.personInfo.visible = true;
} }
@ -950,7 +958,7 @@ export default {
// //
_eventMarker (context) { _eventMarker (context) {
var content = `<div class="markerStyles"><img src="${require("../../../assets/images/icon/icon2.png")}" alt=""></div>`; var content = `<div class="markerStyles"><img src="${require("../../../assets/images/icon/icon2.png")}" alt=""></div>`;
var offset = new AMap.Pixel(-27, -94); var offset = new AMap.Pixel(-13, -16);
context.marker.setContent(content) context.marker.setContent(content)
context.marker.setOffset(offset) context.marker.setOffset(offset)
context.marker.on('click',(ev)=>{ context.marker.on('click',(ev)=>{
@ -962,7 +970,7 @@ export default {
// //
_renderMarker (context) { _renderMarker (context) {
var content = `<div class="markerStyles"><img src="${context.data[0].info.status == 1 ? require("../../../assets/images/icon/icon5.png") : require("../../../assets/images/icon/offLine4.png")}" alt=""></div>`; var content = `<div class="markerStyles"><img src="${context.data[0].info.status == 1 ? require("../../../assets/images/icon/icon5.png") : require("../../../assets/images/icon/offLine4.png")}" alt=""></div>`;
var offset = new AMap.Pixel(-27, -94); var offset = new AMap.Pixel(-13.5, -15);
context.marker.setContent(content) context.marker.setContent(content)
context.marker.setOffset(offset) context.marker.setOffset(offset)
context.marker.on('click',(ev)=>{ context.marker.on('click',(ev)=>{
@ -973,8 +981,9 @@ export default {
}, },
// //
_DrenderMarker(context) { _DrenderMarker(context) {
var content = `<div class="markerStyles"><div class="marker-Text" style="width:${context.data[0].info.shopName.length * 15}px">${context.data[0].info.shopName}</div><img src="${require("../../../assets/images/icon/icon6.png")}" alt=""></div>`; // <div class="marker-Text" style="width:${context.data[0].info.shopName.length * 15}px">${context.data[0].info.shopName}</div>
var offset = new AMap.Pixel(-27, -94); var content = `<div class="markerStyles"><img src="${require("../../../assets/images/icon/icon6.png")}" alt=""></div>`;
var offset = new AMap.Pixel(-13.5, -15);
context.marker.setContent(content) context.marker.setContent(content)
context.marker.setOffset(offset); context.marker.setOffset(offset);
context.marker.on('click',(ev)=>{ context.marker.on('click',(ev)=>{
@ -1049,9 +1058,9 @@ export default {
// console.log(this.count,'this.count'); // console.log(this.count,'this.count');
AMap.plugin(['AMap.MarkerCluster'],()=>{ AMap.plugin(['AMap.MarkerCluster'],()=>{
this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{ this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{
gridSize: 20, // gridSize: 60, //
styles: sts, styles: sts,
maxZoom: 17, maxZoom: 15,
// renderClusterMarker: this._renderClusterMarker, // // renderClusterMarker: this._renderClusterMarker, //
renderMarker: this._personRenderMarker, // renderMarker: this._personRenderMarker, //
}) })
@ -1092,7 +1101,7 @@ export default {
this.count = videoPoint.length; this.count = videoPoint.length;
AMap.plugin(['AMap.MarkerCluster'],()=>{ AMap.plugin(['AMap.MarkerCluster'],()=>{
this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{ this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{
gridSize: 20, // gridSize: 60, //
maxZoom: 17, maxZoom: 17,
styles: sts, styles: sts,
// renderClusterMarker: this._renderClusterMarker, // // renderClusterMarker: this._renderClusterMarker, //
@ -1132,8 +1141,8 @@ export default {
this.count = videoPoint.length; this.count = videoPoint.length;
AMap.plugin(['AMap.MarkerCluster'],()=>{ AMap.plugin(['AMap.MarkerCluster'],()=>{
this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{ this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{
gridSize: 20, // gridSize: 60, //
maxZoom: 17, maxZoom: 15,
styles: sts, styles: sts,
// renderClusterMarker: this._renderClusterMarker, // // renderClusterMarker: this._renderClusterMarker, //
renderMarker: this._renderMarker, // renderMarker: this._renderMarker, //
@ -1175,7 +1184,7 @@ export default {
this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{ this.cluster = new AMap.MarkerCluster(this.map,videoPoint,{
gridSize: 60, // gridSize: 60, //
styles: sts, styles: sts,
maxZoom: 17, maxZoom: 15,
// renderClusterMarker: this._renderClusterMarker, // // renderClusterMarker: this._renderClusterMarker, //
renderMarker: this._DrenderMarker, // renderMarker: this._DrenderMarker, //
}) })
@ -1301,7 +1310,7 @@ export default {
}, },
// //
watchClick(){ watchClick(){
if(this.personInfo.status == 1) { if(this.personInfo.info.status == "1") {
this.showVideo = true; this.showVideo = true;
videoSurveillance({...this.videoCondition,destID:this.personInfo.info.userId,imei:this.personInfo.info.imei}).then(res=>{ videoSurveillance({...this.videoCondition,destID:this.personInfo.info.userId,imei:this.personInfo.info.imei}).then(res=>{
if(res.code == 200 && res.data.msg == '操作成功') { if(res.code == 200 && res.data.msg == '操作成功') {
@ -2296,6 +2305,7 @@ export default {
}, },
// //
querySearch(queryString, cb){ querySearch(queryString, cb){
this.input = queryString;
// //
if(this.actionMap == 1) { if(this.actionMap == 1) {
dwgjList({name:queryString}).then(res=>{ dwgjList({name:queryString}).then(res=>{
@ -2389,9 +2399,9 @@ export default {
if (id == 1) { if (id == 1) {
this.markerOffset = new AMap.Pixel(-35, -123); this.markerOffset = new AMap.Pixel(-35, -123);
} else if (id == 2) { } else if (id == 2) {
this.markerOffset = new AMap.Pixel(-27, -113); this.markerOffset = new AMap.Pixel(-13.5, -15);
} else if (id == 3) { } else if (id == 3) {
this.markerOffset = new AMap.Pixel(-35, -148); this.markerOffset = new AMap.Pixel(-30.5, -48.5);
} else if (id == 4) { } else if (id == 4) {
this.MyInput = false; this.MyInput = false;
this.markerOffset = new AMap.Pixel(-27, -94); this.markerOffset = new AMap.Pixel(-27, -94);

Loading…
Cancel
Save