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


Java SpatialReferences.getWgs84方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: testForWaterProfileChartsOnCollapsedBottomSheet

import com.esri.arcgisruntime.geometry.SpatialReferences; //导入方法依赖的package包/类
/**
 * Test the water column profiles are drawn
 * when clicking on "VIEW COLUMN PROFILE"
 */
public void testForWaterProfileChartsOnCollapsedBottomSheet(){
  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);
  solo.clickOnView(solo.getView(R.id.action_profile));
  solo.sleep(3000);

  assertTrue(solo.waitForText("Temperature"));
  CombinedChart chart = (CombinedChart) solo.getView(R.id.propertyChart) ;
  checkForChartData();
  solo.scrollToSide(Solo.RIGHT);


  assertTrue(solo.waitForText("Salinity"));
  checkForChartData();
  solo.scrollToSide(Solo.RIGHT);


  assertTrue(solo.waitForText("Oxygen"));
  checkForChartData();
  solo.scrollToSide(Solo.RIGHT);

  assertTrue(solo.waitForText("Phosphate"));
  checkForChartData();
  solo.scrollToSide(Solo.RIGHT);

  assertTrue(solo.waitForText("Silicate"));
  checkForChartData();
  solo.scrollToSide(Solo.RIGHT);

  assertTrue(solo.waitForText("Nitrate"));
  checkForChartData();

  // FAB should not be visible
  assertTrue(solo.getView(R.id.fab).getVisibility()== View.INVISIBLE);
}
 
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:54,代码来源:EMUAppTest.java

示例10: start

