protected override void OnCreate(Bundle savedInstanceState)
        {
            Log.Debug(TAG, "OnCreate: ");
            base.OnCreate(savedInstanceState);

            HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions();

            huaweiMapOptions.InvokeCompassEnabled(true);
            huaweiMapOptions.InvokeZoomControlsEnabled(true);
            huaweiMapOptions.InvokeScrollGesturesEnabled(true);
            huaweiMapOptions.InvokeZoomGesturesEnabled(true);

            mMapView = new MapView(this, huaweiMapOptions);
            Bundle mapViewBundle = null;

            if (savedInstanceState != null)
            {
                mapViewBundle = savedInstanceState.GetBundle(MAPVIEW_BUNDLE_KEY);
            }
            // please replace "Your API key" with api_key field value in
            // agconnect-services.json if the field is null.
            MapsInitializer.SetApiKey(Constants.API_KEY);
            mMapView.OnCreate(mapViewBundle);
            mMapView.GetMapAsync(this);

            SetContentView(mMapView);
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Log.Debug(TAG, "OnCreate: ");
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_mapfragmentcode_demo);
            HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions();

            huaweiMapOptions.InvokeCompassEnabled(true);
            huaweiMapOptions.InvokeZoomGesturesEnabled(true);
            mMapFragment = MapFragment.NewInstance(huaweiMapOptions);
            FragmentManager     fragmentManager     = FragmentManager;
            FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();

            fragmentTransaction.Add(Resource.Id.frame_mapfragmentcode, mMapFragment);
            fragmentTransaction.Commit();

            mMapFragment.GetMapAsync(this);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Log.Debug(TAG, "OnCreate: ");
            base.OnCreate(savedInstanceState);

            HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions();

            huaweiMapOptions.InvokeLiteMode(true);
            huaweiMapOptions.InvokeCompassEnabled(true);
            huaweiMapOptions.InvokeZoomControlsEnabled(true);
            huaweiMapOptions.InvokeScrollGesturesEnabled(true);
            huaweiMapOptions.InvokeZoomGesturesEnabled(true);
            mMapView = new MapView(this, huaweiMapOptions);
            Bundle mapViewBundle = null;

            if (savedInstanceState != null)
            {
                mapViewBundle = savedInstanceState.GetBundle(MAPVIEW_BUNDLE_KEY);
            }

            mMapView.OnCreate(mapViewBundle);
            mMapView.GetMapAsync(this);
            SetContentView(mMapView);
        }