/// <summary> /// 获取最低级的tree /// </summary> /// <param name="car"></param> /// <returns></returns> public static JObject getLastJobjectCar(DC_CAR_Model car) { var model = T_SYS_DICTCls.getListModel(new T_SYS_DICTSW { DICTTYPEID = "33", DICTVALUE = car.CARTYPE }).FirstOrDefault(); var name = car.NAME + "【" + model.DICTNAME + "】"; //getPosition StringBuilder sb = new StringBuilder(); string carimage = "car_" + car.CARTYPE; //偏移量计算 // double[] arr = ClsPositionUtil.gcj_To_Gps84(double.Parse(car.WD), double.Parse(car.JD)); if (!string.IsNullOrEmpty(car.JD) || !string.IsNullOrEmpty(car.WD)) { double[] arr = ClsPositionTrans.GpsTransform(double.Parse(car.WD), double.Parse(car.JD), ConfigCls.getSDELonLatTransform()); if (arr.Length > 0) { car.JD = arr[1].ToString(); car.WD = arr[0].ToString(); } //string sb = "<a onClick="">" + name + "</a>"; sb.AppendFormat("<font onClick='movetocar(\"{0}\",\"{1}\",\"{2}\")'>{3}</font>", car.JD, car.WD, carimage, name); } else { sb.AppendFormat("<font onClick='alert(\"缺少经纬度无法定位。\")'>{0}</font>", name); } JObject root = new JObject { { "id", car.DC_CAR_ID }, { "text", sb.ToString() } }; return(root); }