本文整理汇总了Java中com.mapbox.mapboxsdk.constants.Style类的典型用法代码示例。如果您正苦于以下问题:Java Style类的具体用法?Java Style怎么用?Java Style使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Style类属于com.mapbox.mapboxsdk.constants包,在下文中一共展示了Style类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOptionsItemSelected
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (buildingPlugin == null || mapboxMap == null) {
// map not ready yet
return super.onOptionsItemSelected(item);
}
switch (item.getItemId()) {
case R.id.menu_building_min_zoom:
buildingPlugin.setMinZoomLevel(14);
return true;
case R.id.menu_building_opacity:
buildingPlugin.setOpacity(1.0f);
return true;
case R.id.menu_building_color:
buildingPlugin.setColor(Color.RED);
return true;
case R.id.menu_building_style:
mapboxMap.setStyle(Style.DARK);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例2: onMapChangeLocationLayerRedrawn
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void onMapChangeLocationLayerRedrawn() throws Exception {
executeLocationLayerTest(new LocationLayerPluginAction.onPerformLocationLayerAction() {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
mapboxMap.setStyleUrl(Style.SATELLITE);
uiController.loopMainThreadForAtLeast(500);
assertEquals(locationLayerPlugin.getLocationLayerMode(), LocationLayerMode.TRACKING);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER).getVisibility().getValue()
.equals(Property.VISIBLE));
}
});
}
示例3: setMapTheme
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
public void setMapTheme() {
switch(getThemePreference())
{
case "streets":
mapView.setStyleUrl(Style.MAPBOX_STREETS);
break;
case "satellite":
mapView.setStyleUrl(Style.SATELLITE_STREETS);
break;
case "light":
mapView.setStyleUrl(Style.LIGHT);
break;
case "dark":
mapView.setStyleUrl(Style.DARK);
break;
}
}
示例4: selectStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
public void selectStyle(View view) {
fabMenu.collapse();
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
dialogBuilder.setItems(new CharSequence[]{"Streets", "Emerald", "Dark", "Light",
"Satellite"}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i == 0) {
mapView.setStyle(Style.MAPBOX_STREETS);
} else if (i == 1) {
mapView.setStyle(Style.EMERALD);
} else if (i == 2) {
mapView.setStyle(Style.DARK);
} else if (i == 3) {
mapView.setStyle(Style.LIGHT);
} else {
mapView.setStyle(Style.SATELLITE);
}
}
});
dialogBuilder.create().show();
}
示例5: onCreate
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的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);
}
示例6: reattachRouteSheildLayerWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachRouteSheildLayerWithLoadNewStyle() throws Exception {
executeNavigationMapRoute(new NavigationMapRouteAction.OnPerformNavigationMapRouteAction() {
@Override
public void onNavigationMapRouteAction(NavigationMapRoute navigationMapRoute, MapboxMap mapboxMap,
UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getLayer(GENERIC_ROUTE_SHIELD_LAYER_ID) != null);
}
});
}
示例7: reattachRouteLayerWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachRouteLayerWithLoadNewStyle() throws Exception {
executeNavigationMapRoute(new NavigationMapRouteAction.OnPerformNavigationMapRouteAction() {
@Override
public void onNavigationMapRouteAction(NavigationMapRoute navigationMapRoute, MapboxMap mapboxMap,
UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getLayer(GENERIC_ROUTE_LAYER_ID) != null);
}
});
}
示例8: reattachRouteSourceWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachRouteSourceWithLoadNewStyle() throws Exception {
executeNavigationMapRoute(new NavigationMapRouteAction.OnPerformNavigationMapRouteAction() {
@Override
public void onNavigationMapRouteAction(NavigationMapRoute navigationMapRoute, MapboxMap mapboxMap,
UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getSource(GENERIC_ROUTE_SOURCE_ID) != null);
}
});
}
示例9: onCreate
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_geojson);
ButterKnife.bind(this);
progressBar.getIndeterminateDrawable().setColorFilter(Color.RED,
android.graphics.PorterDuff.Mode.SRC_IN);
mapView.setStyleUrl(Style.MAPBOX_STREETS);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
}
示例10: onCreate
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cluster);
ButterKnife.bind(this);
mapView.setStyleUrl(Style.DARK);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
}
示例11: initSpinner
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
private void initSpinner() {
List<String> styles = new ArrayList<>();
styles.add(Style.MAPBOX_STREETS);
styles.add(Style.DARK);
styles.add(Style.LIGHT);
styles.add(Style.OUTDOORS);
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, styles);
spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
styleUrlView.setAdapter(spinnerArrayAdapter);
}
示例12: reattachLocalBaseWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachLocalBaseWithLoadNewStyle() throws Exception {
executeTrafficTest(new TrafficPluginAction.OnPerformTrafficAction() {
@Override
public void onTrafficAction(TrafficPlugin trafficPlugin, MapboxMap mapboxMap, UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getLayer(Local.BASE_LAYER_ID) != null);
}
});
}
示例13: reattachLocalCaseWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachLocalCaseWithLoadNewStyle() throws Exception {
executeTrafficTest(new TrafficPluginAction.OnPerformTrafficAction() {
@Override
public void onTrafficAction(TrafficPlugin trafficPlugin, MapboxMap mapboxMap, UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getLayer(Local.CASE_LAYER_ID) != null);
}
});
}
示例14: reattachSecondaryBaseWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachSecondaryBaseWithLoadNewStyle() throws Exception {
executeTrafficTest(new TrafficPluginAction.OnPerformTrafficAction() {
@Override
public void onTrafficAction(TrafficPlugin trafficPlugin, MapboxMap mapboxMap, UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getLayer(Secondary.BASE_LAYER_ID) != null);
}
});
}
示例15: reattachSecondaryCaseWithLoadNewStyle
import com.mapbox.mapboxsdk.constants.Style; //导入依赖的package包/类
@Test
public void reattachSecondaryCaseWithLoadNewStyle() throws Exception {
executeTrafficTest(new TrafficPluginAction.OnPerformTrafficAction() {
@Override
public void onTrafficAction(TrafficPlugin trafficPlugin, MapboxMap mapboxMap, UiController controller) {
mapboxMap.setStyleUrl(Style.DARK);
controller.loopMainThreadForAtLeast(500);
assertTrue(mapboxMap.getLayer(Secondary.CASE_LAYER_ID) != null);
}
});
}