This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from Esri/FreehandSketch
Added freehand modes to the Sketch sample
- Loading branch information
Showing
26 changed files
with
176 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-92 Bytes
arcgis-ios-sdk-samples/Display information/Sketch on the map/Images/line.gif
Binary file not shown.
Binary file removed
BIN
-866 Bytes
arcgis-ios-sdk-samples/Display information/Sketch on the map/Images/point.gif
Binary file not shown.
Binary file removed
BIN
-909 Bytes
arcgis-ios-sdk-samples/Display information/Sketch on the map/Images/polygon.gif
Binary file not shown.
13 changes: 10 additions & 3 deletions
13
arcgis-ios-sdk-samples/Display information/Sketch on the map/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
# Sketch on the map | ||
|
||
This sample demonstrates how you can use the sketch graphics overlay to draw point or line or polygon geometry | ||
This sample demonstrates how you can use the sketch editor to draw point or line or polygon geometry. Sketch editor now also supports freehand polyline and polygon drawing. | ||
|
||
## How to use the sample | ||
|
||
The sample has a toolbar of sketch tools at the bottom. You can choose the type of geometry using the switch. Sketch by tapping on the map. There are tools to undo or redo an action or clear everything. | ||
The sample has a toolbar of sketch tools at the bottom. You can choose the type of geometry using the switch. Sketch by tapping or tapping and dragging (for freehand mode) on the map. There are tools to undo or redo an action or clear everything. | ||
|
||
![](image1.png) | ||
![](image2.png) | ||
|
||
## How it works | ||
|
||
To set the type of geometry, you need to use `start(with:creationMode:)` method on `AGSSketchEditor`, passing in the geometry type you want. The sketch graphics overlay has a undo manager of type `NSUndoManager` that provides the undo and redo methods. To clear everything there is a `clearGeometry()` method on the sketch graphics overlay. | ||
The sample uses `start(with:creationMode:)` initializer on `AGSSketchEditor`. The initializer takes in the creation mode which could be any of the following: | ||
|
||
- Point | ||
- Polyline | ||
- FreehandPolyline | ||
- Polygon | ||
- FreehandPolygon | ||
|
||
The sketch editor has a undo manager of type `NSUndoManager` that provides the undo and redo methods. To clear everything there is a `clear` method on the sketch graphics overlay. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
arcgis-ios-sdk-samples/Images.xcassets/FreehandPolygon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "FreehandPolygon.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "FreehandPolygon@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "FreehandPolygon@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+1.49 KB
...is-ios-sdk-samples/Images.xcassets/FreehandPolygon.imageset/FreehandPolygon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.25 KB
...ios-sdk-samples/Images.xcassets/FreehandPolygon.imageset/FreehandPolygon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.76 KB
...ios-sdk-samples/Images.xcassets/FreehandPolygon.imageset/FreehandPolygon@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
arcgis-ios-sdk-samples/Images.xcassets/FreehandPolyline.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "iOS7_Toolbar_FreehandSketch22.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "iOS7_Toolbar_FreehandSketch44.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+1.16 KB
...les/Images.xcassets/FreehandPolyline.imageset/iOS7_Toolbar_FreehandSketch22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.5 KB
...les/Images.xcassets/FreehandPolyline.imageset/iOS7_Toolbar_FreehandSketch44.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
arcgis-ios-sdk-samples/Images.xcassets/Point.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Point.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Point@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Point@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
arcgis-ios-sdk-samples/Images.xcassets/Polygon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Polygon.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Polygon@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Polygon@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.87 KB
arcgis-ios-sdk-samples/Images.xcassets/Polygon.imageset/Polygon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.15 KB
arcgis-ios-sdk-samples/Images.xcassets/Polygon.imageset/Polygon@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
arcgis-ios-sdk-samples/Images.xcassets/Polyline.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Polyline.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Polyline@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Polyline@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+1.13 KB
arcgis-ios-sdk-samples/Images.xcassets/Polyline.imageset/Polyline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.27 KB
arcgis-ios-sdk-samples/Images.xcassets/Polyline.imageset/Polyline@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.36 KB
arcgis-ios-sdk-samples/Images.xcassets/Polyline.imageset/Polyline@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.