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


Java ArcGISMap类代码示例

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


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

示例1: start

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
 * Start by setting the map up and
 * adding the tiled layer for the EMU polygons
 */
@Override public void start() {
  // Show a dialog while the map loads
  String DIALOG_TITLE = "EMU Map Loading";
  String DIALOG_MESSAGE = "Rounding up the EMUs...";
  mMapView.showProgressBar(DIALOG_MESSAGE, DIALOG_TITLE);
  int ZOOM_LEVEL = 1;
  final ArcGISMap map =  new ArcGISMap(Basemap.Type.OCEANS, 0, 0, ZOOM_LEVEL);
  mMapView.setUpMap(map);

  // EMU Ocean Surface
  String TILED_LAYER_URL = "http://esri.maps.arcgis.com/home/item.html?id=d2db1dbd6d2742a38fe69506029b83ac";
  mSurfaceLayer = new ArcGISTiledLayer(TILED_LAYER_URL);
  mMapView.addLayer(mSurfaceLayer);

  cacheInitialDepthLayer();
}
 
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:21,代码来源:MapPresenter.java

示例2: onCreate

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

    // inflate MapView from layout
    mMapView = (MapView) findViewById(R.id.mapViewLayout);
    // create new Tiled Layer from service url
    ArcGISTiledLayer tiledLayerBaseMap = new ArcGISTiledLayer(getResources().getString(R.string.world_topo_service));
    // set tiled layer as basemap
    Basemap basemap = new Basemap(tiledLayerBaseMap);
    // create a map with the basemap
    ArcGISMap map = new ArcGISMap(basemap);
    // set the map to be displayed in this view
    mMapView.setMap(map);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:17,代码来源:MainActivity.java

示例3: onBindViewHolder

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
 * Called by RecyclerView to display the data at the specified position.
 * @param holder RecycleViewHolder
 * @param position - int
 */
@Override final public void onBindViewHolder(final RecycleViewHolder holder, final int position) {
  holder.mapName.setText("Map "+ (position+1));
  final ArcGISMap map = maps.get(position);
  // Wait for the map to load before getting the Item
  map.addDoneLoadingListener(new Runnable() {
    @Override public void run() {
      final Item i = map.getItem();
      if (i != null){
        holder.bind(i, mListener);
      }

    }
  });
  map.loadAsync();
}
 
开发者ID:Esri,项目名称:mapbook-android,代码行数:21,代码来源:MapbookAdapter.java

示例4: initialize

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
@FXML
private void initialize() {
  // load a portal for arcgis.com
  portal = new Portal("http://arcgis.com");
  portal.loadAsync();

  resultsList.setCellFactory(c -> new PortalItemCell());

  // show the selected webmap in a mapview
  resultsList.getSelectionModel().selectedItemProperty().addListener(o -> {
    PortalItem webmap = resultsList.getSelectionModel().getSelectedItem();
    if (webmap != null) {
      webmap.loadAsync();
      mapView.setMap(new ArcGISMap(webmap));
      // check if webmap supported
      mapView.getMap().addDoneLoadingListener(() -> {
        if (mapView.getMap().getLoadError() != null) {
          showMessage("Unable to load map", mapView.getMap().getLoadError().getMessage(), Alert.AlertType.ERROR);
        }
      });
    }
  });
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:24,代码来源:WebmapKeywordSearchController.java

示例5: onCreate

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的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 BasemapType topographic
    ArcGISMap map = new ArcGISMap(Basemap.Type.OCEANS, 56.075844, -2.681572, 11);
    // set the map to be displayed in this view
    mMapView.setMap(map);
    // add graphics overlay to MapView.
    GraphicsOverlay graphicsOverlay = addGraphicsOverlay(mMapView);
    //add some buoy positions to the graphics overlay
    addBuoyPoints(graphicsOverlay);
    //add boat trip polyline to graphics overlay
    addBoatTrip(graphicsOverlay);
    //add nesting ground polygon to graphics overlay
    addNestingGround(graphicsOverlay);
    //add text symbols and points to graphics overlay
    addText(graphicsOverlay);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:23,代码来源:MainActivity.java

示例6: onCreate

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的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 Basemap Type topographic
    ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 48.354406, -99.998267, 2);
    // create a MapImageLayer with dynamically generated map images
    mMapImageLayer = new ArcGISMapImageLayer(getResources().getString(R.string.world_cities_service));
    mMapImageLayer.setOpacity(0.5f);
    // add world cities layers as map operational layer
    map.getOperationalLayers().add(mMapImageLayer);
    // set the map to be displayed in this view
    mMapView.setMap(map);
    // get the layers from the map image layer
    mLayers = mMapImageLayer.getSublayers();

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

示例7: onCreate

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的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 MapImageLayer with dynamically generated map images
    ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(getResources().getString(R.string.world_elevation_service));
    // create an empty map instance
    ArcGISMap map = new ArcGISMap();
    // add map image layer as operational layer
    map.getOperationalLayers().add(mapImageLayer);
    // set the map to be displayed in this view
    mMapView.setMap(map);

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

