本文整理汇总了Java中com.esri.arcgisruntime.geometry.SpatialReferences类的典型用法代码示例。如果您正苦于以下问题:Java SpatialReferences类的具体用法?Java SpatialReferences怎么用?Java SpatialReferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpatialReferences类属于com.esri.arcgisruntime.geometry包,在下文中一共展示了SpatialReferences类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: run
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
@Override
public void run (){
final LoadStatus status = mRouteTask.getLoadStatus();
// Has the route task loaded successfully?
if (status == LoadStatus.FAILED_TO_LOAD) {
Log.i(TAG, mRouteTask.getLoadError().getMessage());
Log.i(TAG, "CAUSE = " + mRouteTask.getLoadError().getCause().getMessage());
} else {
final ListenableFuture<RouteParameters> routeTaskFuture = mRouteTask
.createDefaultParametersAsync();
// Add a done listener that uses the returned route parameters
// to build up a specific request for the route we need
routeTaskFuture.addDoneListener(new Runnable() {
@Override
public void run() {
try {
final RouteParameters routeParameters = routeTaskFuture.get();
final TravelMode mode = routeParameters.getTravelMode();
mode.setImpedanceAttributeName("WalkTime");
mode.setTimeAttributeName("WalkTime");
// Set the restriction attributes for walk times
List<String> restrictionAttributes = mode.getRestrictionAttributeNames();
// clear default restrictions set for vehicles
restrictionAttributes.clear();
// add pedestrian restrictions
restrictionAttributes.add("Avoid Roads Unsuitable for Pedestrians");
restrictionAttributes.add("Preferred for Pedestrians");
restrictionAttributes.add("Walking");
// Add a stop for origin and destination
routeParameters.setTravelMode(mode);
routeParameters.getStops().add(origin);
routeParameters.getStops().add(destination);
// We want the task to return driving directions and routes
routeParameters.setReturnDirections(true);
routeParameters.setOutputSpatialReference(SpatialReferences.getWebMercator());
final ListenableFuture<RouteResult> routeResFuture = mRouteTask
.solveRouteAsync(routeParameters);
routeResFuture.addDoneListener(new Runnable() {
@Override
public void run() {
try {
final RouteResult routeResult = routeResFuture.get();
// Show route results
if (routeResult != null){
mCallback.onRouteReturned(routeResult);
}else{
Log.i(TAG, "NO RESULT FROM ROUTING");
}
} catch (final Exception e) {
Log.e(TAG, e.getMessage());
}
}
});
} catch (final Exception e1){
Log.e(TAG,e1.getMessage() );
}
}
});
}
}
开发者ID:Esri,项目名称:nearby-android,代码行数:68,代码来源:LocationService.java
示例2: clickOnOceanPoint
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
/**
* Helper method that clicks on
* an ocean location
*/
private void clickOnOceanPoint(){
assertTrue(solo.waitForDialogToClose());
// Near the Galapagos Islands
Point start = new Point(-95.0974397, -0.05932, SpatialReferences.getWgs84());
android.graphics.Point screenPoint = deriveScreenPointForLocation(start);
solo.clickOnScreen(screenPoint.x, screenPoint.y );
assertTrue(solo.waitForText("Location Summary"));
android.graphics.Point p = new android.graphics.Point();
getActivity().getWindowManager().getDefaultDisplay().getSize(p);
int fromX, toX, fromY, toY = 0;
fromX = p.x/2;
toX = p.x/2;
fromY = (p.y/2) + (p.y/3);
toY = (p.y/2) - (p.y/3);
solo.sleep(3000);
// Drag UP
solo.drag(fromX, toX, fromY, toY, 40);
}
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:25,代码来源:EMUAppTest.java
示例3: createPictureMarkerSymbolFromFile
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
/**
* Create a picture marker symbol from an image on disk. Called from checkSaveResourceToExternalStorage() or
* onRequestPermissionsResult which validate required external storage and permissions
*/
private void createPictureMarkerSymbolFromFile() {
//[DocRef: Name=Picture Marker Symbol File-android, Category=Fundamentals, Topic=Symbols and Renderers]
//Create a picture marker symbol from a file on disk
BitmapDrawable pinBlankOrangeDrawable = (BitmapDrawable) Drawable.createFromPath(mPinBlankOrangeFilePath);
final PictureMarkerSymbol pinBlankOrangeSymbol = new PictureMarkerSymbol(pinBlankOrangeDrawable);
//Optionally set the size, if not set the image will be auto sized based on its size in pixels,
//its appearance would then differ across devices with different resolutions.
pinBlankOrangeSymbol.setHeight(20);
pinBlankOrangeSymbol.setWidth(20);
//Optionally set the offset, to align the base of the symbol aligns with the point geometry
pinBlankOrangeSymbol.setOffsetY(10); //The image used has not buffer and therefore the Y offset is height/2
pinBlankOrangeSymbol.loadAsync();
//[DocRef: END]
pinBlankOrangeSymbol.addDoneLoadingListener(new Runnable() {
@Override
public void run() {
//add a new graphic with the same location as the initial viewpoint
Point pinBlankOrangePoint = new Point(-228835, 6550763, SpatialReferences.getWebMercator());
Graphic pinBlankOrangeGraphic = new Graphic(pinBlankOrangePoint, pinBlankOrangeSymbol);
mGraphicsOverlay.getGraphics().add(pinBlankOrangeGraphic);
}
});
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:30,代码来源:MainActivity.java
示例4: addGraphicsOverlay
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
private void addGraphicsOverlay() {
// create the polygon
PolygonBuilder polygonGeometry = new PolygonBuilder(SpatialReferences.getWebMercator());
polygonGeometry.addPoint(-20e5, 20e5);
polygonGeometry.addPoint(20e5, 20.e5);
polygonGeometry.addPoint(20e5, -20e5);
polygonGeometry.addPoint(-20e5, -20e5);
// create solid line symbol
SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, null);
// create graphic from polygon geometry and symbol
Graphic graphic = new Graphic(polygonGeometry.toGeometry(), polygonSymbol);
// create graphics overlay
grOverlay = new GraphicsOverlay();
// create list of graphics
ListenableList<Graphic> graphics = grOverlay.getGraphics();
// add graphic to graphics overlay
graphics.add(graphic);
// add graphics overlay to the MapView
mMapView.getGraphicsOverlays().add(grOverlay);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:23,代码来源:MainActivity.java
示例5: testClickOnLand
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
/**
* Verify that clicking on a land
* location shows a toast message
*/
public void testClickOnLand(){
// Somewhere in the Sahara
Point sahara = new Point(21.9741618,13.0648185, SpatialReferences.getWgs84());
android.graphics.Point derivedScreenLocation = deriveScreenPointForLocation(sahara);
assertTrue(solo.waitForDialogToClose());
solo.clickOnScreen(derivedScreenLocation.x, derivedScreenLocation.y);
boolean messageShows = solo.waitForText(getActivity().getString(R.string.no_emu_found));
assertTrue(messageShows);
}
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:15,代码来源:EMUAppTest.java
示例6: start
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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
示例7: start
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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 Initial Extent Sample");
stage.setWidth(800);
stage.setHeight(700);
stage.setScene(scene);
stage.show();
// create a ArcGISMap with the basemap
final ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
// create an initial extent envelope
Point leftPoint = new Point(-12211308.778729, 4645116.003309, SpatialReferences.getWebMercator());
Point rightPoint = new Point(-12208257.879667, 4650542.535773, SpatialReferences.getWebMercator());
Envelope initialExtent = new Envelope(leftPoint, rightPoint);
// create a viewpoint from envelope
Viewpoint viewPoint = new Viewpoint(initialExtent);
// set initial ArcGISMap extent
map.setInitialViewpoint(viewPoint);
// 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,代码行数:41,代码来源:MapInitialExtentSample.java
示例8: initialize
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
public void initialize() {
// create a scene and add a basemap to it
ArcGISScene scene = new ArcGISScene();
scene.setBasemap(Basemap.createImagery());
// add the SceneView to the stack pane
sceneView.setArcGISScene(scene);
// add a camera and initial camera position
Point point = new Point(83.9, 28.4, 1000, SpatialReferences.getWgs84());
Camera camera = new Camera(point, 1000, 0, 50, 0);
sceneView.setViewpointCamera(camera);
// create a graphics overlay
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.RELATIVE);
sceneView.getGraphicsOverlays().add(graphicsOverlay);
// add renderer using rotation expressions
SimpleRenderer renderer = new SimpleRenderer();
renderer.getSceneProperties().setHeadingExpression("[HEADING]");
renderer.getSceneProperties().setPitchExpression("[PITCH]");
graphicsOverlay.setRenderer(renderer);
// create a red (0xFFFF0000) cone graphic
SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.createCone(0xFFFF0000, 100, 100);
coneSymbol.setPitch(-90); // correct symbol's default pitch
Graphic cone = new Graphic(new Point(83.9, 28.41, 200, SpatialReferences.getWgs84()), coneSymbol);
graphicsOverlay.getGraphics().add(cone);
// bind attribute values to sliders
headingSlider.valueProperty().addListener(o -> cone.getAttributes().put("HEADING", headingSlider.getValue()));
pitchSlider.valueProperty().addListener(o -> cone.getAttributes().put("PITCH", pitchSlider.getValue()));
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:36,代码来源:ScenePropertiesExpressionsController.java
示例9: createPolygon
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
/**
* Creates the polygon.
*/
private void createPolygon() {
// part one
PointCollection partSegmentCollectionOne = new PointCollection(SpatialReferences.getWebMercator());
partSegmentCollectionOne.add(new Point(-13020, 6710130));
partSegmentCollectionOne.add(new Point(-14160, 6710130));
partSegmentCollectionOne.add(new Point(-14160, 6709300));
partSegmentCollectionOne.add(new Point(-13020, 6709300));
partSegmentCollectionOne.add(new Point(-13020, 6710130));
Part partOne = new Part(partSegmentCollectionOne);
// part two
PointCollection partSegmentCollectionTwo = new PointCollection(SpatialReferences.getWebMercator());
partSegmentCollectionTwo.add(new Point(-12160, 6710730));
partSegmentCollectionTwo.add(new Point(-13160, 6710730));
partSegmentCollectionTwo.add(new Point(-13160, 6709100));
partSegmentCollectionTwo.add(new Point(-12160, 6709100));
partSegmentCollectionTwo.add(new Point(-12160, 6710730));
Part partTwo = new Part(partSegmentCollectionTwo);
// part three
PointCollection partSegmentCollectionThree = new PointCollection(SpatialReferences.getWebMercator());
partSegmentCollectionThree.add(new Point(-12560, 6710030));
partSegmentCollectionThree.add(new Point(-13520, 6710030));
partSegmentCollectionThree.add(new Point(-13520, 6709000));
partSegmentCollectionThree.add(new Point(-12560, 6709000));
partSegmentCollectionThree.add(new Point(-12560, 6710030));
Part partThree = new Part(partSegmentCollectionThree);
PartCollection polygonParts = new PartCollection(partOne);
polygonParts.add(partTwo);
polygonParts.add(partThree);
// transparent (0x00000000) fill
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0x00000000, line);
polygon = new Graphic(new Polygon(polygonParts), fillSymbol);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:42,代码来源:GeometryEngineSimplifySample.java
示例10: onCreate
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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
示例11: onCreate
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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 topographic basemap
ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
//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 no cache (every interaction (pan, query etc) new features will be requested
serviceFeatureTable.setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode.ON_INTERACTION_NO_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
示例12: onCreate
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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 topographic basemap
final ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
// set the map to be displayed in the mapview
mMapView.setMap(map);
// create feature layer with its service feature table
// create the service feature table
mServiceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.sample_service_url));
// create the feature layer using the service feature table
mFeaturelayer = new FeatureLayer(mServiceFeatureTable);
mFeaturelayer.setOpacity(0.8f);
//override the renderer
SimpleLineSymbol lineSymbol= new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.BLACK, 1);
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, lineSymbol);
mFeaturelayer.setRenderer(new SimpleRenderer(fillSymbol));
// add the layer to the map
map.getOperationalLayers().add(mFeaturelayer);
// zoom to a view point of the USA
mMapView.setViewpointCenterAsync(new Point(-11000000, 5000000, SpatialReferences.getWebMercator()), 100000000);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:31,代码来源:MainActivity.java
示例13: onCreate
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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 imagery basemap
ArcGISMap map = new ArcGISMap(Basemap.createImagery());
// create an initial viewpoint with a point and scale
Point point = new Point(-226773, 6550477, SpatialReferences.getWebMercator());
Viewpoint vp = new Viewpoint(point, 7500);
// set initial map extent
map.setInitialViewpoint(vp);
// set the map to be displayed in the mapview
mMapView.setMap(map);
// create a new graphics overlay and add it to the mapview
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
mMapView.getGraphicsOverlays().add(graphicsOverlay);
//[DocRef: Name=Point graphic with symbol, Category=Fundamentals, Topic=Symbols and Renderers]
//create a simple marker symbol
SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.RED, 12); //size 12, style of circle
//add a new graphic with a new point geometry
Point graphicPoint = new Point(-226773, 6550477, SpatialReferences.getWebMercator());
Graphic graphic = new Graphic(graphicPoint, symbol);
graphicsOverlay.getGraphics().add(graphic);
//[DocRef: END]
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:37,代码来源:MainActivity.java
示例14: onCreate
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// set up the bottom toolbar
createBottomToolbar();
// inflate MapView from layout
mMapView = (MapView) findViewById(R.id.mapView);
// create a map with the topographic basemap
ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
//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
ServiceFeatureTable serviceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.sample_service_url));
mFeatureLayer = new FeatureLayer(serviceFeatureTable);
// add the layer to the map
map.getOperationalLayers().add(mFeatureLayer);
// set the map to be displayed in the mapview
mMapView.setMap(map);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:29,代码来源:MainActivity.java
示例15: onCreate
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的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 terrain with labels basemap
ArcGISMap map = new ArcGISMap(Basemap.createTerrainWithLabels());
//set an initial viewpointf
map.setInitialViewpoint(new Viewpoint(new Point(-13176752, 4090404, SpatialReferences.getWebMercator()), 500000));
// create feature layer with its service feature table
// create the service feature table
ServiceFeatureTable serviceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.sample_service_url));
// 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,代码行数:29,代码来源:MainActivity.java
示例16: createEnvelope
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
private Envelope createEnvelope() {
//[DocRef: Name=Create Envelope, Category=Fundamentals, Topic=Geometries]
// create an Envelope using minimum and maximum x,y coordinates and a SpatialReference
Envelope envelope = new Envelope(-123.0, 33.5, -101.0, 48.0, SpatialReferences.getWgs84());
//[DocRef: END]
return envelope;
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:10,代码来源:MainActivity.java
示例17: createPoint
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
private Point createPoint() {
//[DocRef: Name=Create Point, Category=Fundamentals, Topic=Geometries]
// create a Point using x,y coordinates and a SpatialReference
Point pt = new Point(34.056295, -117.195800, SpatialReferences.getWgs84());
//[DocRef: END]
return pt;
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:9,代码来源:MainActivity.java
示例18: createMultipoint
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
private Multipoint createMultipoint() {
//[DocRef: Name=Create Multipoint, Category=Fundamentals, Topic=Geometries]
// create a Multipoint from a PointCollection
PointCollection stateCapitalsPST = new PointCollection(SpatialReferences.getWgs84());
stateCapitalsPST.add(-121.491014, 38.579065); // Sacramento, CA
stateCapitalsPST.add(-122.891366, 47.039231); // Olympia, WA
stateCapitalsPST.add(-123.043814, 44.93326); // Salem, OR
stateCapitalsPST.add(-119.766999, 39.164885); // Carson City, NV
Multipoint multipoint = new Multipoint(stateCapitalsPST);
//[DocRef: END]
return multipoint;
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:14,代码来源:MainActivity.java
示例19: createPolyline
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
private Polyline createPolyline() {
//[DocRef: Name=Create Polyline, Category=Fundamentals, Topic=Geometries]
// create a Polyline from a PointCollection
PointCollection borderCAtoNV = new PointCollection(SpatialReferences.getWgs84());
borderCAtoNV.add(-119.992, 41.989);
borderCAtoNV.add(-119.994, 38.994);
borderCAtoNV.add(-114.620, 35.0);
Polyline polyline = new Polyline(borderCAtoNV);
//[DocRef: END]
return polyline;
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:13,代码来源:MainActivity.java
示例20: createPolygon
import com.esri.arcgisruntime.geometry.SpatialReferences; //导入依赖的package包/类
private Polygon createPolygon() {
//[DocRef: Name=Create Polygon, Category=Fundamentals, Topic=Geometries]
// create a Polygon from a PointCollection
PointCollection coloradoCorners = new PointCollection(SpatialReferences.getWgs84());
coloradoCorners.add(-109.048, 40.998);
coloradoCorners.add(-102.047, 40.998);
coloradoCorners.add(-102.037, 36.989);
coloradoCorners.add(-109.048, 36.998);
Polygon polygon = new Polygon(coloradoCorners);
//[DocRef: END]
return polygon;
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:14,代码来源:MainActivity.java
注:本文中的com.esri.arcgisruntime.geometry.SpatialReferences类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论