Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            MbTilesSample.MbTilesLocation = MbTilesLocationOnAndroid;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(System.IO.Path.Combine(MbTilesLocationOnAndroid, s)));

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();

            Xamarin.Forms.Forms.Init();

            // Hack to tell the platform independent samples where the files can be found on iOS.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnWPF;
            // Never tested this. PDD.
            MbTilesHelper.DeployMbTilesFile(s => File.Create(System.IO.Path.Combine(MbTilesLocationOnWPF, s)));

            LoadApplication(new Mapsui.Samples.Forms.App());
        }
Пример #3
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            // Hack to tell the platform independent samples where the files can be found on iOS.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnIos;
            // Never tested this. PDD.
            MbTilesHelper.DeployMbTilesFile(s => File.Create(Path.Combine(MbTilesLocationOnIos, s)));

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Пример #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Hack to tell the platform independent samples where the files can be found on iOS.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnIos;
            // Never tested this. PDD.
            MbTilesHelper.DeployMbTilesFile(s => File.Create(Path.Combine(MbTilesLocationOnIos, s)));

            var mapControl = CreateMap(View.Bounds);

            mapControl.Info += MapOnInfo;
            View             = mapControl;
        }
Пример #5
0
        protected override void OnCreate(Bundle bundle)
        {
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this;

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            MbTilesSample.MbTilesLocation = MbTilesLocationOnAndroid;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(System.IO.Path.Combine(MbTilesLocationOnAndroid, s)));

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new Mapsui.Samples.Forms.App());
        }
Пример #6
0
        public MainPage()
        {
            InitializeComponent();

            // Hack to tell the platform independent samples where the files can be found on Android.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnUwp;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(Path.Combine(MbTilesLocationOnUwp, s)));

            MapControl.Map.Layers.Add(OpenStreetMap.CreateTileLayer());
            MapControl.RotationLock          = false;
            MapControl.UnSnapRotationDegrees = 30;
            MapControl.ReSnapRotationDegrees = 5;

            FillComboBoxWithDemoSamples();

            SampleSet.SelectionChanged += SampleSet_SelectionChanged;
        }
Пример #7
0
        public MainPage()
        {
            InitializeComponent();

            // Hack to tell the platform independent samples where the files can be found on Android.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnUwp;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(Path.Combine(MbTilesLocationOnUwp, s)));

            MapControl.Map !.Layers.Add(OpenStreetMap.CreateTileLayer());
            MapControl.Map !.RotationLock    = false;
            MapControl.UnSnapRotationDegrees = 30;
            MapControl.ReSnapRotationDegrees = 5;
            MapControl.Renderer.WidgetRenders[typeof(CustomWidget.CustomWidget)] = new CustomWidgetSkiaRenderer();

            CategoryComboBox.SelectionChanged += CategoryComboBoxSelectionChanged;

            FillComboBoxWithCategories();
            FillListWithSamples();
        }
Пример #8
0
        protected override void OnCreate(global::Android.OS.Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            // Hack to tell the platform independent samples where the files can be found on Android.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnAndroid;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(Path.Combine(MbTilesLocationOnAndroid, s)));

            _mapControl           = FindViewById <MapControl>(Resource.Id.mapcontrol);
            _mapControl.Map       = InfoLayersSample.CreateMap();
            _mapControl.Map.Info += MapOnInfo;
            _mapControl.Map.Viewport.ViewportChanged += ViewportOnViewportChanged;
            _mapControl.RotationLock          = false;
            _mapControl.UnSnapRotationDegrees = 30;
            _mapControl.ReSnapRotationDegrees = 5;

            FindViewById <RelativeLayout>(Resource.Id.mainLayout).AddView(_popup = CreatePopup());
        }
Пример #9
0
        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);

            // Hack to tell the platform independent samples where the files can be found on Android.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnAvalonia;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(Path.Combine(MbTilesLocationOnAvalonia, s)));

            MapControl.Map !.Layers.Add(OpenStreetMap.CreateTileLayer());
            MapControl.Map.RotationLock      = false;
            MapControl.UnSnapRotationDegrees = 30;
            MapControl.ReSnapRotationDegrees = 5;
            MapControl.Renderer.WidgetRenders[typeof(CustomWidget.CustomWidget)] = new CustomWidgetSkiaRenderer();

            RotationSlider.PointerMoved += RotationSliderOnPointerMoved;

            CategoryComboBox.SelectionChanged += CategoryComboBoxSelectionChanged;

            FillComboBoxWithCategories();
            FillListWithSamples();
        }
Пример #10
0
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            // Hack to tell the platform independent samples where the files can be found on Android.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnAndroid;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(System.IO.Path.Combine(MbTilesLocationOnAndroid, s)));

            _mapControl                       = FindViewById <MapControl>(Resource.Id.mapcontrol);
            _mapControl.Map                   = InfoLayersSample.CreateMap();
            _mapControl.Info                 += MapOnInfo;
            _mapControl.RotationLock          = false;
            _mapControl.UnSnapRotationDegrees = 30;
            _mapControl.ReSnapRotationDegrees = 5;

            FindViewById <RelativeLayout>(Resource.Id.mainLayout).AddView(_popup = CreatePopup());
        }
Пример #11
0
        protected override void OnCreate(Android.OS.Bundle?savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            var toolbar = FindViewById <AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            // Hack to tell the platform independent samples where the files can be found on Android.
            MbTilesSample.MbTilesLocation = MbTilesLocationOnAndroid;
            MbTilesHelper.DeployMbTilesFile(s => File.Create(System.IO.Path.Combine(MbTilesLocationOnAndroid, s)));

            _mapControl                       = FindViewById <MapControl>(Resource.Id.mapcontrol) ?? throw new NullReferenceException();
            _mapControl.Map                   = MbTilesSample.CreateMap();
            _mapControl.Info                 += MapOnInfo;
            _mapControl.Map.RotationLock      = true;
            _mapControl.UnSnapRotationDegrees = 30;
            _mapControl.ReSnapRotationDegrees = 5;
            _mapControl.Renderer.WidgetRenders[typeof(CustomWidget.CustomWidget)] = new CustomWidgetSkiaRenderer();

            var relativeLayout = FindViewById <RelativeLayout>(Resource.Id.mainLayout) ?? throw new NullReferenceException();;

            _popup?.Dispose();
            relativeLayout.AddView(_popup = CreatePopup());
            _mapControl.Map.Layers.Clear();
            var sample = new MbTilesOverlaySample();

            Catch.Exceptions(async() =>
            {
                await sample.SetupAsync(_mapControl);
            });

            //_mapControl.Info += MapControlOnInfo;
            //LayerList.Initialize(_mapControl.Map.Layers);
        }