//LPY 2014-12-15 10:28:33 添加 热力图条件 public string AddHeartMapLayerWithCondition(JObject jsoncommand, Map currentMap) { try { string layername = "AFD"; string layerurl = ConfigurationManager.AppSettings[layername].ToString(); myheatmaplayer phmlyr = _mapcontrol.getHmLyr(layername, currentMap); //phmlyr.Intensity = 50; //phmlyr.setfilter() if (phmlyr == null) { phmlyr = new myheatmaplayer(); phmlyr.ID = layername; phmlyr.setfilter = jsoncommand["CONDITION"].ToString().Trim(); //"1=1"; //jsoncommand["FILTER"].ToString(); phmlyr.seturl = layerurl; phmlyr.setsource(); phmlyr.Intensity = HeatMapIntensity; phmlyr.Opacity = 0.9; currentMap.Layers.Add(phmlyr); } //phmlyr.setfilter = jsoncommand["CONDITION"].ToString().Trim(); phmlyr.refreshnow(); phmlyr.Refresh(); return(layername); } catch (Exception) { return("false"); } }
public static int HeatMapIntensity = Convert.ToInt32(ConfigurationManager.AppSettings["HeatMapIntensity"].ToString());//设置热力图的情况 #region 管理HeatMapLayer // 热力图处理时间比较长,要测试热力图打开到响应的时长!!! public string AddHeatMapLayer(JObject jsoncommand, Map currentMap) { try { string layername = jsoncommand["LAYER"].ToString(); string layerurl = ConfigurationManager.AppSettings[layername].ToString(); myheatmaplayer phmlyr = _mapcontrol.getHmLyr(layername, currentMap); //phmlyr.Intensity = 100; if (phmlyr == null) { phmlyr = new myheatmaplayer(); phmlyr.ID = layername; phmlyr.setfilter = jsoncommand["FILTER"].ToString();//LPY 2015-7-30 17:00:25 修改 原来为 1=1; phmlyr.seturl = layerurl; phmlyr.setsource(); phmlyr.Intensity = HeatMapIntensity; phmlyr.Opacity = 0.9; currentMap.Layers.Add(phmlyr); } return(layername); } catch (Exception) { return("false"); //throw; } }