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


Java ArcGISMap.setMinScale方法代码示例

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


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

示例1: start

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入方法依赖的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);

    // set title, size, and add scene to stage
    stage.setTitle("Min Max Scale Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(scene);
    stage.show();

    // create a ArcGISMap with basemap streets
    ArcGISMap map = new ArcGISMap(Basemap.createStreets());

    // set the scale at which this layer can be viewed
    map.setMinScale(8000);
    map.setMaxScale(2000);

    // create a view for this ArcGISMap and set ArcGISMap to it
    mapView = new MapView();
    mapView.setMap(map);

    // a point where the map view will focus and zoom to
    mapView.setViewpoint(new Viewpoint(new Point(-355453, 7548720, SpatialReferences.getWebMercator()), 3000));

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

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

示例2: onCreate

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

  // define permission to request
  String[] reqPermission = new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE };
  int requestCode = 2;
  // For API level 23+ request permission at runtime
  if (ContextCompat.checkSelfPermission(MainActivity.this, reqPermission[0]) != PackageManager.PERMISSION_GRANTED) {
    // request permission
    ActivityCompat.requestPermissions(MainActivity.this, reqPermission, requestCode);
  }

  mProgressLayout = (RelativeLayout) findViewById(R.id.progressLayout);
  mProgressTextView = (TextView) findViewById(R.id.progress_text_view);
  mProgressBar = (ProgressBar) findViewById(R.id.taskProgressBar);
  mTileCachePreviewLayout = (ConstraintLayout) findViewById(R.id.mapPreviewLayout);
  mPreviewMask = findViewById(R.id.previewMask);

  mTileCachePreview = (MapView) findViewById(R.id.previewMapView);
  mMapView = (MapView) findViewById(R.id.mapView);

  mTiledLayer = new ArcGISTiledLayer(getString(R.string.world_street_map));
  ArcGISMap map = new ArcGISMap();
  map.setBasemap(new Basemap(mTiledLayer));
  // set a min scale to avoid instance of downloading a tile cache that is too big
  map.setMinScale(10000000);
  mMapView.setMap(map);
  mMapView.setViewpoint(new Viewpoint(51.5, 0.0, 10000000));

  createExportTilesButton();
  createPreviewCloseButton();

  // run cancel download once to clear map preview and progress bar
  cancelDownload();
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:38,代码来源:MainActivity.java


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