Exemplo n.º 1
0
        // GET: Maps
        public ActionResult Index()
        {
            var model = new MapsModel {
                MapsKey = "AkdTDUUzA1xA27bQiYIqsLFLBUPUrfpGY6SxbNQ70kdVua0HomPyx0b6dmjaygE9"
            };

            return(View(model));
        }
Exemplo n.º 2
0
 public IActionResult Map(MapsModel model)
 {
     if (model.KeyString == null)
     {
         model = GetDefaultMapView();
     }
     return(View("Map", model));
 }
Exemplo n.º 3
0
    // 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));
    }
Exemplo n.º 4
0
        public MapsModel GetDefaultMapView()
        {
            MapsModel model = new MapsModel()
            {
                Locations = GetAllActiveLocations()
            };

            model.KeyString  = _configuration["MapsAPIKey"].ToString();
            model.CenterLat  = 43.0819M;
            model.CenterLong = -88.1712M;

            return(model);
        }
Exemplo n.º 5
0
        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));
        }