You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (e.isStillSincePress() && e.getButton() == MouseButton.PRIMARY) {
139
-
Point2Dpoint2D = newPoint2D(e.getX(), e.getY());
140
-
Pointpoint = mapView.screenToLocation(point2D);
141
-
inputs.add(point);
139
+
140
+
Point2Dpoint = newPoint2D(e.getX(), e.getY());
141
+
142
+
// create a map point from a point
143
+
PointmapPoint = mapView.screenToLocation(point);
144
+
145
+
// the map point should be normalized to the central meridian when wrapping around a map, so its value stays within the coordinate system of the map view
Copy file name to clipboardExpand all lines: geometry/nearest-vertex/src/main/java/com/esri/samples/nearest_vertex/NearestVertexSample.java
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -123,14 +123,20 @@ public void start(Stage stage) {
123
123
// get the nearest vertex and coordinate where the user clicks
124
124
mapView.setOnMouseClicked(e -> {
125
125
if (e.isStillSincePress() && e.getButton() == MouseButton.PRIMARY) {
126
+
// create a point from where the user clicked
127
+
Point2Dpoint = newPoint2D(e.getX(), e.getY());
128
+
129
+
// create a map point from a point
130
+
PointmapPoint = mapView.screenToLocation(point);
131
+
132
+
// the map point should be normalized to the central meridian when wrapping around a map, so its value stays within the coordinate system of the map view
0 commit comments