本文整理汇总了Java中com.esri.arcgisruntime.geometry.Point类的典型用法代码示例。如果您正苦于以下问题:Java Point类的具体用法?Java Point怎么用?Java Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point类属于com.esri.arcgisruntime.geometry包,在下文中一共展示了Point类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: showCalloutForGraphic
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Shows the callout for a given graphic
* @param graphic the graphic selected by the user
* @param tapLocation the location selected at a Point
*/
private void showCalloutForGraphic(Graphic graphic, Point tapLocation) {
TextView calloutTextView = (TextView) getLayoutInflater().inflate(callout, null);
calloutTextView.setText(graphic.getAttributes().get("Match_addr").toString());
mCallout = mMapView.getCallout();
mCallout.setLocation(tapLocation);
mCallout.setContent(calloutTextView);
mCallout.show();
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:14,代码来源:MobileMapViewActivity.java
示例2: reverseGeocode
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Calls reverseGeocode on a Locator Task and, if there is a result, passes the result to a
* Callout method
* @param point user generated map point
* @param graphic used for marking the point on which the user touched
*/
private void reverseGeocode(final Point point, final Graphic graphic) {
if (mLocatorTask != null) {
final ListenableFuture<List<GeocodeResult>> results =
mLocatorTask.reverseGeocodeAsync(point, mReverseGeocodeParameters);
results.addDoneListener(new Runnable() {
public void run() {
try {
List<GeocodeResult> geocodeResult = results.get();
if (geocodeResult.size() > 0) {
graphic.getAttributes().put(
"Match_addr", geocodeResult.get(0).getLabel());
showCalloutForGraphic(graphic, point);
} else {
//no result was found
mMapView.getCallout().dismiss();
}
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
}
});
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:30,代码来源:MobileMapViewActivity.java
示例3: stopsForGraphics
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Converts a given list of graphics into a list of stops
* @param graphics
* @return a list of stops
*/
private List stopsForGraphics(List<Graphic> graphics) {
List<Stop> stops = new ArrayList<>();
for (Graphic graphic : graphics) {
Stop stop = new Stop((Point)graphic.getGeometry());
stops.add(stop);
}
return stops;
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:14,代码来源:MobileMapViewActivity.java
示例4: showClickedLocation
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Create and add a marker to the map representing
* the clicked location.
* @param point - A com.esri.arcgisruntime.geometry.Point item
*/
@Override public void showClickedLocation(final Point point) {
final Bitmap icon = BitmapFactory.decodeResource(getActivity().getResources(), R.mipmap.blue_pin);
final BitmapDrawable drawable = new BitmapDrawable(getResources(), icon);
final PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol(drawable);
markerSymbol.setHeight(40);
markerSymbol.setWidth(40);
markerSymbol.setOffsetY(markerSymbol.getHeight()/2);
markerSymbol.loadAsync();
markerSymbol.addDoneLoadingListener(new Runnable() {
@Override public void run() {
final Graphic marker = new Graphic(point, markerSymbol);
mGraphicOverlay.getGraphics().clear();
mGraphicOverlay.getGraphics().add(marker);
}
});
}
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:23,代码来源:MapFragment.java
示例5: setSelectedPoint
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* When a user clicks a location in the map, show the progress bar and
* create a buffered polygon around the point and query for EMU data.
* @param point - A geolocation representing the
* place a user clicked on the map
*/
@Override public void setSelectedPoint(final Point point) {
mMapView.showProgressBar("Fetching details about the location...", "Preparing Location Summary");
mMapView.showClickedLocation(point);
double BUFFER_SIZE = 32000;
final Polygon polygon = getBufferPolygonForPoint(point, BUFFER_SIZE);
final PolygonBuilder builder = new PolygonBuilder(polygon);
final Envelope envelope = builder.getExtent();
mDataManager.queryForEmuAtLocation(envelope, new ServiceApi.SummaryCallback() {
@Override public void onWaterColumnsLoaded(final WaterColumn column) {
mMapView.hideProgressBar();
if (column == null){
mMapView.showMessage(NO_EMU_FOUND);
mMapView.onNoEmusFound();
}else{
mMapView.setSelectedPoint(point);
mMapView.setViewpoint();
mMapView.showClickedLocation(point);
mMapView.showSummary(column);
}
}
});
}
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:32,代码来源:MapPresenter.java
示例6: getWaterProfiles
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
@Override public void getWaterProfiles(Point point) {
mView.showProgressBar("Building scatter plots", "Preparing Water Profile");
mDataManager.queryForEmuColumnProfile(mColumnLocation, new ServiceApi.ColumnProfileCallback() {
@Override public void onProfileLoaded(WaterProfile waterProfile) {
if (waterProfile.measurementCount() > 0){
List<CombinedData> combinedDataList = new ArrayList<CombinedData>();
combinedDataList.add(buildCombinedData(waterProfile,"TEMPERATURE"));
combinedDataList.add(buildCombinedData(waterProfile,"SALINITY"));
combinedDataList.add(buildCombinedData(waterProfile,"DISSOLVED_OXYGEN"));
combinedDataList.add(buildCombinedData(waterProfile,"PHOSPHATE"));
combinedDataList.add(buildCombinedData(waterProfile,"SILICATE"));
combinedDataList.add(buildCombinedData(waterProfile,"NITRATE"));
mView.showWaterProfiles(combinedDataList);
}else{
// Notify user
mView.showMessage("No profile data found");
}
mView.hideProgressBar();
}
});
}
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:25,代码来源:WaterProfilePresenter.java
示例7: clickOnOceanPoint
import com.esri.arcgisruntime.geometry.Point; //导入依赖的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
示例8: findPlacesNearby
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Use the location service to geocode places of interest
* based on the map's visible area extent.
*/
@Override public final void findPlacesNearby() {
mMapView.showProgressIndicator("Finding nearby places...");
final Point g = mMapView.getMapView().getVisibleArea().getExtent().getCenter();
if ( g !=null ){
final GeocodeParameters parameters = new GeocodeParameters();
parameters.setMaxResults(MAX_RESULT_COUNT);
parameters.setPreferredSearchLocation(g);
mLocationService.getPlacesFromService(parameters, new PlacesServiceApi.PlacesServiceCallback() {
@Override public void onLoaded(final Object places) {
final List<Place> data = (List) places;
// Create graphics for displaying locations in map
mMapView.showNearbyPlaces(data);
}
});
}
}
开发者ID:Esri,项目名称:nearby-android,代码行数:23,代码来源:MapPresenter.java
示例9: getResultEnvelope
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Return the current extent. If the current extent is null,
* calculate extent based on current search results.
* @return Envelope
*/
public final Envelope getResultEnvelope(){
if (mCurrentEnvelope == null){
Envelope envelope = null;
final List<Place> places = getPlacesFromRepo();
if (!places.isEmpty()){
final List<Point> points = new ArrayList<>();
for (final Place place : places){
points.add(place.getLocation());
}
final Multipoint mp = new Multipoint(points);
envelope = GeometryEngine.buffer(mp, 0.0007).getExtent();
}
return envelope;
}else{
return mCurrentEnvelope;
}
}
开发者ID:Esri,项目名称:nearby-android,代码行数:24,代码来源:LocationService.java
示例10: changeMission
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Change the mission data and reset the animation.
*/
@FXML
private void changeMission() {
// clear previous mission data
missionData = new ArrayList<>();
// get mission data
String mission = missionSelector.getSelectionModel().getSelectedItem();
missionData = getMissionData(mission);
animationModel.setFrames(missionData.size());
animationModel.setKeyframe(0);
// draw mission route on mini map
PointCollection points = new PointCollection(WGS84);
points.addAll(missionData.stream().map(m -> (Point) m.get("POSITION")).collect(Collectors.toList()));
Polyline route = new Polyline(points);
routeGraphic.setGeometry(route);
// refresh mini map zoom and show initial keyframe
mapView.setViewpointScaleAsync(100000).addDoneListener(() -> Platform.runLater(() -> animate(0)));
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:25,代码来源:Animate3dGraphicController.java
示例11: getMissionData
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Loads the mission data from a .csv file into memory.
*
* @param mission .csv file name containing the mission data
* @return ordered list of mapped key value pairs representing coordinates and rotation parameters for each step of
* the mission
*/
private List<Map<String, Object>> getMissionData(String mission) {
// open a file reader to the mission file that automatically closes after read
try (BufferedReader missionFile = new BufferedReader(
new InputStreamReader(getClass().getResourceAsStream("/csv/" + mission)))) {
return missionFile.lines()
//ex: -156.3666517,20.6255059,999.999908,83.77659,1.05E-09,-47.766567
.map(l -> l.split(","))
.map(l -> {
// create a map of parameters (ordinates) to values
Map<String, Object> ordinates = new HashMap<>();
ordinates.put("POSITION", new Point(Float.valueOf(l[0]), Float.valueOf(l[1]), Float.valueOf(l[2]),
WGS84));
ordinates.put("HEADING", Float.valueOf(l[3]));
ordinates.put("PITCH", Float.valueOf(l[4]));
ordinates.put("ROLL", Float.valueOf(l[5]));
return ordinates;
})
.collect(Collectors.toList());
} catch (IOException e) {
e.printStackTrace();
}
throw new RuntimeException("Error reading mission file: " + mission);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:32,代码来源:Animate3dGraphicController.java
示例12: createGraphics
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Create red and green triangle graphics and displays them to the view.
*/
private void createGraphics() {
// applies graphics to the view who's altitude is increased by surface's elevation
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.getSceneProperties().setSurfacePlacement(SurfacePlacement.ABSOLUTE);
sceneView.getGraphicsOverlays().add(graphicsOverlay);
// creating graphics for view
redPoint = new Point(-77.69531409620706, 40.25390707699415, 900, sr);
redSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.TRIANGLE, 0xFFFF0000, 20);
redGraphic = new Graphic(redPoint, redSymbol);
graphicsOverlay.getGraphics().add(redGraphic);
greenPoint = new Point(-120.05859621653715, 38.847657048103514, 1000, sr);
greenSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.TRIANGLE, 0xFF00FF00, 20);
greenSymbol.setAngle(30);
greenGraphic = new Graphic(greenPoint, greenSymbol);
graphicsOverlay.getGraphics().add(greenGraphic);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:23,代码来源:CalculateDistance3dController.java
示例13: convertToCartesianPoint
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Converts a Point to the Cartesian coordinate system.
*
* @param point point to convert
* @return a 3D point in Cartesian coordinates
*/
private Point3D convertToCartesianPoint(Point point) {
double x = convertToRadians(point.getY());
double y = convertToRadians(point.getX());
double z = point.getZ();
// in meters
int earthRadius = 6371000;
double radius = z + earthRadius;
double radCosLat = radius * Math.cos(y);
double p1 = radCosLat * Math.sin(x);
double p2 = radCosLat * Math.cos(x);
double p3 = radius * Math.sin(y);
return new Point3D(p1, p2, p3);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:24,代码来源:CalculateDistance3dController.java
示例14: createFacilitiesAndGraphics
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Creates facilities around the San Diego region.
* <p>
* Facilities are created using point geometry which is then used to make graphics for the graphics overlay.
*/
private void createFacilitiesAndGraphics() {
// List of facilities to be placed around San Diego area
facilities = Arrays.asList(
new Facility(new Point(-1.3042129900625112E7, 3860127.9479775648, spatialReference)),
new Facility(new Point(-1.3042193400557665E7, 3862448.873041752, spatialReference)),
new Facility(new Point(-1.3046882875518233E7, 3862704.9896770366, spatialReference)),
new Facility(new Point(-1.3040539754780494E7, 3862924.5938606677, spatialReference)),
new Facility(new Point(-1.3042571225655518E7, 3858981.773018156, spatialReference)),
new Facility(new Point(-1.3039784633928463E7, 3856692.5980474586, spatialReference)),
new Facility(new Point(-1.3049023883956768E7, 3861993.789732541, spatialReference)));
// image for displaying facility
String facilityUrl = "http://static.arcgis.com/images/Symbols/SafetyHealth/Hospital.png";
PictureMarkerSymbol facilitySymbol = new PictureMarkerSymbol(facilityUrl);
facilitySymbol.setHeight(30);
facilitySymbol.setWidth(30);
// for each facility, create a graphic and add to graphics overlay
facilities.stream().map(f -> new Graphic(f.getGeometry(), facilitySymbol))
.collect(Collectors.toCollection(() -> facilityGraphicsOverlay.getGraphics()));
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:27,代码来源:ClosestFacilitySample.java
示例15: animate
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Moves the tank toward the current waypoint a short distance.
*/
private void animate() {
if (waypoint != null) {
// get current location and distance from waypoint
Point location = (Point) tank.getGeometry();
GeodeticDistanceResult distance = GeometryEngine.distanceGeodetic(location, waypoint, METERS, DEGREES,
GeodeticCurveType.GEODESIC);
// move toward waypoint a short distance
location = GeometryEngine.moveGeodetic(location, 1.0, METERS, distance.getAzimuth1(), DEGREES,
GeodeticCurveType.GEODESIC);
tank.setGeometry(location);
// rotate toward waypoint
double heading = (double) tank.getAttributes().get("HEADING");
tank.getAttributes().put("HEADING", heading + ((distance.getAzimuth1() - heading) / 10));
// reached waypoint, stop moving
if (distance.getDistance() <= 5) {
waypoint = null;
}
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:26,代码来源:ViewshedGeoElementSample.java
示例16: placePictureMarkerSymbol
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Adds a Graphic to the Graphics Overlay using a Point and a Picture Marker
* Symbol.
*
* @param markerSymbol PictureMarkerSymbol to be used
* @param graphicPoint where the Graphic is going to be placed
*/
private void placePictureMarkerSymbol(PictureMarkerSymbol markerSymbol, Point graphicPoint) {
// set size of the image
markerSymbol.setHeight(40);
markerSymbol.setWidth(40);
// load symbol asynchronously
markerSymbol.loadAsync();
// add to the graphic overlay once done loading
markerSymbol.addDoneLoadingListener(() -> {
if (markerSymbol.getLoadStatus() == LoadStatus.LOADED) {
Graphic symbolGraphic = new Graphic(graphicPoint, markerSymbol);
graphicsOverlay.getGraphics().add(symbolGraphic);
} else {
Alert alert = new Alert(Alert.AlertType.ERROR, "Picture Marker Symbol Failed to Load!");
alert.show();
}
});
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:29,代码来源:PictureMarkerSymbolSample.java
示例17: initialize
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
// initialize the component values
name.setText(styleSymbolSearchResult.getName());
tags.setText(styleSymbolSearchResult.getTags().toString());
symbolClass.setText(styleSymbolSearchResult.getSymbolClass());
category.setText(styleSymbolSearchResult.getCategory());
key.setText(styleSymbolSearchResult.getKey());
// set image for non-text symbols
if (!category.getText().startsWith("Text")) {
Symbol symbol = styleSymbolSearchResult.getSymbol();
ListenableFuture<Image> imageResult = symbol.createSwatchAsync(40, 40, 0x00FFFFFF, new Point(0, 0, 0));
imageResult.addDoneListener(() -> {
try {
imageView.setImage(imageResult.get());
} catch (ExecutionException | InterruptedException e) {
e.printStackTrace();
}
});
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:23,代码来源:SymbolView.java
示例18: addFeature
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Adds a new Feature to a ServiceFeatureTable and applies the changes to the
* server.
*
* @param mapPoint location to add feature
* @param featureTable service feature table to add feature
*/
private void addFeature(Point mapPoint, ServiceFeatureTable featureTable) {
// create default attributes for the feature
Map<String, Object> attributes = new HashMap<>();
attributes.put("typdamage", "Destroyed");
attributes.put("primcause", "Earthquake");
// creates a new feature using default attributes and point
Feature feature = featureTable.createFeature(attributes, mapPoint);
// check if feature can be added to feature table
if (featureTable.canAdd()) {
// add the new feature to the feature table and to server
featureTable.addFeatureAsync(feature).addDoneListener(() -> applyEdits(featureTable));
} else {
displayMessage(null, "Cannot add a feature to this feature table");
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:26,代码来源:AddFeaturesSample.java
示例19: createGraphic
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Creates a graphic using a symbol dictionary and the attributes that were passed.
*
* @param attributes tells symbol dictionary what symbol to apply to graphic
*/
private static Graphic createGraphic(Map<String, Object> attributes) {
// get spatial reference
int wkid = Integer.parseInt((String) attributes.get("_wkid"));
SpatialReference sr = SpatialReference.create(wkid);
// get points from coordinates' string
PointCollection points = new PointCollection(sr);
String[] coordinates = ((String) attributes.get("_control_points")).split(";");
Stream.of(coordinates)
.map(cs -> cs.split(","))
.map(c -> new Point(Double.valueOf(c[0]), Double.valueOf(c[1]), sr))
.collect(Collectors.toCollection(() -> points));
// return a graphic with multipoint geometry
return new Graphic(new Multipoint(points), attributes);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:23,代码来源:DictionaryRendererGraphicsOverlaySample.java
示例20: createText
import com.esri.arcgisruntime.geometry.Point; //导入依赖的package包/类
/**
* Creates two TextSymbols and adds them to a GraphicsOverlay.
*/
private void createText() {
// create two text symbols
TextSymbol bassRockTextSymbol = new TextSymbol(10, "Bass Rock", BLUE, HorizontalAlignment.LEFT,
VerticalAlignment.BOTTOM);
TextSymbol craigleithTextSymbol = new TextSymbol(10, "Craigleith", BLUE, HorizontalAlignment.RIGHT,
VerticalAlignment.TOP);
// create two points
Point bassPoint = new Point(-2.64, 56.079, SPATIAL_REFERENCE);
Point craigleithPoint = new Point(-2.72, 56.076, SPATIAL_REFERENCE);
// create two graphics from the points and symbols
Graphic bassRockGraphic = new Graphic(bassPoint, bassRockTextSymbol);
Graphic craigleithGraphic = new Graphic(craigleithPoint, craigleithTextSymbol);
// add graphics to the graphics overlay
graphicsOverlay.getGraphics().add(bassRockGraphic);
graphicsOverlay.getGraphics().add(craigleithGraphic);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:25,代码来源:AddGraphicsWithSymbolsSample.java
注:本文中的com.esri.arcgisruntime.geometry.Point类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论