示例#1
0
        public ActionResult GetCarList()
        {
            List <PersonLocationInfo> infoList = new List <PersonLocationInfo>();

            if (m_Index3 <= m_lonAndLat3.Length - 2)
            {
                m_Index3++;
            }
            else
            {
                m_Index3 = 1;
            }

            PersonLocationInfo info = new PersonLocationInfo();

            info.Name = "浙E00000";
            var lonAndLat = m_lonAndLat3[m_Index3 - 1];

            info.Lon = Convert.ToDecimal(lonAndLat.Split(',')[1]);
            info.Lat = Convert.ToDecimal(lonAndLat.Split(',')[0]);

            infoList.Add(info);
            return(new JsonResult
            {
                Data = infoList
            });
        }
示例#2
0
        public ActionResult GetPersonList()
        {
            List <PersonLocationInfo> infoList = new List <PersonLocationInfo>();

            if (m_Index1 <= m_lonAndLat1.Length - 2)
            {
                m_Index1++;
            }
            else
            {
                m_Index1 = 1;
            }

            if (m_Index2 <= m_lonAndLat2.Length - 2)
            {
                m_Index2++;
            }
            else
            {
                m_Index2 = 1;
            }

            PersonLocationInfo info = new PersonLocationInfo();

            info.Name = "张三";
            var lonAndLat = m_lonAndLat1[m_Index1 - 1];

            info.Lon = Convert.ToDecimal(lonAndLat.Split(',')[1]);
            info.Lat = Convert.ToDecimal(lonAndLat.Split(',')[0]);

            infoList.Add(info);

            PersonLocationInfo info1 = new PersonLocationInfo();

            info1.Name = "李四";
            lonAndLat  = m_lonAndLat2[m_Index2 - 1];
            info1.Lon  = Convert.ToDecimal(lonAndLat.Split(',')[1]);
            info1.Lat  = Convert.ToDecimal(lonAndLat.Split(',')[0]);

            infoList.Add(info1);

            return(new JsonResult
            {
                Data = infoList
            });
        }