Skip to content

Commit 201accb

Browse files
author
Rachael Ellen
committed
Merge branch 'main' into v.next
2 parents e30506d + c845aaa commit 201accb

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

display_information/sketch-on-map/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A field worker could annotate features of interest on a map (via the GUI) such a
1010

1111
## How to use the sample
1212

13-
Choose which geometry type to sketch from one of the available buttons. Choose from points, multipoints, polylines, polygons, freehand polylines, and freehand polygons.
13+
Choose which geometry type to sketch from one of the available buttons. Choose from points, multipoints, polylines, polygons, freehand polylines, freehand polygons and rectangles.
1414

1515
Use the control panel to cancel the sketch, undo or redo changes made to the sketch and to save the sketch to the graphics overlay. There is also the option to select a saved graphic and edit its geometry using the Sketch Editor. The graphics overlay can be cleared using the clear all button.
1616

-87.7 KB
Loading

display_information/sketch-on-map/src/main/java/com/esri/samples/sketch_on_map/SketchOnMapController.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import com.esri.arcgisruntime.symbology.SimpleLineSymbol;
3737
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol;
3838

39-
4039
public class SketchOnMapController {
4140

4241
@FXML
@@ -189,6 +188,15 @@ private void handleFreehandPolygonButtonClicked() {
189188
sketchEditor.start(SketchCreationMode.FREEHAND_POLYGON);
190189
}
191190

191+
/**
192+
* Clear selection of any graphic in the graphics overlay and start a new rectangle sketch.
193+
*/
194+
@FXML
195+
private void handleRectangleButtonClicked() {
196+
graphicsOverlay.clearSelection();
197+
sketchEditor.start(SketchCreationMode.RECTANGLE);
198+
}
199+
192200
/**
193201
* Undo the last change made to the sketch, whilst sketching is active.
194202
*/

display_information/sketch-on-map/src/main/resources/sketch_on_map/main.fxml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@
129129
<Tooltip text="Freehand Polygon"/>
130130
</tooltip>
131131
</Button>
132+
<Button onAction="#handleRectangleButtonClicked" GridPane.rowIndex="3" GridPane.columnIndex="0">
133+
<graphic>
134+
<ImageView>
135+
<Image url="/sketch_on_map/rectangle.png"/>
136+
</ImageView>
137+
</graphic>
138+
<tooltip>
139+
<Tooltip text="Rectangle"/>
140+
</tooltip>
141+
</Button>
132142
</GridPane>
133143
<Separator maxWidth="100"/>
134144
<GridPane vgap="6" hgap="6">
327 Bytes
Loading

0 commit comments

Comments
 (0)