public ActionResult LocationIndoorEdit(Guid id) { var location = geoSvc.GetLocationIndoorByID(id); if (location == null) { return(new PlacesController().PlaceNotFound()); } var model = new LocationIndoorEditViewModel(); model.InjectFrom(location); SetLocationIndoorEditViewData(location); var climbImageToDisplay = (location.HasAvatar) ? Stgs.ImgsRt + location.AvatarRelativeUrl : Stgs.DefaultMapInfoImage; var mapViewSettings = mappingSvc.GetBingViewByID(location.ID); if (mapViewSettings == default(PlaceBingMapView)) { mapViewSettings = PlaceBingMapView.GetDefaultIndoorSettings(location); } model.LatLongEditorModel = new Bing7MapWithLocationViewModel("myMap", 486, 240, location.Latitude, location.Longitude, climbImageToDisplay); model.LatLongEditorModel.ViewOptions = new Bing7MapViewOptionsViewModel(mapViewSettings); return(View(model)); }
public Bing7MapViewOptionsViewModel(PlaceBingMapView mapView) { if (mapView != null) { ID = mapView.ID.ToString(); Bounds = mapView.Bounds; CenterOffset = mapView.CenterOffset; Heading = mapView.Heading; MapCenterLatitude = mapView.MapCenterLatitude; MapCenterLongitude = mapView.MapCenterLongitude; MapTypeId = mapView.MapTypeId; Zoom = mapView.Zoom; } }
public ActionResult LocationIndoorDetail(string countryUrlPart, string locationNameUrlPart) { var location = geoSvc.GetLocationIndoor(country.ID, locationNameUrlPart); if (location == null) { return(PlaceNotFound()); } ViewBag.Current = location; //var modPlace = geoSvc.GetObjectModMetaOrSystemCreate(location); //ViewBag.ModPlaceDetails = modPlace; ViewBag.Posts = new PostService().GetPostForLocation(location.ID, PostType.Unknown, ClientAppType.CfWeb); var intersectingAreas = geoSvc.GetIntersectingAreas(location); ViewBag.Provinces = intersectingAreas.Where(c => c.Type == CfType.Province).ToList(); ViewBag.Cities = intersectingAreas.Where(c => c.Type == CfType.City).ToList(); var closestLocations = geoSvc.GetClosestLocationsOfLocation(location.ID); ViewBag.ClosestLocations = closestLocations; var mapViewSettings = mappingSvc.GetBingViewByID(location.ID); if (mapViewSettings == default(PlaceBingMapView)) { mapViewSettings = PlaceBingMapView.GetDefaultIndoorSettings(location); } var mapModel = new Bing7MapWithLocationViewModel(location.NameUrlPart, 486, 240, location.Latitude, location.Longitude, location.AvatarRelativeUrl); mapModel.ViewOptions = new Bing7MapViewOptionsViewModel(mapViewSettings); ViewBag.MapView = mapModel; ViewBag.Climbs = geoSvc.GetCurrentClimbsOfLocation(location.ID).ToList(); ViewBag.MediaList = medSvc.GetObjectsTopMedia(location.ID, 11); ViewBag.PageQR = string.Format("http://i/{0}", location.ID.ToString("N")); ViewBag.LatestOpinions = new ContentService().GetLatestOpinionsOnObject(location.ID, 20).ToList(); return(View()); }
private void SaveBing7MapViewFromModel(Bing7MapViewOptionsViewModel model, Guid placeID) { var placeBingMapView = new PlaceBingMapView(); placeBingMapView.InjectFrom(model); if (!string.IsNullOrWhiteSpace(model.ID)) { placeBingMapView.ID = new Guid(model.ID); } if (placeBingMapView.ID == Guid.Empty) { placeBingMapView.ID = placeID; mappingSvc.CreateBingView(placeBingMapView); } else { mappingSvc.UpdateBingView(placeBingMapView); } }
public PlaceBingMapView UpdateBingView(PlaceBingMapView obj) { if (obj.MapTypeId == "a") { obj.MapTypeId = "aerial"; } if (obj.MapTypeId == "be") { obj.MapTypeId = "birdseye"; } if (obj.MapTypeId == "r") { obj.MapTypeId = "road"; } if (obj.CenterOffset == null) { obj.CenterOffset = string.Empty; } return(locBingViewRepo.Update(obj)); }
private NewPartnerCallViewModel PrepareNewCallViewData(CfCacheIndexEntry place) { var m = new NewPartnerCallViewModel() { ParnterCallPlaceID = place.ID, ForIndoor = true, ForOutdoor = true }; if (place.Type == CfType.Country) { ViewBag.PlaceDisallowed = true; ViewBag.Place = place; } else if (place.Type == CfType.Province) { var area = geoSvc.GetAreaByID(place.ID); ViewBag.PlaceDisallowed = true; ViewBag.Place = place; ViewBag.InterectingAreas = geoSvc.GetIntersectingAreas(area).Where(a => a.Type != CfType.Province && !a.DisallowPartnerCalls).ToList(); } else if (place.Type.ToPlaceCateogry() == PlaceCategory.Area) { ViewBag.PlaceType = "Area"; var area = geoSvc.GetAreaByID(place.ID); ViewBag.Place = area; if (area.DisallowPartnerCalls) { ViewBag.PlaceDisallowed = true; } else { var geoJsonUrl = Stgs.MapSvcRelativeUrl + "area/" + place.ID.ToString(); var mapModel = new Bing7GeoJsonMapViewModel("climbing-map-" + place.ID, 680, 400, geoJsonUrl); mapModel.ViewOptions = new Bing7MapViewOptionsViewModel(mappingSvc.GetBingViewByID(area.ID)); var mapItems = new MappingService().GetAreaEditMapItems(area); ViewBag.MapItemsArea = mapItems.Items[0]; mapItems.Items.RemoveAt(0); ViewBag.MapItemsLocations = mapItems.Items; ViewBag.MapModel = mapModel; } ViewBag.ChildLocations = geoSvc.GetGeoDeduciblePlaces(place).Where(p => p.Type.IsLocation()); ViewBag.InterectingAreas = geoSvc.GetIntersectingAreas(area).Where(a => a.Type != CfType.Province && !a.DisallowPartnerCalls).ToList(); } else if (place.Type.ToPlaceCateogry() == PlaceCategory.IndoorClimbing || place.Type.ToPlaceCateogry() == PlaceCategory.OutdoorClimbing) { ViewBag.PlaceType = "Location"; var location = geoSvc.GetLocationByID(place.ID); ViewBag.Place = location; if (location.IsIndoorClimbing) { m.ForOutdoor = false; } if (location.IsOutdoorClimbing) { m.ForIndoor = false; } var mapModel = new Bing7MapWithLocationViewModel(location.NameUrlPart, 732, 340, location.Latitude, location.Longitude, location.AvatarRelativeUrl); var mapViewSettings = mappingSvc.GetBingViewByID(location.ID); if (mapViewSettings == default(PlaceBingMapView)) { mapViewSettings = PlaceBingMapView.GetDefaultIndoorSettings(location); } mapModel.ViewOptions = new Bing7MapViewOptionsViewModel(mapViewSettings); ViewBag.LocationMapView = mapModel; ViewBag.InterectingAreas = geoSvc.GetIntersectingAreasOfPoint(location.Latitude, location.Longitude) .Where(a => a.Type != CfType.Province && !a.DisallowPartnerCalls).ToList(); } else { throw new ArgumentException("Place type [" + place.Type.ToString() + "] not supported for partner calls"); } return(m); }
public Bing7EditAreaMapViewModel(string mapId, int width, int height, PlaceBingMapView mapViewSettings) : base(mapId, width, height) { ViewOptions = new Bing7MapViewOptionsViewModel(mapViewSettings); }