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
Copy file name to clipboardExpand all lines: display_information/update-graphics/README.md
+3-12Lines changed: 3 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,29 +10,20 @@ A field worker may want to update a graphic's properties to adjust which real-wo
10
10
11
11
## How to use the sample
12
12
13
-
Update Graphic's Location:
14
-
- click on a graphic, then click the update location button
15
-
- now click a new location on the map to move graphic
16
-
17
-
Update Graphic's Description:
18
-
- click on a graphic, then click the update description button
19
-
- enter a new description and click ok
20
-
21
-
Update Graphic's Symbol:
22
-
- click on a graphic, then choose a symbol from the update symbol drop down box
13
+
To update the graphic's location, click on a graphic and then drag it to a new location. Use the "Update Description" button to provide a new description for the graphic, and use the "Update Symbol" drop down menu to choose a new symbol. Click away from the graphic to de-select it.
23
14
24
15
## How it works
25
16
26
17
1. Capture clicks on the `MapView` by using `.setOnMouseClicked()`. Then use the event to create a `Point` from the clicked location.
27
18
2. Identify the clicked graphics using `MapView.identifyGraphicsOverlayAsync(graphicsOverlay, pointClicked, tolerance, max results)`.
28
19
3. To select a clicked graphics, iterate through the list of graphics returned by the identification method, and set each graphic's selection property to `true`.
29
-
4. To update graphic's location, create a new `Point` from the user's clicked point, and use `Graphic.setGeometry(point)` to modify the graphic's geometry.
20
+
4. To update a graphic's location, capture drags on the map view using `.setOnMouseDragged()`, and use `Graphic.setGeometry(point)` to modify the graphic's geometry from the dragged location.
30
21
5. To update a graphic's attribute, get the attributes of the selected graphic and set the `DESCRIPTION` key with the desired string value using `Graphic.getAttributes().put("DESCRIPTION",)`.
31
22
6. To update graphic's symbol simply assign that symbol to the selected graphic using `Graphic.setSymbol(SimpleMarkerSymbol)`.
32
23
33
24
## Additional information
34
25
35
-
A graphic's geometry is its location on a map. The symbol controls how a graphic will be displayed to a map. And the attributes store information about the graphic in key value pairs.
26
+
A graphic's geometry is its location on a map. The symbol controls how a graphic will be displayed to a map. The attributes store information about the graphic in key value pairs.
Copy file name to clipboardExpand all lines: display_information/update-graphics/src/main/java/com/esri/samples/update_graphics/UpdateGraphicsSample.java
0 commit comments