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); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_mapview_demo); mMapView = (MapView)FindViewById(Resource.Id.mapView); 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); }