// GET: Maps public ActionResult Index() { var model = new MapsModel { MapsKey = "AkdTDUUzA1xA27bQiYIqsLFLBUPUrfpGY6SxbNQ70kdVua0HomPyx0b6dmjaygE9" }; return(View(model)); }
public IActionResult Map(MapsModel model) { if (model.KeyString == null) { model = GetDefaultMapView(); } return(View("Map", model)); }
// GET: MapsModel public ActionResult Index() { var model = new MapsModel( new[] { "Via Gavinana, 19, Roma", "Val de Seine, 94600 Choisy le Roi", "Street 21,Shuwaikh, Kuwait" } ); return(View(model)); }
public MapsModel GetDefaultMapView() { MapsModel model = new MapsModel() { Locations = GetAllActiveLocations() }; model.KeyString = _configuration["MapsAPIKey"].ToString(); model.CenterLat = 43.0819M; model.CenterLong = -88.1712M; return(model); }
public IActionResult GetMap(MapsModel mapsModel) { try { string address = mapsModel.SearchString.Replace(" ", "+"); MapPoint coords = _locationService.GetLatLongFromAddress(address); mapsModel = GetDefaultMapView(); mapsModel.CenterLat = (decimal)coords.Latitude; mapsModel.CenterLong = (decimal)coords.Longitude; } catch (Exception) { } return(Map(mapsModel)); }