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


Java Basemap.createLightGrayCanvas方法代码示例

本文整理汇总了Java中com.esri.arcgisruntime.mapping.Basemap.createLightGrayCanvas方法的典型用法代码示例。如果您正苦于以下问题:Java Basemap.createLightGrayCanvas方法的具体用法?Java Basemap.createLightGrayCanvas怎么用?Java Basemap.createLightGrayCanvas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.esri.arcgisruntime.mapping.Basemap的用法示例。


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

示例1: onCreate

import com.esri.arcgisruntime.mapping.Basemap; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  MapView mapView = (MapView)findViewById(R.id.mapView);

  // create ArcGISMap with topographic basemap
  ArcGISMap map = new ArcGISMap(Basemap.createLightGrayCanvas());
  mapView.setMap(map);

  // create graphics overlays to show the inputs and results of the spatial operation
  mapView.getGraphicsOverlays().add(inputGeometryOverlay);
  mapView.getGraphicsOverlays().add(resultGeometryOverlay);

  // create input polygons and add graphics to display these polygons in an overlay
  createPolygons();

  // center the map view on the input geometries
  Geometry viewpointGeom = GeometryEngine.union(inputPolygon1, inputPolygon2).getExtent();
  mapView.setViewpointGeometryAsync(viewpointGeom, 20);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:23,代码来源:MainActivity.java

示例2: onCreate

import com.esri.arcgisruntime.mapping.Basemap; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // inflate MapView from layout
    mMapView = (MapView) findViewById(R.id.mapView);

    // create a map with the light grey canvas basemap
    ArcGISMap map = new ArcGISMap(Basemap.createLightGrayCanvas());
    //set an initial viewpoint
    map.setInitialViewpoint( new Viewpoint(new Envelope(-1.30758164047166E7, 4014771.46954516, -1.30730056797177E7
            , 4016869.78617381, SpatialReferences.getWebMercator() )));


    // create feature layer with its service feature table
    // create the service feature table
    ServiceFeatureTable serviceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.sample_service_url));

    //explicitly set the mode to on interaction cache (which is also the default mode for service feature tables)
    serviceFeatureTable.setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode.ON_INTERACTION_CACHE);

    // create the feature layer using the service feature table
    FeatureLayer featureLayer = new FeatureLayer(serviceFeatureTable);

    // add the layer to the map
    map.getOperationalLayers().add(featureLayer);

    // set the map to be displayed in the mapview
    mMapView.setMap(map);

}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:33,代码来源:MainActivity.java

示例3: start

import com.esri.arcgisruntime.mapping.Basemap; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {

  try {
    // create stack pane and application scene
    StackPane stackPane = new StackPane();
    Scene scene = new Scene(stackPane);

    // size the stage, add a title, and set scene to stage
    stage.setTitle("Service Feature Table Cache Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(scene);
    stage.show();

    // create a view for this ArcGISMap
    mapView = new MapView();

    // create a ArcGISMap with the light Gray Canvas basemap
    ArcGISMap map = new ArcGISMap(Basemap.createLightGrayCanvas());

    // set an initial viewpoint
    map.setInitialViewpoint(new Viewpoint(new Envelope(-1.30758164047166E7, 4014771.46954516, -1.30730056797177E7,
        4016869.78617381, 0, 0, SpatialReferences.getWebMercator())));

    // create feature layer with its service feature table
    // create the service feature table
    ServiceFeatureTable serviceFeatureTable = new ServiceFeatureTable(FEATURE_SERVICE_URL);

    // explicitly set the mode to on interaction cache (which is also
    // the default mode for service feature tables)
    serviceFeatureTable.setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode.ON_INTERACTION_CACHE);

    // create the feature layer using the service feature table
    FeatureLayer featureLayer = new FeatureLayer(serviceFeatureTable);

    // add the layer to the ArcGISMap
    map.getOperationalLayers().add(featureLayer);

    // set ArcGISMap to be displayed in ArcGISMap view
    mapView.setMap(map);

    // add the map view to stack pane
    stackPane.getChildren().addAll(mapView);

  } catch (Exception e) {
    // on any error, display stack trace
    e.printStackTrace();
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:51,代码来源:ServiceFeatureTableCacheSample.java

示例4: loadMap

import com.esri.arcgisruntime.mapping.Basemap; //导入方法依赖的package包/类
/**
 * add a load status change listener on the loadable Map and display the map load status
 */
private void loadMap() {

    //clear the current map load status of the TextView
    mMapLoadStatusTextView.setText("");
    // create a map with the BasemapType National Geographic
    ArcGISMap map = new ArcGISMap(Basemap.createLightGrayCanvas());

    // Listener on change in map load status
    map.addLoadStatusChangedListener(new LoadStatusChangedListener() {
        @Override
        public void loadStatusChanged(LoadStatusChangedEvent loadStatusChangedEvent) {
            String mapLoadStatus;
            mapLoadStatus = loadStatusChangedEvent.getNewLoadStatus().name();
            // map load status can be any of LOADING, FAILED_TO_LOAD, NOT_LOADED or LOADED
            // set the status in the TextView accordingly
            switch (mapLoadStatus) {
                case "LOADING":
                    mMapLoadStatusTextView.setText(R.string.status_loading);
                    mMapLoadStatusTextView.setTextColor(Color.BLUE);
                    break;

                case "FAILED_TO_LOAD":
                    mMapLoadStatusTextView.setText(R.string.status_loadFail);
                    mMapLoadStatusTextView.setTextColor(Color.RED);
                    break;

                case "NOT_LOADED":
                    mMapLoadStatusTextView.setText(R.string.status_notLoaded);
                    mMapLoadStatusTextView.setTextColor(Color.GRAY);
                    break;

                case "LOADED":
                    mMapLoadStatusTextView.setText(R.string.status_loaded);
                    mMapLoadStatusTextView.setTextColor(Color.GREEN);
                    break;

                default :
                    mMapLoadStatusTextView.setText(R.string.status_loadError);
                    mMapLoadStatusTextView.setTextColor(Color.WHITE);
                    break;
            }

            Log.d(TAG,mapLoadStatus);
        }
    });
    // set the map to be displayed in this view
    mMapView.setMap(map);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:52,代码来源:MainActivity.java


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