private void IsBlockedSwitchOnToggled(object sender, ToggledEventArgs toggledEventArgs) { if (toggledEventArgs.Value) { _image.IsVisible = false; _pan.PanUpdated += OnPanUpdated; _panoramaLayout = new StackLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, GestureRecognizers = { _pan } }; var filePath = (BindingContext as ViewerImage).FilePath; _panorama = new PanoramaView { FieldOfView = 75.0f, Image = filePath.Contains("http") ? (PanoramaImageSource) new PanoramaUriImageSource(new Uri(filePath)) : (PanoramaImageSource) new PanoramaFileSystemImageSource(filePath), Yaw = 0, Pitch = 0, BackgroundColor = Color.Aquamarine, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, InputTransparent = true }; _panoramaLayout.Children.Add(_panorama); _stackLayout.Children.Insert(0, _panoramaLayout); } else { _panoramaLayout.IsVisible = false; _image.IsVisible = true; if (_panoramaLayout.GestureRecognizers.Any()) { _pan.PanUpdated -= OnPanUpdated; foreach (var gesture in _panoramaLayout.GestureRecognizers.ToArray()) { _panoramaLayout.GestureRecognizers.Remove(gesture); } } _panorama?.Dispose(); _panoramaLayout.Children.Remove(_panorama); _stackLayout.Children.Remove(_panoramaLayout); } Viewer.ToggleIsSwipeEnabled(); }
public override void ViewDidLoad() { base.ViewDidLoad(); _panoramaView = new PanoramaView { EnableCardboardButton = true, EnableFullscreenButton = true, EnableTouchTracking = true }; View.Add(_panoramaView); }
public override void ViewDidLoad () { base.ViewDidLoad (); var panoView = new PanoramaView (); panoView.MoveNearCoordinate (location); View = panoView; #if !DEBUG Xamarin.Insights.Track ("AppNav", new Dictionary<string,string> { { "page", "panorama" } }); #endif }
public override void ViewDidLoad() { base.ViewDidLoad(); var panoView = new PanoramaView(); panoView.MoveNearCoordinate(location); View = panoView; #if !DEBUG Xamarin.Insights.Track("AppNav", new Dictionary <string, string> { { "page", "panorama" } }); #endif }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //先初始化BMapManager DemoApplication app = (DemoApplication)this.Application; if (app.mBMapManager == null) { app.mBMapManager = new BMapManager(this); app.mBMapManager.Init( new DemoApplication.MyGeneralListener()); } SetContentView(Resource.Layout.activity_panorama_main); mPanoramaView = FindViewById<PanoramaView>(Resource.Id.panorama); //UI初始化 mBtn = FindViewById<Button>(Resource.Id.button); mBtn.Visibility = ViewStates.Invisible; //道路名 mRoadName = FindViewById<TextView>(Resource.Id.road); mRoadName.Visibility = ViewStates.Visible; mRoadName.Text = "百度全景"; mRoadName.SetBackgroundColor(Color.Argb(200, 5, 5, 5)); //背景透明度 mRoadName.SetTextColor(Color.Argb(255, 250, 250, 250)); //文字透明度 mRoadName.TextSize = 22; //跳转进度条 pd = new ProgressDialog(this); pd.SetMessage("跳转中……"); pd.SetCancelable(true);//设置进度条是否可以按退回键取消 //初始化Searvice mService = PanoramaService.GetInstance(ApplicationContext); mCallback = new IPanoramaServiceCallbackImpl(this); //设置全景图监听 mPanoramaView.SetPanoramaViewListener(this); //解析输入 ParseInput(); }
public MyOverlay(PanoramaDemoActivityMain panoramaDemoActivityMain, Drawable defaultMarker, PanoramaView mapView) : base(defaultMarker, mapView) { this.panoramaDemoActivityMain = panoramaDemoActivityMain; }
public virtual async void LoadImageInto(ImageSource imageSource, PanoramaView panoramaView, PanoramaImageType imageType) { var image = await LoadImageFromImageSource(imageSource); panoramaView.LoadImage(image, imageType); }