本文整理汇总了Java中com.esri.arcgisruntime.mapping.ArcGISMap类的典型用法代码示例。如果您正苦于以下问题:Java ArcGISMap类的具体用法?Java ArcGISMap怎么用?Java ArcGISMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArcGISMap类属于com.esri.arcgisruntime.mapping包,在下文中一共展示了ArcGISMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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
mMap = new ArcGISMap(Basemap.createTopographic());
// set the map to be displayed in this view
mMapView.setMap(mMap);
// set an initial viewpoint
Point point = new Point(-11662054, 4818336, SpatialReference.create(3857));
Viewpoint viewpoint = new Viewpoint(point, 200000);
mMap.setInitialViewpoint(viewpoint);
requestWritePermission();
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:21,代码来源:MainActivity.java
示例17: 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 mMap = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 3.184710, -4.734690, 2);
// set the map to be displayed in this view
mMapView.setMap(mMap);
// set up gesture for interacting with the MapView
MapViewTouchListener mMapViewTouchListener = new MapViewTouchListener(this, mMapView);
mMapView.setOnTouchListener(mMapViewTouchListener);
addGraphicsOverlay();
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:20,代码来源:MainActivity.java
示例18: showMap
import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
* Display given map in the map view
* @param map - ArcGIS map
*/
@Override public void showMap(final ArcGISMap map) {
mMapView.setMap(map);
// Set up layers and bookmarks
final List<Layer> layerList = map.getOperationalLayers();
mContentAdapter.setLayerList(layerList);
final BookmarkList bookmarks = map.getBookmarks();
mBookmarkAdapter.setBoomarks(bookmarks);
}
开发者ID:Esri,项目名称:mapbook-android,代码行数:15,代码来源:MapFragment.java
示例19: loadMap
import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
* Load a specific map from a mobile map package stored
* at the given path.
* @param path - String representing location on device where mobile map package exists.
* @param mapIndex - int representing index of the map to be loaded.
*/
@Override public void loadMap(final String path, final int mapIndex) {
mDataManager.loadMobileMapPackage(path, new DataManagerCallbacks.MapbookCallback() {
@Override public void onMapbookLoaded(final MobileMapPackage mobileMapPackage) {
final List<ArcGISMap> maps = mobileMapPackage.getMaps();
final ArcGISMap map = maps.get(mapIndex);
mView.showMap(map);
}
@Override public void onMapbookNotLoaded(final Throwable error) {
mView.showMessage("There was a problem loading the map");
}
});
}
开发者ID:Esri,项目名称:mapbook-android,代码行数:20,代码来源:MapPresenter.java
示例20: setUpMap
import com.esri.arcgisruntime.mapping.ArcGISMap; //导入依赖的package包/类
/**
* Set up the ArcGISMap
* @param map - ArcGISMap
*/
@Override
public void setUpMap(final ArcGISMap map){
mMapView = (MapView) mRoot.findViewById(R.id.map);
mMapView.setAttributionTextVisible(false);
mMap = map;
mMapView.setMap(mMap);
// Start listening to touch interactions on the map
final View.OnTouchListener mapTouchListener = new MapTouchListener(getActivity().getApplicationContext(), mMapView);
mMapView.setOnTouchListener(mapTouchListener);
// Once map has loaded enable touch listener
mMapView.addDrawStatusChangedListener(new DrawStatusChangedListener() {
@Override public void drawStatusChanged(final DrawStatusChangedEvent drawStatusChangedEvent) {
if (drawStatusChangedEvent.getDrawStatus() == DrawStatus.COMPLETED) {
// Stop listening to any more draw status changes
mMapView.removeDrawStatusChangedListener(this);
// Notify presenter
mPresenter.mapLoaded();
}
}
});
// When map's layout is changed, re-center map on selected point
mMapView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override public void onLayoutChange(final View v, final int left, final int top, final int right, final int bottom, final int oldLeft, final int oldTop,
final int oldRight, final int oldBottom) {
setViewpoint();
}
});
}
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:37,代码来源:MapFragment.java
注:本文中的com.esri.arcgisruntime.mapping.ArcGISMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论