import com.esri.arcgisruntime.geometry.SpatialReferences; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {

  try {

    // create stack pane and JavaFX app scene
    StackPane stackPane = new StackPane();
    Scene fxScene = new Scene(stackPane);

    // set title, size, and add JavaFX scene to stage
    stage.setTitle("Distance Composite Symbol Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(fxScene);
    stage.show();

    // 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 = new SceneView();
    sceneView.setArcGISScene(scene);
    stackPane.getChildren().addAll(sceneView);

    // add base surface for elevation data
    Surface surface = new Surface();
    surface.getElevationSources().add(new ArcGISTiledElevationSource(ELEVATION_IMAGE_SERVICE));
    scene.setBaseSurface(surface);

    // add a graphics overlay
    GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
    graphicsOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.RELATIVE);
    sceneView.getGraphicsOverlays().add(graphicsOverlay);

    // set up the different symbols
    int red = 0xFFFF0000;
    SimpleMarkerSymbol circleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, red, 10);
    SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.createCone(red, 3, 10);
    coneSymbol.setPitch(-90);
    coneSymbol.setAnchorPosition(AnchorPosition.CENTER);
    String modelURI = new File("./samples-data/bristol/Collada/Bristol.dae").getAbsolutePath();
    ModelSceneSymbol modelSymbol = new ModelSceneSymbol(modelURI, 1.0);
    modelSymbol.loadAsync();

    // set up the distance composite symbol
    DistanceCompositeSceneSymbol compositeSymbol = new DistanceCompositeSceneSymbol();
    compositeSymbol.getRangeCollection().add(new DistanceCompositeSceneSymbol.Range(modelSymbol, 0, 100));
    compositeSymbol.getRangeCollection().add(new DistanceCompositeSceneSymbol.Range(coneSymbol, 100, 500));
    compositeSymbol.getRangeCollection().add(new DistanceCompositeSceneSymbol.Range(circleSymbol, 500, 0));

    // create graphic
    Point aircraftPosition = new Point(-2.708471, 56.096575, 5000, SpatialReferences.getWgs84());
    Graphic aircraftGraphic = new Graphic(aircraftPosition, compositeSymbol);
    // add graphic to graphics overlay
    graphicsOverlay.getGraphics().add(aircraftGraphic);

    // add a camera and initial camera position
    Camera camera = new Camera(aircraftPosition, 20, 0, 70.0, 0.0);
    sceneView.setViewpointCamera(camera);
  } catch (Exception e) {
    // on any error, display the stack trace.
    e.printStackTrace();
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:66,代码来源:DistanceCompositeSymbolSample.java

示例11: start

import com.esri.arcgisruntime.geometry.SpatialReferences; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {

  try {

    // create splitPane pane and JavaFX app scene
    SplitPane splitPane = new SplitPane();
    splitPane.setOrientation(Orientation.VERTICAL);
    Scene fxScene = new Scene(splitPane);

    // set title, size, and add JavaFX scene to stage
    stage.setTitle("Feature Layer Rendering Mode Scene Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(fxScene);
    stage.show();

    // create a scene (top) and set it to render all features in static rendering mode
    ArcGISScene sceneTop = new ArcGISScene();
    sceneTop.getLoadSettings().setPreferredPointFeatureRenderingMode(FeatureLayer.RenderingMode.STATIC);
    sceneTop.getLoadSettings().setPreferredPolylineFeatureRenderingMode(FeatureLayer.RenderingMode.STATIC);
    sceneTop.getLoadSettings().setPreferredPolygonFeatureRenderingMode(FeatureLayer.RenderingMode.STATIC);

    // create a scene (bottom) and set it to render all features in dynamic rendering mode
    ArcGISScene sceneBottom = new ArcGISScene();
    sceneBottom.getLoadSettings().setPreferredPointFeatureRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);
    sceneBottom.getLoadSettings().setPreferredPolylineFeatureRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);
    sceneBottom.getLoadSettings().setPreferredPolygonFeatureRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);

    // creating top scene view
    sceneViewTop = new SceneView();
    sceneViewTop.setArcGISScene(sceneTop);
    splitPane.getItems().add(sceneViewTop);
    // creating bottom scene view
    sceneViewBottom = new SceneView();
    sceneViewBottom.setArcGISScene(sceneBottom);
    splitPane.getItems().add(sceneViewBottom);

    // create service feature table using a point, polyline, and polygon service
    ServiceFeatureTable poinServiceFeatureTable = new ServiceFeatureTable("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/0");
    ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/8");
    ServiceFeatureTable polygonServiceFeatureTable = new ServiceFeatureTable("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9");

    // create feature layer from service feature tables
    FeatureLayer pointFeatureLayer = new FeatureLayer(poinServiceFeatureTable);
    FeatureLayer polylineFeatureLayer = new FeatureLayer(polylineServiceFeatureTable);
    FeatureLayer polygonFeatureLayer = new FeatureLayer(polygonServiceFeatureTable);

    // add each layer to top and bottom scene
    sceneTop.getOperationalLayers().addAll(Arrays.asList(pointFeatureLayer, polylineFeatureLayer, polygonFeatureLayer));
    sceneBottom.getOperationalLayers().addAll(Arrays.asList(pointFeatureLayer.copy(), polylineFeatureLayer.copy(), polygonFeatureLayer.copy()));

    // camera locations for camera to zoom in and out to
    Camera zoomOutCamera = new Camera(new Point(-118.37, 34.46, SpatialReferences.getWgs84()), 42000, 0, 0, 0);
    Camera zoomInCamera = new Camera(new Point(-118.45, 34.395, SpatialReferences.getWgs84()), 2500, 90, 75, 0);
    sceneViewTop.setViewpointCamera(zoomOutCamera);
    sceneViewBottom.setViewpointCamera(zoomOutCamera);

    //loop an animation into and out from the zoom in point (5 seconds each) with a 2 second gap between zooming
    Timeline timeline = new Timeline();
    timeline.setCycleCount(Animation.INDEFINITE);
    timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(7), event -> zoomTo(zoomOutCamera, 5)));
    timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(14), event -> zoomTo(zoomInCamera, 5)));
    timeline.play();

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

