本文整理汇总了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);
}
示例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();
}
示例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);
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}