1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | var __loadingIndex = 0;$(function () { //初始化对象 $("#DeviceMap").baidumap({ authLocalCity : false, style : { height : $(window).height() - 20 }, defaultCenter: '西安', zoom : 6 }).on('polygonComplete', function (res) { //自动搜索完成回调 layer.close(__loadingIndex); }); //搜索指定地方 // $("#DeviceMap").baidumap('searchLocal','大浪时尚小镇'); //输入框自动完成 $("#DeviceMap").baidumap('autoComplete','address'); //设置多个数据 $("#DeviceMap").baidumap('setData', [{ "lat": 24.4854510, "lng": 118.0959950, "icon": 'online', //"iconUrl": '/img/user5-128x128.jpg', content: '<div><i ></i>名称:test01网络状态:在线区域:福建线路:厦门南中所在点位:厦门南中1' + '状态:正常</div>' },{ "lat": 30.2789730, "lng": 120.1621610, "icon": 'online', //"iconUrl": '/img/user5-128x128.jpg', content: '<div><i ></i>名称:test02网络状态:在线区域:杭州线路:杭州xxx所在点位:杭州xxxxx' + '状态:正常</div>' }]); //设置单个数据 $("#DeviceMap").baidumap('setData', { "lat": 26.0804430, "lng": 119.3034040, "icon": 'online', //"iconUrl": '/img/user5-128x128.jpg', content: '<div><i ></i>名称:test01网络状态:在线区域:福建线路:厦门南中所在点位:厦门南中1' + '状态:正常</div>' }); //创建区域树 getRegionTree();});function getRegionTree() { var tree = $.fn.zTree.init($("#regionTree"), { data: { simpleData: { enable: true, idKey: "regionId", pIdKey: "regionId" }, key: { name: "regionName", url: "nourl", } }, callback : { onClick : function (event,treeId,data) { __loadingIndex = layer.load(); $("#DeviceMap").baidumap('getBoundary',data.regionName,8); } } },[{ regionId : 0,regionName:"行政区域",isParent:true,open:true,children:[ { regionId : 1,parentId:0,regionName:"北京市",isParent:true,children:[ {regionId : 2,parentId : 0,regionName:"海淀区",isParent:false}, {regionId : 3,parentId : 0,regionName:"朝阳区",isParent:false}, {regionId : 4,parentId : 0,regionName:"昌平区",isParent:false} ] } ] }]);} |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com