import {mainMap,skynetIpcInfo} from "../index.js"; import { iframeVideoUrl,serverIp,ipAddress } from "../../../../public/js/url.js"; var skynetIpcMarkerHash={}; var cusSkynetIpcMarkers=null; window.showH5sVideo=function(that){ var token=$(that).attr("token"); playHKiPC(token); } function playHKiPC(token){ if(serverIp=="43.15.198.61"){ var url=`${iframeVideoUrl}?token=${token}&autoplay=true` window.open(url); }else{ var url=`http://${ipAddress}/schoolplayhk/index.html?cameraIndexCode=${token}` window.open(url); } } function deleteSkynetIpcMarker(){ for(var i in skynetIpcMarkerHash){ delete skynetIpcMarkerHash[i] } cusSkynetIpcMarkers.clearLayers(); } function addSkynetIpcMarkerHash(id,marker){ skynetIpcMarkerHash[id]=marker; } function drawSkynetIpcMarker(){ var iconObj=L.icon({ iconUrl:"./pages/cmddispatch/image/wb_ipc.png",//图片路径 iconSize: [24, 24]//图片大小设置 }); cusSkynetIpcMarkers = L.markerClusterGroup({iconCreateFunction: function(cluster) { return L.divIcon({ html: `
${cluster.getChildCount()}
` }); }}); //标记绑定弹窗显示 skynetIpcInfo.forEach(item=>{ var name=item["name"]; var pointCode=item["pointCode"]; let longitude=item["longitude"]; let latitude=item["latitude"]; let marker=L.marker([latitude,longitude],{ icon: iconObj,//将marker设置为上面引用的图形 title:name, riseOnHover:true }); marker.bindTooltip(item["name"]).openTooltip(); marker.on('click',function(e){ showSkynetIpcInfoWindow(item) }) addSkynetIpcMarkerHash(pointCode,marker) cusSkynetIpcMarkers.addLayer(marker); }) mainMap.addLayer(cusSkynetIpcMarkers); } function showSkynetIpcInfoWindow(obj){ var pointCode=obj["pointCode"]; if(pointCode in skynetIpcMarkerHash){ skynetIpcMarkerHash[pointCode].unbindPopup(); skynetIpcMarkerHash[pointCode].bindPopup(`
${getskynetIpcInfoWindowDiv(obj)}
`,{maxHeight:260}).openPopup(); var lnglat= skynetIpcMarkerHash[pointCode].getLatLng() mainMap.setView(lnglat, 18); } } function getskynetIpcInfoWindowDiv(item){ return `

点位名称 ${item["name"]}

学校名称 ${item["station"]}

所属分局 长沙芙蓉分局

所属派出所 ${item["borough"]}

所属项目 ${item["projectName"]}

设备类型 ${item["deviceType"]}

人脸抓拍能力 ${item["aiFace"]==1?"是":"否"}

车辆抓拍能力 ${item["aiVehicle"]==1?"是":"否"}

国标编码 ${item["pointCode"]}

操作:
` } export { drawSkynetIpcMarker, deleteSkynetIpcMarker, skynetIpcMarkerHash, playHKiPC }