Java Code Examples for com.mapbox.mapboxsdk.maps.MapView#onCreate()

The following examples show how to use com.mapbox.mapboxsdk.maps.MapView#onCreate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TabbedMainActivity.java    From ShapeOfView with Apache License 2.0 8 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.shape_of_view_tabbed_activity_main);
    ButterKnife.bind(this);
    Mapbox.getInstance(this, "pk.eyJ1IjoiY2hpY2tpbm5pY2siLCJhIjoiY2pka3U2YTdiMDE1YTJ4cjA0YzVyYnpoMSJ9.xlyPakmrR_N4bNqIGe6AKg");
    viewPager.setAdapter(new FakeAdapter(getSupportFragmentManager()));

    tabLayout.setupWithViewPager(viewPager);

    TabIndicatorFollower.setupWith(tabLayout, triangle);
    mapView = (MapView) findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);

    RxLifecycle.with(this).onResume().subscribe(event -> mapView.onResume());
    RxLifecycle.with(this).onPause().subscribe(event -> mapView.onPause());
    RxLifecycle.with(this).onStop().subscribe(event -> mapView.onStop());
    RxLifecycle.with(this).onDestroy().subscribe(event -> mapView.onDestroy());
}
 
Example 2
Source File: FillChangeActivity.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // configure initial map state
  MapboxMapOptions options = new MapboxMapOptions()
    .attributionTintColor(RED_COLOR)
    .compassFadesWhenFacingNorth(false)
    .camera(new CameraPosition.Builder()
      .target(new LatLng(45.520486, -122.673541))
      .zoom(12)
      .tilt(40)
      .build());

  // create map
  mapView = new MapView(this, options);
  mapView.setId(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(this);

  setContentView(mapView);
}
 
Example 3
Source File: MainActivity.java    From android with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    MapboxAccountManager.start(this, "Pon aqui tu token");

    setContentView(R.layout.activity_main);

    mapView = (MapView) findViewById(R.id.mapa);
    mapView.onCreate(savedInstanceState);
}