private void AddObjectToScroll(ObjectData mmo) { Debug.Log(":AddObjectToScroll " + (mmo != null ? JsonUtility.ToJson(mmo) : "null")); GameObject panel = Instantiate(prefab); Debug.Log("panel: " + (panel == null ? "null" : "found")); panel.transform.SetParent(scrollContent, false); var ctrl = panel.GetComponent <DisplayController>(); Debug.Log("ctrl " + (ctrl == null ? "Null" : "received")); ctrl.SetTitle(string.Format("Result: {0}", mmo.Id)); Debug.Log("initalGeoLoc: " + (initialGeoLocation == null ? "null" : "present")); var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); double dist = Utilities.HaversineDistance(lat, lon, initialGeoLocation.latitude, initialGeoLocation.longitude); string footerText = string.Format("Distance: {0}m\nDate: {1}", Round(dist), FormatDate(mmo)); ctrl.SetFooter(footerText); ctrl.LoadImageFromWeb(TemporaryCompatUtils.GetThumbnailUrl(mmo)); ctrl.Mmo = mmo; ctrl.UiManager = this; ctrl.Controller = controller; }
public void Present(ObjectData mmo) { DisplayInfo(mmo); imagePresenter.LoadImage(TemporaryCompatUtils.GetThumbnailUrl(mmo)); active = mmo; titleLabel.text = "Result " + mmo.Id; // TODO re-introduce rank }
public void Present(ObjectData mmo, bool loadInRange = true) { Debug.Log("Presenting " + mmo.Id); //panelSwitcher.SwitchToDisplay(); panelManager.ShowPanel("display"); presenter.LoadImage(TemporaryCompatUtils.GetImageUrl(mmo)); logger.Debug("URL: " + TemporaryCompatUtils.GetImageUrl(mmo)); alphaController.SetAlpha(0.5f); if (controller.GetHeading(mmo) != -1) { headingDisplay.targetHeading = controller.GetHeading(mmo); } infoText.text = string.Format("ID: {0}\nDate: {1}", mmo.Id, FormatDate(mmo)); activeMmo = mmo; if (loadInRange) { Debug.Log("LOAD IN RANGE"); List <ObjectData> inRangeList = controller.GetInRange(activeMmo); temporalSlider.Setup(inRangeList, activeMmo); // ArgumentNull in DatetimeParser, parameter name s } controller.StopLocationServices(); // TODO Remove activeMMO and restart location service }