예제 #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <FCCMapBox> e)
        {
            base.OnElementChanged(e);

            MapboxMapOptions options = new MapboxMapOptions();

            options.InvokeScrollGesturesEnabled(true);
            options.InvokeRotateGesturesEnabled(true);
            options.InvokeTiltGesturesEnabled(true);
            options.InvokeZoomGesturesEnabled(true);

            _MapView = new MapView(Context, options);
            _MapView.OnCreate(null);
            _MapView.SetStyle(Mapbox.Constants.Style.MapboxStreets);
            _MapView.GetMapAsync();
            SetNativeControl(_MapView);
        }
        protected override async void OnElementChanged(ElementChangedEventArgs <MapBoxControl> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                //MapboxAccountManager.Start(Context, "pk.eyJ1IjoidmVzc2VsYXBwIiwiYSI6ImNqZml0ems1YzBndDcyenFxdTFmbXFya3EifQ.O2v_RvniaVAkYE3rQVjw3A");

                MapboxMapOptions options = new MapboxMapOptions();
                options.InvokeScrollGesturesEnabled(true);
                options.InvokeRotateGesturesEnabled(true);
                options.InvokeTiltGesturesEnabled(true);
                options.InvokeZoomGesturesEnabled(true);

                Map          = new MapView(Context, options);
                Map.StyleUrl = "mapbox://styles/vesselapp/cjfj2i5rgcq8t2rqgj5spfzvk";
                Map.OnCreate(null);
                Map.GetMap(this);

                SetNativeControl(Map);
            }
        }