示例12: 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);

    // size the stage, add a title, and set scene to stage
    stage.setTitle("Simple Renderer Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(scene);
    stage.show();

    // create a ArcGISMap with the imagery basemap
    final ArcGISMap map = new ArcGISMap(Basemap.createImageryWithLabels());

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

    // create SpatialReference for points
    final SpatialReference spatialReference = SpatialReferences.getWgs84();

    // create points for displaying graphics
    Point oldFaithfullPoint = new Point(-110.828140, 44.460458, spatialReference);
    Point cascadeGeyserPoint = new Point(-110.829004, 44.462438, spatialReference);
    Point plumeGeyserPoint = new Point(-110.829381, 44.462735, spatialReference);

    // create initial viewpoint using an envelope
    Envelope envelope = new Envelope(oldFaithfullPoint, plumeGeyserPoint);

    // set viewpoint on mapview with padding
    mapView.setViewpointGeometryAsync(envelope, 100.0);

    // create a graphics overlay and add it to the mapview
    GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
    mapView.getGraphicsOverlays().add(graphicsOverlay);

    // create a red (0xFFFF0000) simple symbol for use in a simple renderer
    SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CROSS, 0xFFFF0000, 12);
    SimpleRenderer renderer = new SimpleRenderer(symbol);

    // apply the renderer to the graphics overlay
    graphicsOverlay.setRenderer(renderer);

    // create graphics from the location points.
    Graphic oldFaithfullGraphic = new Graphic(oldFaithfullPoint);

    Graphic cascadeGeyserGraphic = new Graphic(cascadeGeyserPoint);
    Graphic plumeGeyserGraphic = new Graphic(plumeGeyserPoint);
    graphicsOverlay.getGraphics().add(oldFaithfullGraphic);
    graphicsOverlay.getGraphics().add(cascadeGeyserGraphic);
    graphicsOverlay.getGraphics().add(plumeGeyserGraphic);

    // add the map view and control box to stack pane
    stackPane.getChildren().add(mapView);
  } catch (Exception e) {
    // on any error, display stack trace
    e.printStackTrace();
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:64,代码来源:SimpleRendererSample.java

示例13: start

import com.esri.arcgisruntime.geometry.SpatialReferences; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {

  try {

    // create splitPane pane and JavaFX app scene
    SplitPane splitPane = new SplitPane();
    splitPane.setOrientation(Orientation.VERTICAL);
    Scene fxScene = new Scene(splitPane);

    // set title, size, and add JavaFX scene to stage
    stage.setTitle("Feature Layer Rendering Mode Map Sample");
    stage.setWidth(800);
    stage.setHeight(700);
    stage.setScene(fxScene);
    stage.show();

    // create a map (top) and set it to render all features in static rendering mode
    ArcGISMap mapTop = new ArcGISMap();
    mapTop.getLoadSettings().setPreferredPointFeatureRenderingMode(FeatureLayer.RenderingMode.STATIC);
    mapTop.getLoadSettings().setPreferredPolylineFeatureRenderingMode(FeatureLayer.RenderingMode.STATIC);
    mapTop.getLoadSettings().setPreferredPolygonFeatureRenderingMode(FeatureLayer.RenderingMode.STATIC);

    // create a map (bottom) and set it to render all features in dynamic rendering mode
    ArcGISMap mapBottom = new ArcGISMap();
    mapBottom.getLoadSettings().setPreferredPointFeatureRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);
    mapBottom.getLoadSettings().setPreferredPolylineFeatureRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);
    mapBottom.getLoadSettings().setPreferredPolygonFeatureRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);

    // creating top map view
    mapViewTop = new MapView();
    mapViewTop.setMap(mapTop);
    splitPane.getItems().add(mapViewTop);
    // creating bottom map view
    mapViewBottom = new MapView();
    mapViewBottom.setMap(mapBottom);
    splitPane.getItems().add(mapViewBottom);

    // create service feature table using a point, polyline, and polygon service
    ServiceFeatureTable poinServiceFeatureTable = new ServiceFeatureTable("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/0");
    ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/8");
    ServiceFeatureTable polygonServiceFeatureTable = new ServiceFeatureTable("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9");

    // create feature layer from service feature tables
    FeatureLayer pointFeatureLayer = new FeatureLayer(poinServiceFeatureTable);
    FeatureLayer polylineFeatureLayer = new FeatureLayer(polylineServiceFeatureTable);
    FeatureLayer polygonFeatureLayer = new FeatureLayer(polygonServiceFeatureTable);

    // add each layer to top and bottom map
    mapTop.getOperationalLayers().addAll(Arrays.asList(pointFeatureLayer, polylineFeatureLayer, polygonFeatureLayer));
    mapBottom.getOperationalLayers().addAll(Arrays.asList(pointFeatureLayer.copy(), polylineFeatureLayer.copy(), polygonFeatureLayer.copy()));

    // viewpoint locations for map view to zoom in and out to
    Viewpoint zoomOutPoint = new Viewpoint(new Point(-118.37, 34.46, SpatialReferences.getWgs84()), 650000, 0);
    Viewpoint zoomInPoint = new Viewpoint(new Point(-118.45, 34.395, SpatialReferences.getWgs84()), 50000, 90);
    mapViewTop.setViewpoint(zoomOutPoint);
    mapViewBottom.setViewpoint(zoomOutPoint);

    //loop an animation into and out from the zoom in point (5 seconds each) with a 2 second gap between zooming
    Timeline timeline = new Timeline();
    timeline.setCycleCount(Animation.INDEFINITE);
    timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(7), event -> zoomTo(zoomInPoint, 5)));
    timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(14), event -> zoomTo(zoomOutPoint, 5)));
    timeline.play();

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

