|
@@ -107,7 +107,7 @@ export default defineComponent({
|
|
|
map.value.clearOverlays();
|
|
|
|
|
|
const zoomLevel = map.value.getZoom();
|
|
|
-
|
|
|
+ debugger
|
|
|
if (zoomLevel > 10) {
|
|
|
// 高缩放级别下显示单个设备标记
|
|
|
devices.value.forEach(device => {
|
|
@@ -138,12 +138,11 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const createDeviceMarker = (device: Device, point: any) => {
|
|
|
- debugger
|
|
|
const marker = new (window as any).BMap.Marker(point, {
|
|
|
- icon: new (window as any).BMap.Icon('/images/dingweida.png', new (window as any).BMap.Size(103, 105),
|
|
|
+ icon: new (window as any).BMap.Icon('https://iot.deepoil.cc/images/ding300.svg', new (window as any).BMap.Size(28, 30),
|
|
|
{
|
|
|
anchor: new (window as any).BMap.Size(10, 25),
|
|
|
- imageOffset: new (window as any).BMap.Size(0, 0 - device.status * 25)
|
|
|
+ // imageOffset: new (window as any).BMap.Size(0, -5)
|
|
|
}
|
|
|
)
|
|
|
});
|
|
@@ -166,6 +165,7 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const createClusterLabel = (cluster: Cluster, point: any) => {
|
|
|
+ debugger
|
|
|
const label = new (window as any).BMap.Label(cluster.count.toString(), {
|
|
|
position: point,
|
|
|
offset: new (window as any).BMap.Size(-10, -10)
|
|
@@ -175,18 +175,18 @@ export default defineComponent({
|
|
|
color: '#fff',
|
|
|
backgroundColor: '#1890ff',
|
|
|
borderRadius: '50%',
|
|
|
- width: '20px',
|
|
|
- height: '20px',
|
|
|
+ width: '30px',
|
|
|
+ height: '30px',
|
|
|
textAlign: 'center',
|
|
|
lineHeight: '20px',
|
|
|
cursor: 'pointer',
|
|
|
- fontSize: '12px',
|
|
|
+ fontSize: '18px',
|
|
|
fontWeight: 'bold'
|
|
|
});
|
|
|
|
|
|
// 添加点击事件
|
|
|
label.addEventListener('click', () => {
|
|
|
- map.value?.setZoom(11);
|
|
|
+ map.value?.setZoom(9.5);
|
|
|
map.value?.panTo(point);
|
|
|
});
|
|
|
|