// // GET: /MapAPI/ public JsonResult Index() { return(Json( service.Cities().Select(s => new { name = s.Name, code = s.Code }), JsonRequestBehavior.AllowGet )); }
// // GET: /Map/ public ActionResult Index(string type) { //Load /Views/Map/BaiduMap ViewData.Add("CityNum", service.CityNums()); var cityName = ""; foreach (string name in service.Cities().Select(s => s.Name)) { cityName += name + " "; } ViewData.Add("Cities", cityName); return View("BaiduMap"); }
private void init() { BaiduMap.Url = new System.Uri("http://localhost:58678/Map"); CityNumVal.Text = System.Convert.ToString(service.CityNums()); cityBindingSource.DataSource = service.Cities(); }