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


Java Style类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:26,代码来源:BuildingActivity.java

示例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));
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:18,代码来源:LocationLayerTest.java

示例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;
    }
}
 
开发者ID:DaylightingSociety,项目名称:WhereAreTheEyes,代码行数:18,代码来源:MainActivity.java

示例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();
}
 
开发者ID:captswag,项目名称:mapbox-bing-demo,代码行数:23,代码来源:MainActivity.java

示例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);
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:26,代码来源:PolygonHolesActivity.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:13,代码来源:NavigationMapRouteTest.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:13,代码来源:NavigationMapRouteTest.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:13,代码来源:NavigationMapRouteTest.java

示例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);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:12,代码来源:GeoJsonActivity.java

示例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);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:11,代码来源:MarkerClusterActivity.java

示例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);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:11,代码来源:OfflineDownloadActivity.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:12,代码来源:TrafficPluginTest.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:12,代码来源:TrafficPluginTest.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:12,代码来源:TrafficPluginTest.java

示例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);
    }
  });
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:12,代码来源:TrafficPluginTest.java


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