本文整理汇总了Java中com.esri.arcgisruntime.mapping.Basemap类的典型用法代码示例。如果您正苦于以下问题:Java Basemap类的具体用法?Java Basemap怎么用?Java Basemap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Basemap类属于com.esri.arcgisruntime.mapping包,在下文中一共展示了Basemap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import com.esri.arcgisruntime.mapping.Basemap; //导入依赖的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.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.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: updateRenderer
import com.esri.arcgisruntime.mapping.Basemap; //导入依赖的package包/类
/**
* Updates the raster layer renderer according to the chosen property values.
*/
public void updateRenderer() {
ColorRamp colorRamp = colorRampComboBox.getSelectionModel().getSelectedItem() != ColorRamp.PresetType.NONE
? new ColorRamp(colorRampComboBox.getSelectionModel().getSelectedItem(), 800) : null;
// if color ramp is not NONE, color the hillshade elevation raster instead of using satellite imagery raster color
RasterLayer rasterLayer = colorRamp != null ? new RasterLayer(new Raster(elevationRasterPath))
: new RasterLayer(new Raster(imageryRasterPath));
mapView.getMap().setBasemap(new Basemap(rasterLayer));
// create blend renderer
BlendRenderer blendRenderer = new BlendRenderer(new Raster(elevationRasterPath), Collections.singletonList(9.0),
Collections.singletonList(255.0), null, null, null, null, colorRamp, altitudeSlider.getValue(),
azimuthSlider.getValue(), 1, slopeTypeComboBox.getSelectionModel().getSelectedItem(), 1, 1, 8);
rasterLayer.setRasterRenderer(blendRenderer);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:22,代码来源:BlendRendererController.java
示例4: onCreate
import com.esri.arcgisruntime.mapping.Basemap; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// create a scene and add a basemap to it
ArcGISScene scene = new ArcGISScene();
scene.setBasemap(Basemap.createImagery());
mSceneView = (SceneView) findViewById(R.id.sceneView);
mSceneView.setScene(scene);
// add a scene service to the scene for viewing buildings
ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(getResources().getString(R.string.brest_buildings));
scene.getOperationalLayers().add(sceneLayer);
// add a camera and initial camera position
Camera camera = new Camera(48.378, -4.494, 200, 345, 65, 0);
mSceneView.setViewpointCamera(camera);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:21,代码来源:MainActivity.java
示例5: 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 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.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 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.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
示例8: loadRaster
import com.esri.arcgisruntime.mapping.Basemap; //导入依赖的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
示例9: 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 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
示例10: onCreate
import com.esri.arcgisruntime.mapping.Basemap; //导入依赖的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
示例11: 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 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
示例12: setBasemap
import com.esri.arcgisruntime.mapping.Basemap; //导入依赖的package包/类
/**
* create a ArcGISMap for the selected position
*
* @param choice chosen Basemap
*/
private void setBasemap(int choice) {
removeLayers();
switch (choice) {
case 0:
mMap.setBasemap(Basemap.createStreets());
break;
case 1:
mMap.setBasemap(Basemap.createImagery());
break;
case 2:
mMap.setBasemap(Basemap.createTopographic());
break;
case 3:
mMap.setBasemap(Basemap.createOceans());
break;
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:24,代码来源:MainActivity.java
示例13: 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 = 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
示例14: 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 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
示例15: 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 = 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
示例16: 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 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
示例17: 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);
// 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
示例18: 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);
// set title, size, and add scene to stage
stage.setTitle("Display Map Sample");
stage.setWidth(800);
stage.setHeight(700);
stage.setScene(scene);
stage.show();
// create a ArcGISMap with the a Basemap instance with an Imagery base
// layer
ArcGISMap map = new ArcGISMap(Basemap.createImagery());
// set the map to be displayed in this view
mapView = new MapView();
mapView.setMap(map);
// 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,代码行数:31,代码来源:DisplayMapSample.java
示例19: 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);
// set title, size, and add scene to stage
stage.setTitle("Set Initial Map Location Sample");
stage.setWidth(800);
stage.setHeight(700);
stage.setScene(scene);
stage.show();
// create a map using National Geographic basemap centred over East
// Scotland at zoom level 10.
ArcGISMap map = new ArcGISMap(Basemap.Type.NATIONAL_GEOGRAPHIC, 56.075844, -2.681572, 10);
// create the MapView
mapView = new MapView();
mapView.setMap(map);
// add the map view to stack pane
stackPane.getChildren().add(mapView);
} catch (Exception e) {
// on any error, display the stack trace.
e.printStackTrace();
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:32,代码来源:SetInitialMapLocationSample.java
示例20: 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);
// set title, size, and add scene to stage
stage.setTitle("Map Spatial Reference Sample");
stage.setWidth(800);
stage.setHeight(700);
stage.setScene(scene);
stage.show();
// create a ArcGISMap with a spatial reference
final ArcGISMap map = new ArcGISMap(SpatialReference.create(54024));
// create a ArcGISMap image layer from url
final ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(IMAGE_LAYER_URL);
// create basemap from the ArcGISMap image layer
Basemap basemap = new Basemap(mapImageLayer);
// add the basemap to the ArcGISMap
map.setBasemap(basemap);
// create a view and set ArcGISMap to it
mapView = new MapView();
mapView.setMap(map);
// add the map view to stack pane
stackPane.getChildren().add(mapView);
} catch (Exception e) {
// on any error, display the stack trace.
e.printStackTrace();
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:40,代码来源:MapSpatialReferenceSample.java
注:本文中的com.esri.arcgisruntime.mapping.Basemap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论