当前位置: 首页>>代码示例>>Java>>正文


Java MapView类代码示例

本文整理汇总了Java中com.mapbox.mapboxsdk.maps.MapView的典型用法代码示例。如果您正苦于以下问题:Java MapView类的具体用法?Java MapView怎么用?Java MapView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MapView类属于com.mapbox.mapboxsdk.maps包,在下文中一共展示了MapView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the account manager
  setContentView(R.layout.activity_simple_mapview);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {

      // Customize map with markers, polylines, etc.
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:22,代码来源:SimpleMapViewActivity.java

示例2: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_style_language_switch);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      map = mapboxMap;

    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:22,代码来源:LanguageSwitchActivity.java

示例3: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_style_mapbox_studio);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {

      // Customize map with markers, polylines, etc.

    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:23,代码来源:MapboxStudioStyleActivity.java

示例4: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_style_default);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      DefaultStyleActivity.this.mapboxMap = mapboxMap;

      // customize map with markers, polylines, etc

    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:24,代码来源:DefaultStyleActivity.java

示例5: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_basic_simple_mapview);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {

      // Customize map with markers, polylines, etc.

    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:23,代码来源:SimpleMapViewActivity.java

示例6: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_marathon_extrusion);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      MarathonExtrusionActivity.this.mapboxMap = mapboxMap;

      // Add the marathon route source to the map
      GeoJsonSource courseRouteGeoJson = new GeoJsonSource("coursedata", loadJsonFromAsset("marathon_route.geojson"));
      mapboxMap.addSource(courseRouteGeoJson);
      addExtrusionsLayerToMap();
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:26,代码来源:MarathonExtrusionActivity.java

示例7: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_extrusion_rotation);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(@NonNull final MapboxMap map) {
      mapboxMap = map;
      setupBuildingExtrusionPlugin();
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:22,代码来源:RotationExtrusionActivity.java

示例8: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  setContentView(R.layout.activity_extrusion_light);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(@NonNull final MapboxMap map) {
      mapboxMap = map;
      setupBuildings();
      setupLight();
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:22,代码来源:AdjustExtrusionLightActivity.java

示例9: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_style_create_hotspots_points);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      addClusteredGeoJsonSource(mapboxMap);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:21,代码来源:CreateHotspotsActivity.java

示例10: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the account manager
  setContentView(R.layout.activity_style_rainfall);

  handler = new Handler();
  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(this);
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:17,代码来源:AddRainFallStyleActivity.java

示例11: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_simplify_polyline);

  mapView = (MapView) findViewById(R.id.mapview);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      map = mapboxMap;

      new DrawGeoJson().execute();

    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:24,代码来源:SimplifyPolylineActivity.java

示例12: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_mas_map_matching);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      map = mapboxMap;
      new DrawGeoJson().execute();
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:22,代码来源:MapMatchingActivity.java

示例13: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // Configure initial map state
  MapboxMapOptions options = new MapboxMapOptions()
    .attributionTintColor(RED_COLOR)
    .compassFadesWhenFacingNorth(false)
    .styleUrl(Style.MAPBOX_STREETS)
    .camera(new CameraPosition.Builder()
      .target(new LatLng(25.255377, 55.3089185))
      .zoom(11.86)
      .tilt(10)
      .build());

  mapView = new MapView(this, options);
  mapView.setId(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(this);
  setContentView(mapView);
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:26,代码来源:PolygonHolesActivity.java

示例14: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_annotation_polygon);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      drawPolygon(mapboxMap);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:21,代码来源:DrawPolygonActivity.java

示例15: onCreate

import com.mapbox.mapboxsdk.maps.MapView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Mapbox access token is configured here. This needs to be called either in your application
  // object or in the same activity which contains the mapview.
  Mapbox.getInstance(this, getString(R.string.access_token));

  // This contains the MapView in XML and needs to be called after the access token is configured.
  setContentView(R.layout.activity_annotation_marker);

  mapView = (MapView) findViewById(R.id.mapView);
  mapView.onCreate(savedInstanceState);
  mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(MapboxMap mapboxMap) {
      mapboxMap.addMarker(new MarkerOptions()
        .position(new LatLng(48.13863, 11.57603))
        .title(getString(R.string.draw_marker_options_title))
        .snippet(getString(R.string.draw_marker_options_snippet)));

    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:25,代码来源:DrawMarkerActivity.java


注:本文中的com.mapbox.mapboxsdk.maps.MapView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。