diff --git a/src/pages/Home/index.vue b/src/pages/Home/index.vue index 24259a8..4d08b12 100644 --- a/src/pages/Home/index.vue +++ b/src/pages/Home/index.vue @@ -685,11 +685,11 @@ export default { const marker = new AMap.Marker({ position: [lng, lat], icon: new AMap.Icon({ - size: new AMap.Size(30, 42), - image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png', - imageSize: new AMap.Size(30, 42) + size: new AMap.Size(30, 30), + image: require('@/assets/image/vehicle.png'), + imageSize: new AMap.Size(30, 30) }), - offset: new AMap.Pixel(-15, -42), + offset: new AMap.Pixel(-15, -30), zIndex: 1002, extData: { vehicleInfo: item } }); @@ -874,11 +874,11 @@ export default { const locationMarker = new AMap.Marker({ position: [lng, lat], icon: new AMap.Icon({ - size: new AMap.Size(30, 42), - image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png', - imageSize: new AMap.Size(30, 42) + size: new AMap.Size(30, 30), + image: require('@/assets/image/vehicle.png'), + imageSize: new AMap.Size(30, 30) }), - offset: new AMap.Pixel(-15, -42), + offset: new AMap.Pixel(-15, -30), zIndex: 1002, extData: { point: point, vehicleInfo: vehicleInfo } }); @@ -1219,11 +1219,22 @@ export default { if (b.type!='soil') return -1; return 0; }); - console.log(Marker,'Marker') Marker.map(item => { + let iconUrl; + if (item.type == 'vehicle' || item.type == 'waste_vehicle') { + // 危废车辆使用本地图片 + icon = new AMap.Icon({ + size: new AMap.Size(30, 30), // 图标显示大小 + image: require('@/assets/image/vehicle.png'), + imageSize: new AMap.Size(30, 30) // 图片实际大小 + }); + } else { + // 其他类型(监测站等)继续使用原来的远程图片 + iconUrl = this.urlimg + item.picUrl; + } let marker = new AMap.Marker({ zIndex: item.type == 'soil' ? that.lastZIndex : (that.lastZIndex+1), - icon: this.urlimg + item.picUrl, + icon: iconUrl, position: [item.longitude, item.latitude], offset: new AMap.Pixel(item.width, item.height), title: item.name, @@ -2151,7 +2162,7 @@ a:hover { .vehicle-dropdown-item-dark { display: flex; align-items: center; - padding: 8px 16px; + padding: 8px 16px!important; color: #8bb4d0; font-size: 13px; cursor: pointer;