示例8: onCreate

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

示例9: loadRaster

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
 * Loads Shasta.tif as a Raster and adds it to a new RasterLayer. The RasterLayer is then added
 * to the map as an operational layer. Map viewpoint is then set based on the Raster's geometry.
 */
private void loadRaster() {
    // create a raster from a local raster file
    Raster raster = new Raster(buildRasterPath());
    // create a raster layer
    final RasterLayer rasterLayer = new RasterLayer(raster);
    // create a Map with imagery basemap
    ArcGISMap map = new ArcGISMap(Basemap.createImagery());
    // add the map to a map view
    mMapView.setMap(map);
    // add the raster as an operational layer
    map.getOperationalLayers().add(rasterLayer);
    // set viewpoint on the raster
    rasterLayer.addDoneLoadingListener(new Runnable() {
        @Override
        public void run() {
            mMapView.setViewpointGeometryAsync(rasterLayer.getFullExtent(), 50);
        }
    });
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:24,代码来源:MainActivity.java

示例10: onCreate

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的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 new Tiled Layer from service url
    ArcGISTiledLayer mTopoBasemap = new ArcGISTiledLayer(getResources().getString(R.string.world_topo_service));
    // set tiled layer as basemap
    Basemap mBasemap = new Basemap(mTopoBasemap);
    // create a map with the basemap
    ArcGISMap mMap = new ArcGISMap(mBasemap);

    // create an initial extent envelope
    Envelope mInitExtent = new Envelope(-12211308.778729, 4645116.003309, -12208257.879667, 4650542.535773, SpatialReference.create(102100));
    // create a viewpoint from envelope
    Viewpoint vp = new Viewpoint(mInitExtent);
    // set initial map extent
    mMap.setInitialViewpoint(vp);

    // set the map to be displayed in this view
    mMapView.setMap(mMap);

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

示例11: hillshadeRenderer

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
 * Creates a new Raster based on a given path and adds it to a RasterLayer which is added to an
 * ArcGISMap as an operational layer.
 */
private void hillshadeRenderer() {
    // create raster
    Raster raster = new Raster(
            new File(buildRasterPath()).getAbsolutePath());
    Log.d("Raster", raster.getPath());
    // create a raster layer
    mRasterLayer = new RasterLayer(raster);
    // create a basemap from the raster layer
    ArcGISMap map = new ArcGISMap();
    // add the map to a map view
    mMapView.setMap(map);
    // add the raster as an operational layer
    map.getOperationalLayers().add(mRasterLayer);
    updateRenderer();
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:20,代码来源:MainActivity.java

示例12: onCreate

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

  // create map and add to map view
  ArcGISMap map = new ArcGISMap(Basemap.createStreets());
  mMapView = findViewById(R.id.mapView);
  mMapView.setMap(map);

  // For API level 23+ request permission at runtime
  if (ContextCompat.checkSelfPermission(MainActivity.this, reqPermission[0]) == PackageManager.PERMISSION_GRANTED) {
    loadGeodatabase();
  } else {
    // request permission
    int requestCode = 2;
    ActivityCompat.requestPermissions(MainActivity.this, reqPermission, requestCode);
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:20,代码来源:MainActivity.java

示例13: onCreate

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的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 World_Bonne projection
    ArcGISMap mMap = new ArcGISMap(SpatialReference.create(54024));
    //Adding a map image layer which can reproject itself to the map's spatial reference
    ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(getResources().getString(R.string.world_cities_service));
    // set the map image layer as basemap
    Basemap basemap = new Basemap(mapImageLayer);
    // add the basemap to the map
    mMap.setBasemap(basemap);
    // set the map to be displayed in this view
    mMapView.setMap(mMap);

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

示例14: onCreate

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

    // inflate MapView from layout
    mMapView = findViewById(R.id.mapView);
    // create a map with the BasemapType topographic
    ArcGISMap map = new ArcGISMap(Basemap.Type.IMAGERY, 2.0, 18.0, 3);
    // set the map to be displayed in this view
    mMapView.setMap(map);

    // hold a list of uniquely-identifying WMS layer names to display
    List<String> wmsLayerNames = new ArrayList<>();
    wmsLayerNames.add("0");

    // create a new WMS layer displaying the specified layers from the service
    WmsLayer wmsLayer = new WmsLayer(getString(R.string.wms_layer_url), wmsLayerNames);

    // add the layer to the map
    map.getOperationalLayers().add(wmsLayer);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:23,代码来源:MainActivity.java

示例15: onCreate

import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的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 Basemap Type topographic
    ArcGISMap mMap = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 10);
    // set the map to be displayed in this view
    mMapView.setMap(mMap);
    // enable magnifier
    mMapView.setMagnifierEnabled(true);
    // allow magnifier to pan near the edge of the map bounds
    mMapView.setCanMagnifierPanMap(true);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:17,代码来源:MainActivity.java


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