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


Java LocationLayerMode类代码示例

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


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

示例1: onMapReady

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressLint("MissingPermission")
@Override
public void onMapReady(MapboxMap mapboxMap) {
  this.mapboxMap = mapboxMap;
  mapboxMap.setOnMapClickListener(this);

  locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, null);
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.NAVIGATION);

  // Setup the mockLocationEngine
  mockLocationEngine = new MockLocationEngine(1000, 30, false);
  mockLocationEngine.addLocationEngineListener(this);
  navigation.setLocationEngine(mockLocationEngine);

  // Acquire the navigation route
  getRoute(origin, destination, null);
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:18,代码来源:RerouteActivity.java

示例2: onMapReady

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@Override
public void onMapReady(MapboxMap mapboxMap) {
  this.mapboxMap = mapboxMap;

  locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, null);
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.NAVIGATION);

  navigationMapRoute = new NavigationMapRoute(navigation, mapView, mapboxMap);

  mapboxMap.setOnMapClickListener(this);
  Snackbar.make(mapView, "Tap map to place waypoint", BaseTransientBottomBar.LENGTH_LONG).show();

  locationEngine = new MockLocationEngine(1000, 50, true);
  mapboxMap.setLocationSource(locationEngine);

  newOrigin();
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:18,代码来源:MockNavigationActivity.java

示例3: onMapReady

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@Override
public void onMapReady(final MapboxMap mapboxMap) {
  LocationEngine locationEngine = new LostLocationEngine(this);
  locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, locationEngine);
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.COMPASS);
  locationLayerPlugin.addCompassListener(new CompassListener() {
    @Override
    public void onCompassChanged(float userHeading) {
      CameraPosition cameraPosition = new CameraPosition.Builder().bearing(userHeading).build();
      mapboxMap.easeCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
    }

    @Override
    public void onCompassAccuracyChange(int compassStatus) {
      System.out.println(compassStatus);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:19,代码来源:CompassListenerActivity.java

示例4: initLocationLayer

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
/**
 * Initializes the {@link LocationLayerPlugin} to be used to draw the current
 * location.
 */
@SuppressWarnings( {"MissingPermission"})
private void initLocationLayer() {
  int locationLayerStyleRes = ThemeSwitcher.retrieveNavigationViewStyle(getContext(),
    R.attr.navigationViewLocationLayerStyle);
  locationLayer = new LocationLayerPlugin(mapView, map, null, locationLayerStyleRes);
  locationLayer.setLocationLayerEnabled(LocationLayerMode.NAVIGATION);
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:12,代码来源:NavigationView.java

示例5: onMapReady

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@Override
@SuppressWarnings( {"MissingPermission"})
public void onMapReady(MapboxMap mapboxMap) {
  this.mapboxMap = mapboxMap;
  locationEngine = new LostLocationEngine(this);
  locationEngine.addLocationEngineListener(this);
  locationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY);
  locationEngine.activate();
  locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, null);
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
  getLifecycle().addObserver(locationLayerPlugin);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:13,代码来源:ManualLocationUpdatesActivity.java

示例6: onMapReady

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@Override
public void onMapReady(MapboxMap mapboxMap) {
  this.mapboxMap = mapboxMap;
  locationEngine = LostLocationEngine.getLocationEngine(this);
  locationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY);
  locationEngine.activate();
  locationPlugin = new LocationLayerPlugin(mapView, mapboxMap, locationEngine);
  locationPlugin.setLocationLayerEnabled(LocationLayerMode.COMPASS);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:10,代码来源:LocationLayerMapChangeActivity.java

示例7: locationModeNone

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressWarnings( {"MissingPermission"})
@OnClick(R.id.button_location_mode_none)
public void locationModeNone(View view) {
  if (locationLayerPlugin == null) {
    return;
  }
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.NONE);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:9,代码来源:LocationLayerModesActivity.java

示例8: locationModeCompass

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressWarnings( {"MissingPermission"})
@OnClick(R.id.button_location_mode_compass)
public void locationModeCompass(View view) {
  if (locationLayerPlugin == null) {
    return;
  }
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.COMPASS);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:9,代码来源:LocationLayerModesActivity.java

示例9: locationModeTracking

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressWarnings( {"MissingPermission"})
@OnClick(R.id.button_location_mode_tracking)
public void locationModeTracking(View view) {
  if (locationLayerPlugin == null) {
    return;
  }
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:9,代码来源:LocationLayerModesActivity.java

示例10: locationModeNavigation

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressWarnings( {"MissingPermission"})
@OnClick(R.id.button_location_mode_navigation)
public void locationModeNavigation(View view) {
  if (locationLayerPlugin == null) {
    return;
  }
  locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.NAVIGATION);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:9,代码来源:LocationLayerModesActivity.java

示例11: enableLocationPlugin

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressWarnings( {"MissingPermission"})
private void enableLocationPlugin() {
  // Check if permissions are enabled and if not request
  if (PermissionsManager.areLocationPermissionsGranted(this)) {
    // Create an instance of LOST location engine
    initializeLocationEngine();

    locationPlugin = new LocationLayerPlugin(mapView, mapboxMap, locationEngine);
    locationPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
  } else {
    permissionsManager = new PermissionsManager(this);
    permissionsManager.requestLocationPermissions(this);
  }
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:15,代码来源:LocationPluginActivity.java

示例12: initLocationLayer

import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerMode; //导入依赖的package包/类
@SuppressWarnings( {"MissingPermission"})
private void initLocationLayer() {
  locationLayer = new LocationLayerPlugin(mapView, mapboxMap, locationEngine);
  locationLayer.setLocationLayerEnabled(LocationLayerMode.COMPASS);
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:6,代码来源:NavigationViewActivity.java


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