public ActionResult Gmap()
 {
     DistrictServices districtServices = new DistrictServices();
     districtServices.ShowMap = Boolean.TrueString;
     districtServices.addOrderBy("name", Constant.ORDER_ASC);
     List<DistrictModels> lstDistrict = districtServices.select(-1, -1);
     ViewData["lstDistrict"] = lstDistrict;
     return View();
 }
        public String GetJsonMap(int id)
        {
            
            String rs = "{\"type\": \"FeatureCollection\",";
            rs += "\"features\": [";
            DistrictServices districtServices = new DistrictServices();
            districtServices.ShowMap = Boolean.TrueString;
            districtServices.Id = id.ToString();
            List<DistrictModels> lstDistrict = districtServices.select(-1, -1);
            DistrictModels districtInfo = new DistrictModels();
            if(lstDistrict != null && lstDistrict.Count > 0){
                districtInfo = lstDistrict.First();
            }
            String coordinates = districtInfo.Coordinates;
            String[] lstCoordinates = coordinates.Split(',');
            for (int i = 0; i < lstCoordinates.Length; i++ )
            {
                String[] coordinates1 = lstCoordinates[i].Trim().Split(' ');
                rs += "{ \"type\": \"Feature\", \"id\": \"" + (i + 1).ToString() +"\", \"geometry\": { \"type\": \"Point\", \"coordinates\": [" + coordinates1[0] + "," + coordinates1[1] + "] } }";
                if(i != (lstCoordinates.Length - 1))
                    rs += ",";
            }

            rs += "]}";
            return rs;
        }