public override View OnCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { var locationService = TinyIoCContainer.Current.Resolve <ILocationService>(); var initialPosition = locationService.GetInitialPosition(); Map = new MapView(Activity.ApplicationContext, TinyIoCContainer.Current.Resolve <IAppSettings>().Data.MapBoxKey); Map.OnCreate(savedInstanceState); Map.SetLogoVisibility((int)ViewStates.Gone); Map.SetAttributionVisibility((int)ViewStates.Gone); Map.StyleUrl = Com.Mapbox.Mapboxsdk.Constants.Style.MapboxStreets; Map.SetCenterCoordinate(new LatLngZoom(new LatLng(initialPosition.Latitude, initialPosition.Longitude), 12f), true); // disable gestures on the map since we're handling them ourselves Map.CompassEnabled = false; Map.ZoomEnabled = false; Map.RotateEnabled = false; Map.ScrollEnabled = false; Surface = new TouchableWrapper(Activity); Surface.AddView(Map); return(Surface); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { mOriginalContentView = base.OnCreateView(inflater, parent, savedInstanceState); var locationService = TinyIoCContainer.Current.Resolve <ILocationService>(); var initialPosition = locationService.GetInitialPosition(); Map.MapType = GoogleMap.MapTypeNormal; Map.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(initialPosition.Latitude, initialPosition.Longitude), 12f)); // disable gestures on the map since we're handling them ourselves Map.UiSettings.CompassEnabled = false; Map.UiSettings.ZoomControlsEnabled = false; Map.UiSettings.ZoomGesturesEnabled = false; Map.UiSettings.RotateGesturesEnabled = false; Map.UiSettings.TiltGesturesEnabled = false; Map.UiSettings.ScrollGesturesEnabled = false; Surface = new TouchableWrapper(Activity); Surface.AddView(mOriginalContentView); return(Surface); }