示例14: onCreate

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

    //Create points to add graphics to the map to allow a renderer to style them
    //These are in WGS84 coordinates (Long, Lat)
    Point oldFaithfullPoint = new Point(-110.828140, 44.460458, SpatialReferences.getWgs84());
    Point cascadeGeyserPoint = new Point(-110.829004, 44.462438, SpatialReferences.getWgs84());
    Point plumeGeyserPoint = new Point(-110.829381, 44.462735, SpatialReferences.getWgs84());
    //Use the farthest points to create an envelope to use for the map views visible area
    Envelope initialEnvelope = new Envelope(oldFaithfullPoint, plumeGeyserPoint);

    // inflate MapView from layout
    mMapView = (MapView) findViewById(R.id.mapView);
    // create a map with the imagery basemap. This will set the map to have a WebMercator spatial reference
    ArcGISMap map = new ArcGISMap(Basemap.createImageryWithLabels());
    // set the map to be displayed in the mapview
    mMapView.setMap(map);

    //set initial envelope on the map view sith some padding so all points will be visible
    //This envelope is using the WGS84 points above, but is reprojected by the mapview into the maps spatial reference, so its works fine
    mMapView.setViewpointGeometryAsync(initialEnvelope, 100);

    // create a new graphics overlay and add it to the mapview
    GraphicsOverlay graphicOverlay = new GraphicsOverlay();
    mMapView.getGraphicsOverlays().add(graphicOverlay);

    //[DocRef: Name=Simple Renderer, Category=Fundamentals, Topic=Symbols and Renderers]
    //create a simple symbol for use in a simple renderer
    SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CROSS, Color.RED, 12); //size 12, style of cross
    SimpleRenderer renderer = new SimpleRenderer(symbol);

    //apply the renderer to the graphics overlay (so all graphics will use the same symbol from the renderer)
    graphicOverlay.setRenderer(renderer);
    //[DocRef: END]

    //create graphics from the geyser location points. NOTE: no need to set the symbol on the graphic because the renderer takes care of it
    //The points are in WGS84, but graphics get reprojected automatically, so they work fine in a map with a spatial reference of web mercator
    Graphic oldFaithfullGraphic = new Graphic(oldFaithfullPoint);
    Graphic cascadeGeyserGraphic = new Graphic(cascadeGeyserPoint);
    Graphic plumeGeyserGraphic = new Graphic(plumeGeyserPoint);
    graphicOverlay.getGraphics().add(oldFaithfullGraphic);
    graphicOverlay.getGraphics().add(cascadeGeyserGraphic);
    graphicOverlay.getGraphics().add(plumeGeyserGraphic);

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


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