Files
park/public/web/static/map_video/index.html

1181 lines
28 KiB
HTML
Raw Permalink Normal View History

2025-12-01 11:19:23 +08:00
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<script src="./data/jquery-1.10.1.min.js"></script>
<!--<link href="https://cdn.bootcdn.net/ajax/libs/video.js/7.11.7/alt/video-js-cdn.min.css" rel="stylesheet">
<script src="https://cdn.bootcdn.net/ajax/libs/video.js/7.11.7/alt/video.core.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/videojs-contrib-hls/5.9.0/videojs-contrib-hls.min.js"></script>-->
<!-- <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" type="text/css"> -->
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,body,#container{
height: 100%
}
.input-item{
height: 2.2rem;
}
.btn{
width: 6rem;
margin: 0 .5rem 0 .5rem;
}
.input-text{
width: 4rem;
margin-right:1rem;
}
#app{
}
.ads-search{
width: 100%;
display: flex;
}
#app button{
width: 100px;
height: 30px;
}
.red{
color: #ff0000 !important;
}
.info{
position: fixed;
width: 200px;
height: auto;
/*background-color: rgba(0,0,0,.5);*/
z-index: 99;
padding: 20px;
color:#fff;
background: rgba(13,21,61,.7);
border: 1px solid rgba(126,206,244,.8);
}
.info div{
margin: 10px 0;
}
.i-tit{
font-size: 20px;
font-weight: bold;
}
#app{
/* position: fixed;
z-index: 1;
bottom: 0;
right: 5px;
width: 280px;
height: auto;*/
}
.lengend{
width: 280px;
height: auto;
background-color: rgba(0,0,0,.4);
padding: 10px;
border-radius: 5px;
padding-bottom: 5px;
position: fixed;
bottom: 52px;
right: -285px;
z-index: 99;
transition: right .3s;
}
.l-show{
right: 26%;
}
.l-item{
width: 100%;
height: auto;
}
.l-head{
width: 100%;
height: auto;
}
.f-item{
width: auto;
height: 25px;
margin-bottom: 5px;
}
input[type=checkbox]{
display: none;
}
.f-item label{
width: auto;
display: inline-block;
height: 25px;
line-height: 25px;
color: #fff;
position: relative;
padding-left: 20px;
cursor: pointer;
}
.l-cont{
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
}
.l-cont .f-item{
width: 50%;
}
.f-item label:before{
position: absolute;
left: 0;
display: inline-block;
content: "";
width: 14px;
height: 14px;
top: 5px;
border: 1px solid #BFBFBF;
border-radius: 50%;
}
.f-item input:checked+label:before{
background-image: url('./icon/check.png');
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
border-color: #4679ff;
}
.f-item label span{
font-size: 14px;
display: inline-block;
height: 25px;
line-height: 25px;
}
.f-item label i{
display: inline-block;
width: 22px;
height: 14px;
margin: 0 3px;
}
.f-item label img{
width: 22px;
height: 22px;
vertical-align: sub;
}
.app-vis{
width: 32px;
height: 32px;
margin:10px 0;
float: right;
cursor: pointer;
position: fixed;
bottom: 40px;
right: 24%;
}
.app-vis label{
display: inline-block;
width: 100%;
height: 100%;
background-image: url('./icon/icon_tili_p@2x.png');
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
.app-vis input:checked+label{
background-image: url('./icon/icon_tili_n@2x.png');
}
.car-search{
width: 300px;
height: 40px;
position: fixed;
left: 20px;
top: 20px;
z-index: 99;
background-color: rgba(255,255,255,.6);
border-radius: 5px;
display: flex;
}
.car-search input{
flex-grow: 1;
border:none;
background-color: transparent;
padding-left: 10px;
outline: none;
}
.car-search i{
color: #fff;
position: absolute;
right: 70px;
display: inline-block;
height: 20px;
width: 20px;
background-color: #999;
border-radius: 50%;
top: 10px;
background-image: url('icon/icon_close@2x.png');
text-align: center;
background-repeat: no-repeat;
background-position: center;
background-size: 20px;
cursor: pointer;
}
.car-search span{
display: inline-block;
width: 60px;
height: 100%;
color: #333;
line-height: 40px;
text-align: center;
border-left: 1px solid #ccc;
cursor: pointer;
}
</style>
<title>经开区</title>
</head>
<body>
<div id='container'></div>
<div id="app">
<div class="info" :style="infoPos" v-show="infoVis">
<div class="i-tit" vshow="carInfo.type==='pog'">{{carInfo.name}}</div>
<div class="i-main">
<template v-if="carInfo.type==='pog'">
<div class="im-item">企业数量:{{carInfo.qynum}}</div>
<!-- <div class="im-item">当前移动危险源</div> -->
</template>
<template v-else>
<div class="im-item" >车牌号:{{carInfo.vehicleNo}}</div>
<div class="im-item">速度:{{carInfo.vec1}}</div>
<div class="im-item">状态:{{carInfo.vehicle_type | status}}</div>
<div class="im-item">车辆码:{{carInfo.qr_color==1?'绿牌':carInfo.qr_color==2?'黄牌':'红牌'}}车辆</div>
<div class="im-item">运单状态:{{carInfo.is_waybill==1?'无运单':'有运单'}}</div>
</template>
</div>
</div>
<div class="zjinfor info" :style="infoPos" v-show="zjinforvis">
<p> {{zjinfor.name}}</p>
</div>
<!--<div style="width: 400px;height: 300px;position: absolute;right: 30px;top: 30px;" v-show="show_video">
<div v-show="show_video" id="videobox" style="width: 400px;height: 300px;">
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="400" height="300">
<source id="source" src='https://hls01open.ys7.com/openlive/6eec4b5f6eea4ab9814bb23504173f40.m3u8' type="application/x-mpegURL">
</video>
</div>
<img src="icon/close.png" style="max-width: 25px; position: absolute;right: 10px;top: 5px;" @click="show_video=false">
</div>-->
<div class="lengend" :class="vis&&'l-show'">
<div class="l-item" v-for="(i,k) of form" :key="k">
<div class="l-head">
<div class="f-item">
<input type="checkbox" v-model="i.val" :id="k+'-tit'">
<label :for="k+'-tit'">
<span>{{i.tit}}</span>
</label>
</div>
</div>
<div class="l-cont">
<div class="f-item" v-for="(j,z) of i.kids" :key="z">
<input type="checkbox" v-model="i.model" :value="j.val" :id="k+'-item-'+z" @change="i.change(i)">
<label :for="k+'-item-'+z">
<img :src="j.icon" alt="" v-if="j.icon">
<i v-if="j.bc" :style="{'background-color':j.bc}"></i>
<span>{{j.label}}</span>
</label>
</div>
</div>
</div>
</div>
<div class="app-vis">
<input type="checkbox" v-model="vis" id="vis">
<label for="vis"></label>
</div>
<div class="car-search" style="opacity: 0;">
<input type="text" placeholder="车辆搜索" v-model="linKey">
<i @click="searchClear" v-show="linKey"></i>
<span @click="linSearch">搜索</span>
</div>
</div>
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode:'c093878ad110aeadf3f2e6854ada1f6c',
}
</script>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=31fedc4d3fd2c3438589db99eb2f7182&plugin=AMap.MouseTool"></script>
<script src="../js/vue.js"></script>
<script type="text/javascript" src="../js/data.js"></script>
<script src="./data/axios.js"></script>
<script type="text/javascript">
const MAP_KEY = "31fedc4d3fd2c3438589db99eb2f7182",
{
LngLat
} = AMap;
var map = new AMap.Map('container', {
zoom: 13,
center: new LngLat(107.001406,29.831293),
mapStyle: 'amap://styles/d20072f4733f3c023ea36097cd4d9933'
}),
stopcolor= '#ff0000',
livcolor = '#e89393',
lv1color= "#ff0000",
lv2color = "#a08e8e",
lv3color= '#d2db00',
lv4color= '#f29b76',
overlayGroups={
fac:[],
car:[],
enter:{},
road:[],
truth:[],
},
kk=`107.027841,29.759073;107.034279,29.762086;106.997726,29.824484;107.059954,29.820257;107.043592,29.83791;107.016477,29.871028;106.962953,29.790122`;
function kkRender(){
strToLL(kk).map(i=>{
new AMap.Marker({
position:i,
map:map,
icon:'./icon/tuli_kakou.png'
})
})
}
kkRender();
kk1=`107.027841,29.759073;107.034279,29.762086;106.962953,29.790122`;
// function sxtRender(){
// strToLL(kk1).map(i=>{
// marker =new AMap.Marker({
// position:i,
// map:map,
// icon:'./icon/sxt.png',
// })
// marker.on('click',markerClick)
// })
//
// }
// sxtRender();
function markerClick(e){
// console.log(e)
let pos=e.pixel;
//vm.carInfo=e.target.getExtData();
// vm.infoVis=true;
// vm.infoPos={
// left:`${pos.x+10}px`,
// top:`${pos.y-180}px`
// }
vm.show_video=true;
// if(e.target._amap_id==26){
// var url='https://hls01open.ys7.com/openlive/6eec4b5f6eea4ab9814bb23504173f40.m3u8';
// var player = videojs('myVideo');
// player.pause();
// player.dispose();
// document.getElementById('videobox').innerHTML = '';
// var str2 = `<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="400" height="300">
// <source id="source" src="${url}" type="application/x-mpegURL">
// </video>`;
// document.getElementById('videobox').innerHTML = str2;
// videojs('myVideo', {
// bigPlayButton: true,
// textTrackDisplay: false,
// posterImage: false,
// errorDisplay: false
// },function(){
// this.play();
// })
// }else if(e.target._amap_id==23){
// var url='https://hls01open.ys7.com/openlive/5a20e1d927244f638b141ca1f536166d.m3u8';
// var player = videojs('myVideo');
// player.pause();
// player.dispose();
// document.getElementById('videobox').innerHTML = '';
// var str2 = `<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="400" height="300">
// <source id="source" src="${url}" type="application/x-mpegURL">
// </video>`;
// document.getElementById('videobox').innerHTML = str2;
// videojs('myVideo', {
// bigPlayButton: true,
// textTrackDisplay: false,
// posterImage: false,
// errorDisplay: false
// },function(){
// this.play();
// })
// }else{
// var url='https://hls01open.ys7.com/openlive/0cec52bf7fb240c0852a3c45c039da9f.m3u8';
// var player = videojs('myVideo');
// player.pause();
// player.dispose();
// document.getElementById('videobox').innerHTML = '';
// var str2 = `<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="400" height="300">
// <source id="source" src="${url}" type="application/x-mpegURL">
// </video>`;
// document.getElementById('videobox').innerHTML = str2;
// videojs('myVideo', {
// bigPlayButton: true,
// textTrackDisplay: false,
// posterImage: false,
// errorDisplay: false
// },function(){
// this.play();
// })
// }
// videojs('myVideo', {
// autoplay: true,
// bigPlayButton: true,
// textTrackDisplay: false,
// posterImage: false,
// errorDisplay: false
// })
// function changeVideo(url){
// var player = videojs('myVideo');
// player.pause();
// player.dispose();
// document.getElementById('videobox').innerHTML = '';
// var str2 = `<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="300" height="250">
// <source id="source" src="${url}" type="application/x-mpegURL">
// </video>`;
// document.getElementById('videobox').innerHTML = str2;
// videojs('myVideo', {
// bigPlayButton: true,
// textTrackDisplay: false,
// posterImage: false,
// errorDisplay: false
// },function(){
// this.play();
// })
// }
};
showMarkers();
var vm=new Vue({
el:"#app",
filters:{
status(n){
switch(n){
case -1:
return '区域外行驶';
case 0:
return '正常';
case 1:
return '超速';
case 2:
return '禁行/禁停';
case 3:
return '禁停/禁行';
case 4:
return '未上报';
case 5:
return '超最大数量'
default:return "";
}
}
},
data(){
let fac=[
{
label:"变电站",
icon:'./icon/d.png',
val:'y',
},
{
label:"配气站",
icon:'./icon/fq.png',
val:'g',
},
{
label:"热能配置",
icon:'./icon/rs.png',
val:'v',
},
{
label:"废物处理",
icon:'./icon/fs.png',
val:'f',
},
{
label:"给水厂",
icon:'./icon/w.png',
val:'d',
},
{
label:"污水处理厂",
icon:'./icon/ws.png',
val:'h',
},
{
label:"事故池",
icon:'./icon/b.png',
val:'p',
},
{
label:"应急集合点",
icon:'./icon/pp.png',
val:'m',
},
{
label:"医院",
icon:'./icon/ht.png',
val:'_',
},
{
label:"居住区域",
bc:livcolor,
val:'live',
},
{
label:"停车区域",
bc:stopcolor,
val:'stop',
},
{
label:"森林防护区",
bc:'#26c533',
val:'tree',
},
],
car=[
{
label:"行驶车辆",
icon:'./icon/icon_tuli_xs@2x.png',
val:100,
},
{
label:"停止车辆",
icon:'./icon/icon_tuli_tz@2x.png',
val:200,
},
{
label:"预警车辆",
icon:'./icon/icon_tuli_yj@2x.png',
val:10,
},
{
label:"正常车辆",
icon:'./icon/icon_tuli_wyj@2x.png',
val:20,
},
{
label:"运单车辆",
icon:'./icon/icon_tuli_yd@2x.png',
val:1,
},{
label:"无运单车辆",
icon:'./icon/icon_tuli_wyj@2x.png',
val:2,
},
],
enter=[
{
label:"一级周界",
bc:lv1color,
val:'lv1',
},
{
label:"二级周界",
bc:lv2color,
val:'lv2',
},
{
label:"三级周界",
bc:lv3color,
val:'lv3',
},
// {
// label:"四级周界",
// bc:lv4color,
// val:'lv4',
// },
],
road=[
{
label:"正常周界",
bc:'#448ACA',
val:'nor',
},
{
label:"预警周界",
bc:'#46A162',
val:'warn',
},
{
label:"禁行周界",
bc:'#6A005F',
val:'no',
}
];
return {
show_video:false,
infoPos :{
left:'0px',
top:'0px'
},
videosrc:true,
zjinfor:{},
zjinforvis:false,
carInfo:{},
infoVis:false,
vis:false,
linKey:"",
search:'',
form:[
{
tit:'固定设施标记',
get val(){
return this.model.length===this.kids.length;
},
set val(n){
if(n){
this.model = this.kids.map(i=>i.val);
}else{
this.model= [];
}
this.change(this);
},
model:fac.map(i=>i.val),
change(_this){
let marksers= overlayGroups.fac,
kids=_this.kids.map(i=>i.val);
marksers.forEach(i=>{
let val=i.getExtData().type;
if(_this.model.includes(val)||!kids.includes(val)){
i.show();
}else{
i.hide();
}
})
},
kids:fac
},
//
{
tit:'周界',
get val(){
return this.model.length===this.kids.length;
},
set val(n){
console.log(n)
if(n){
this.model = this.kids.map(i=>i.val);
}else{
this.model= [];
}
this.change(this);
},
change(_this){
vm.enterSec();
let enters= overlayGroups.enter,
kids=_this.kids.map(i=>i.val);
// for(var i in enters){
// if(_this.model.includes(i)){
// enters[i].forEach(j=>j.show());
// }else{
// enters[i].forEach(j=>j.hide());
// }
// }
},
model:enter.map(i=>i.val),
kids:enter
},
{
tit:'周界筛选禁行',
$val:false,
get val(){
return this.$val;
},
set val(n){
this.$val=n;
this.change(this);
},
change(_this){
vm.enterSec();
},
model:[1,2],
kids:[
{
label:"非禁行",
val:2,
},
{
label:"禁行",
val:1,
},
]
},
// {
// tit:'道路周界',
// model:true,
// change(_this){
// let truth= overlayGroups.truth,
// kids=_this.kids.map(i=>i.val);
// for(var i in truth){
// if(_this.model.includes(i)){
// truth[i].forEach(j=>j.show());
// }else{
// truth[i].forEach(j=>j.hide());
// }
// }
// },
// get val(){
// return this.model;
// },
// set val(n){
// this.model=n;
// let truth= overlayGroups.truth;
// for(var i in truth){
// if(n){
// truth[i].forEach(j=>j.show());
// }else{
// truth[i].forEach(j=>j.hide());
// }
// }
// },
// kids:[],
// }
]
}
},
computed:{
enterModel(){
var ef=this.form.filter(i=>i.tit==='周界')[0],
sf=this.form.filter(i=>i.tit==='周界筛选禁行')[0];
return {
lv:ef.model,
isSec:sf.val,
sec:sf.model
}
}
},
methods:{
enterSec(){
let enters= overlayGroups.enter;
console.log(enters)
for(var i in enters){
if(this.enterModel.lv.includes(i)){
if(this.enterModel.isSec){
enters[i].forEach(j=>{
if([0,...this.enterModel.sec].includes(j.getExtData().is_ban)){
j.show()
}else{
console.log(j)
j.hide();
}
});
}else{
enters[i].forEach(j=>j.show());
}
}else{
enters[i].forEach(j=>j.hide());
}
}
},
linSearch(){
this.search=this.linKey;
vm.form[1].change();
},
searchClear(){
this.search="";
this.linKey="";
vm.form[1].change();
},
dataHandle({data}){
console.log(data)
let lv1=[],lv2=[],lv3=[],lv4=[];
data.filter(function(i) {
var res;
if (i.region_lv === 3&&i.region_type === 8) { //停车场
//res = false;
overlayGroups.fac.push(lvOverRender(i, {
fillColor: stopcolor,
fillOpacity: .3,
strokeColor: stopcolor,
extData: {
type: 'stop',
name:i.name
}
}))
} else if (i.region_lv === 2&&i.region_type === 3) { //居住区
//res = false;
overlayGroups.fac.push(lvOverRender(i, {
fillColor: livcolor,
fillOpacity: .5,
strokeColor: livcolor,
extData: {
type: 'live',
name:i.name
}
}))
}else if(i.region_lv === 2&&i.region_type === 4){ //森林防护区
overlayGroups.fac.push(lvOverRender(i, {
fillColor: '#26c533',
strokeColor: '#26c533',
extData: {
type: 'tree',
name:i.name
}
}))
}else{
res = true;
}
return res;
}).forEach(i=>{
if(i.info){
let stys={}
if(i.region_type==5){
stys={
[i.id]:{
fillColor: '#000000',
fillOpacity: .1,
strokeColor: '#000000',
}
}
}
var over=lvOverRender(i,stys[i.id]||{})
switch(i.region_lv){
case 1:
lv1.push(over);
break;
case 2:
lv2.push(over);
break;
case 3:
lv3.push(over);
break;
case 4:
lv4.push(over);
break;
}
}
})
overlayGroups.enter={
lv1,lv2,lv3,lv4
}
}
},
created(){
getData(this.dataHandle)
}
});
function strToLL(str) {
return str.split(';').map(i => new LngLat(...i.split(',').map(j => +j)))
}
function xlsxToPath(str) {
str = str.replace(/\)\n$|\n|^\(/g, '').replace(/\)\(/g, ';');
return strToLL(str);
}
function baiduToAMap(lls) {
AMap.convertFrom(lls, 'baidu', (r, e) => {
window.a = e.locations;
})
}
function lvOverRender(i,sty){
var style={};
style={
fillOpacity:{
1:0,
2:.5,
3:.5,
4:1,
},
fillColor:{
1:lv1color,
2:lv2color,
3:lv3color,
4:lv4color
},
strokeOpacity:{
1:1,
2:1,
3:1,
4:1
},
strokeColor:{
1:lv1color,
2:lv2color,
3:lv3color,
4:lv4color
},
strokeWeight:{
1:3,
2:2,
3:0,
4:0,
},
zIndex:{
1:21,
2:22,
3:23,
4:24
},
strokeStyle:{
1:'dashed',
2:'solid',
3:'solid',
4:'solid',
},
}
var poy=new AMap.Polygon({
map:map,
path:i.info?strToLL(i.info):'',
extData:i,
...(function(){
var obj={};
for(var j in style){
obj[j]=style[j][i.region_lv]
}
return obj
})(),
...(sty||{})
})
poy.on('click',function(e){
console.log(e.target.getExtData())
// if(e.target.getExtData().type=='stop'){
// vm.zjinfor={name:'明宇危化品停车场'}
// }else if(e.target.getExtData().type=='live'){
// vm.zjinfor={name:'晏家居住区'}
// }else{
// vm.zjinfor=e.target.getExtData();
// }
vm.zjinfor=e.target.getExtData();
vm.zjinforvis=true;
vm.infoVis=false;
let pos=e.pixel;
vm.infoPos={
left:`${pos.x+10}px`,
top:`${pos.y-120}px`
}
var timer;
timer&&clearTimeout(timer);
timer=setTimeout(e=>{
vm.zjinforvis = false
}, 5e3);
})
return poy;
}
function showJxq(path) {
return new AMap.Polygon({
map: map,
path: path,
strokeWeight: 0.1,
fillColor: '#ff0000',
fillOpacity: 0.1,
})
}
// var ws = new WebSocket("ws://47.108.64.59:2346"),
var carlist= [],
timer,
markerEvent=e=>{
let pos=e.pixel;
vm.carInfo=e.target.getExtData();
vm.infoVis=true;
vm.zjinforvis=false;
vm.infoPos={
left:`${pos.x+10}px`,
top:`${pos.y-120}px`
}
timer&&clearTimeout(timer);
timer=setTimeout(e=>{
vm.infoVis = false
}, 5e3);
};
// ws.onopen = function() {
// console.log('open')
// }
function CarMarkers(){
this.list=[];
this.data=[];
Object.defineProperty(this,'ids',{
get(){
return this.data.map(i=>i.id);
}
})
}
CarMarkers.prototype.getMarker=function(id){
return this.list.filter(i=>{
return i.getExtData().id===id
})[0];
}
CarMarkers.prototype.update=function(list){
let markers=[],marker;
list.forEach(i=>{
let lnglat=new LngLat(i.longitude,i.latitude);
i.type="marker";
/*marker = new AMap.Marker({
position:lnglat,
offset: new AMap.Pixel(-12, -12),
zIndex: 20+i.id+1,
map: map,
extData:i
});
if(i.id===6){
console.log(lnglat.toString())
}*/
if(this.ids.includes(i.id)){
marker=this.getMarker(i.id);
if(lnglat.toString()!==marker.getPosition().toString()){
marker.setPosition(lnglat);
}
var _data=marker.getExtData();
marker.setIcon('icon/'+i.status+'.png'/*_data.vehicle_type?'icon/dingwei_red.png':_data.vec1?'icon/dingwei_blue.png':'icon/dingwei_white.png'*/);
marker.setExtData(i);
}else{
marker = new AMap.Marker({
icon: 'icon/'+i.status+'.png',//i.vehicle_type?'icon/dingwei_red.png':i.vec1?'icon/dingwei_blue.png':'icon/dingwei_white.png',
position:lnglat,
offset: new AMap.Pixel(-12, -12),
zIndex: 30+i.id,
map: map,
extData:i
});
marker.on('click',markerEvent)
}
/*if(vm.form[1].zh.includes(i.status)){
marker.show();
}else{
marker.hide();
}*/
markers.push(marker)
})
let removeArr=[];
this.list.forEach(i=>{
if(!markers.includes(i)){
removeArr.push(i)
}
})
map.remove(removeArr)
this.data=list;
this.list=markers;
vm.form[1].change();
}
let car_markers=new CarMarkers();
function showMarkers() {
const icons = {
_: './icon/ht.png',
g: './icon/fq.png',
u: './icon/lv3.png',
c: './icon/lv4.png',
l: './icon/2.png',
y: './icon/d.png',
v: './icon/rs.png',
d: './icon/w.png',
h: './icon/ws.png',
s: './icon/lv1.png',
b: './icon/ot.png',
m: './icon/pp.png',
f: './icon/fs.png',
p: './icon/b.png',
stop:'./icon/p.png'
}
let geoJson = markers_pos.map(i => {
return {
path: i[0],
type: i[1]
}
}),
markers = geoJson.map(i => {
return new AMap.Marker({
position: strToLL(i.path)[0],
icon: new AMap.Icon({
size: new AMap.Size(23, 23),
image: icons[i.type],
imageSize: new AMap.Size(15, 15),
}),
anchor:'bottom-center',
offset:new AMap.Pixel(0,0),
content: !icons[i.type] && `<span style="color:#fff">${i.type}</span>`,
map: map,
extData:i,
})
});
overlayGroups.fac=markers;
return markers;
}
overlayGroups.truth={nor:[],no:[],warn:[]};
var truthColor={nor:'#1b2538',warn:'#46A162',no:'#6A005F'}
ploygens.forEach(i=>{
// if(i.type==='Polyline'){
// overlayGroups.truth[i.status]&&overlayGroups.truth[i.status].push(new AMap[i.type]({
// map:map,
// path:strToLL(i.path),
// strokeColor: truthColor[i.status],
// strokeOpacity: 1,
// zIndex:25,
// extData:i,
// }))
// }
})
function getData(call){
$.post('/api/Yq_perimeter/perimeter_list',{
action:'Perimeter/perimeter_list'
}).then(r=>{
call(JSON.parse(r))
})
return false;
call({
"code": "200",
"msg": "请求成功!",
"data": []
})
// return false;
// $.post('http://zhyq.toommi.com/api/Index/apppost',{
// action:'Perimeter/perimeter_list'
// }).then(r=>{
// console.log(JSON.parse(r))
// })
}
</script>
</body>
</html>