Demo entry 6643771

java

   

Submitted by anonymous on Sep 29, 2017 at 04:44
Language: Java. Code size: 3.1 kB.

//添加图层的大致流程
function addfingerprintDatabaseLayer(map,granularity,intdate,cityAb){
     //获取图层名称
     var layerName = "f_et_sca_zwk_50_grid_month_"+intmonth+"_"+cityMap2[cityId];
     var fingerprintDatabaseLayer = getLayer(map,"软采信令指纹库定位");
     if(fingerprintDatabaseLayer){
          map.removeLayer(fingerprintDatabaseLayer);
     }
     fingerprintDatabaseLayer = new OpenLayers.Layer.EMapLayer(
          "软采信令指纹库定位",
          AdminLTE.geoURI + "/wms",
          {
                 layers: 'ltemr_gd:'+LayerName, format: 'image/png', transparent: true
          },
          {tileSize: new OpenLayers.Size(256, 256)},
          layerName
     );
     map.addLayer(fingerprintDatabaseLayer);
}

//function init()初始化地图,中加入周和月对应的图层,该模块中周,月对应的图层是一样的,不需要区分,添加代码:
addfingerprintDatabaseLayer(map_month,"month",intdate_month,cityPy_cityAb[city]);
addfingerprintDatabaseLayer(map_week,"month",intdate_month,cityPy_cityAb[city]);

//在index.css文件中添加
.ms_show_bot{
  top: 60px;
  left: 35px;
}

//添加模糊查询,其实都已经封装好功能,就是知道如何调用就可以了
queryOptions:queryOption
var queryOption = ["小区ID","小区名称","楼宇ID","楼宇名称","道路ID","道路名称"];
从370行到 return new EMap(elementId, mapoptions); 其中全部是粘贴复制

//加载表格数据封装代码:
function loadTableData(){
      showLoading();
      // 加载表格数据
      $.each(ltePage.tables, function (id, table) {
        if (table) {
           //table.reload();
           table.api.ajax.reload();
           //table.api.columns.adjust();
        }
     });
     hideLoading();
}

//添加模糊查询代码
var queryOption = ["基站名称","小区ID","小区名称"];
queryOptions:queryOption
---定义点搜索圆圈按钮时候显示的选项有"基站名称","小区ID","小区名称"

var myMap = new EMap(elementId, mapoptions);
var item1 = [{
     id:elementId,
     layername:"基站图层",
     title:"查询",
     value:"查询",
     click: function (e) {
           var trs=$('#'+$('.active>a')[0].href.split('#')[1])[0].children[0].children[0].children[0].children;
           //alert(myMap.searchWindow.dataList[0].detaildata[0][23]);
           //alert(myMap.searchWindow.dataList[0].detaildata[0][24]);
           var cellIds=[];
           var a;
           for(var i=1;i<trs.length;i++){
           if(trs[i].children[0].children[0].checked){
                  a = trs[i].rowIndex -1;
           }
           alert(myMap.searchWindow.dataList[0].detaildata[a])
           //alert(myMap.searchWindow.dataList[0].detaildata[a][23]); 经度                                                            //alert(myMap.searchWindow.dataList[0].detaildata[a][24]); 纬度

           var lon = myMap.searchWindow.dataList[0].detaildata[a][23];
           var lat = myMap.searchWindow.dataList[0].detaildata[a][24];

           //根据经纬度来画出中心点
           var lon = myMap.searchWindow.dataList[0].detaildata[a][23];
           var lat = myMap.searchWindow.dataList[0].detaildata[a][24];
           addCenterPointLayer(map,lon,lat);
     }
}];

 myMap.searchWindow.btnList = item1;

//在地图控件"查询"中,添加模糊搜索,先设置queryOption;然后加上itm1,在显示的数据下面添加查询按钮,
//通过用户点击列表中的某一行,就可以得到要显示点的经纬度,然后根据经纬度得到选择点,根据选择点画出2000米矩形

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).