AGSSketchGraphicsLayer Class Reference


Description

A layer that allows the user to sketch geometries on the map.

See also:
Conceptual Doc: Using a Sketch Layer
Sample: Sketch Layer
Since:
1.8
Inheritance diagram for AGSSketchGraphicsLayer:
AGSGraphicsLayer <AGSMapViewTouchDelegate> AGSDynamicLayer AGSLayer

List of all members.

Public Member Functions

(void) - addGraphic:
(void) - addGraphics:
(void) - addPart
(void) - applyGeometry:
(void) - clear
(void) - dataChanged
(NSOperation
< AGSDynamicLayerDrawingOperation > *) 
- exportMapImage:
(id) - initWithGeometry:
(void) - insertVertex:inPart:atIndex:
(void) - layerDidFailToLoad:
(void) - layerDidLoad
(void) - mapView:didClickAtPoint:mapPoint:graphics:
(void) - mapView:didEndTapAndHoldAtPoint:mapPoint:graphics:
(void) - mapView:didMoveTapAndHoldAtPoint:mapPoint:graphics:
(void) - mapView:didTapAndHoldAtPoint:mapPoint:graphics:
(BOOL) - mapView:shouldProcessClickAtPoint:mapPoint:
(void) - moveVertexInPart:atIndex:toPoint:
(void) - removeAllGraphics
(void) - removeGraphic:
(void) - removePartAtIndex:
(BOOL) - removeSelectedPart
(BOOL) - removeSelectedVertex
(void) - removeVertexInPart:atIndex:
(void) - selectLastVertex

Static Public Member Functions

(AGSCompositeSymbol *) + defaultMainSymbol
(AGSMarkerSymbol *) + defaultMidVertexSymbol
(AGSMarkerSymbol *) + defaultSelectedVertexSymbol
(AGSMarkerSymbol *) + defaultVertexSymbol
(id) + graphicsLayer

Properties

id< AGSLayerDelegatedelegate
NSError * error
id< AGSExportMapImageDelegateexportDelegate
AGSEnvelopefullEnvelope
AGSGeometrygeometry
AGSDynamicLayerGPSAutoPanDrawingMode gpsAutoPanDrawingMode
NSMutableArray * graphics
AGSEnvelopeinitialEnvelope
BOOL loaded
AGSCompositeSymbolmainSymbol
double maxScale
AGSMarkerSymbolmidVertexSymbol
double minScale
NSString * name
AGSRendererrenderer
BOOL renderNativeResolution
AGSMarkerSymbolselectedVertexSymbol
AGSSpatialReferencespatialReference
BOOL timeAware
NSUndoManager * undoManager
AGSUnits units
AGSMarkerSymbolvertexSymbol

Member Function Documentation

- (void) addGraphic: (AGSGraphic *)  graphic  

Adds graphic to the layer. You must call dataChanged to redraw the layer.

Parameters:
graphic The graphic to be added.
Since:
1.0
- (void) addGraphics: (NSArray *)  graphics  

Adds graphics to the layer. You must call dataChanged to redraw the layer.

Parameters:
graphics Array of AGSGraphic objects to be added.
Since:
1.0
- (void) addPart  

Add a part to the geometry

Since:
1.8
- (void) applyGeometry: (AGSGeometry *)  geometry  

Applies the passed in geometry to the current geometry. These geometries must be matching in type.

Since:
1.8
- (void) clear  

Clears the current geometry.

Since:
1.8
- (void) dataChanged  

This method tells the graphics layer that the underlying graphics or symbology has changed and that it needs to be redrawn.

Since:
1.0

Implements AGSLayer.

+ (AGSCompositeSymbol*) defaultMainSymbol  

The default main symbol for sketch graphics layers, this symbol is used for the lines and fills.

Since:
1.8
+ (AGSMarkerSymbol*) defaultMidVertexSymbol  

The default symbol to display the mid vertices for sketch graphics layers.

Since:
1.8
+ (AGSMarkerSymbol*) defaultSelectedVertexSymbol  

The default selected vertex symbol for sketch graphics layers.

Since:
1.8
+ (AGSMarkerSymbol*) defaultVertexSymbol  

The default symbol used to display the vertices for sketch graphics layers.

Since:
1.8
- (NSOperation<AGSDynamicLayerDrawingOperation>*) exportMapImage: (AGSExportImageParams *)  params  

Get new map image. The exportDelegate is notified when the image is exported. This method must be implemented by subclasses.

Parameters:
params The input parameters for the export image operation.
Since:
1.0
+ (id) graphicsLayer  

A method to get an initialized and autoreleased graphics layer.

Returns:
A new, autoreleased, graphics layer object.
Since:
1.0
- (id) initWithGeometry: (AGSGeometry *)  geometry  

Initializes an AGSSketchGraphicsLayer.

Parameters:
geometry The geometry that will be modified as the user sketches. This geometry must be mutable.
Since:
1.8
- (void) insertVertex: (AGSPoint *)  point
inPart: (int)  partIndex
atIndex: (int)  coordinateIndex 

Inserts a vertex in a specfied part and index.

Parameters:
point The vertex to insert.
partIndex The index of the part to insert the point.
coordinateIndex The index of the coordinate at which to insert the point.
Since:
1.8
- (void) layerDidFailToLoad: (NSError *)  error  

Method to notify the delegate that a layer failed to load. This method will also post a "LayerFailedToLoad" notification that can be observed by the developer.

Parameters:
error Information regarding the cause of the layer failing to load.
Since:
1.0
- (void) layerDidLoad  

Method to notify the delegate that a layer successfully loaded. This method will also post a "LayerDidLoad" notification that can be observed by the developer.

Since:
1.0
- (void) mapView: (AGSMapView *)  mapView
didClickAtPoint: (CGPoint)  screen
mapPoint: (AGSPoint *)  mappoint
graphics: (NSDictionary *)  graphics 

The method that is called when a user clicks on the map.

Since:
1.8

Reimplemented from <AGSMapViewTouchDelegate>.

- (void) mapView: (AGSMapView *)  mapView
didEndTapAndHoldAtPoint: (CGPoint)  screen
mapPoint: (AGSPoint *)  mappoint
graphics: (NSDictionary *)  graphics 

The method that is called when a user ends a tap and hold on the map.

Since:
1.8

Reimplemented from <AGSMapViewTouchDelegate>.

- (void) mapView: (AGSMapView *)  mapView
didMoveTapAndHoldAtPoint: (CGPoint)  screen
mapPoint: (AGSPoint *)  mappoint
graphics: (NSDictionary *)  graphics 
[optional, inherited]

Tells the delegate that the user moved his finger while tapping and holding on the map.

Parameters:
mapView Map tapped and held by the user.
screen Location in screen coordinates.
mappoint Location in map coordinates.
graphics Graphics from all graphics layers in the map that intersect or contain the location. The dictionary contains layer name (key) : AGSGraphic array (value)
Since:
1.8
- (void) mapView: (AGSMapView *)  mapView
didTapAndHoldAtPoint: (CGPoint)  screen
mapPoint: (AGSPoint *)  mappoint
graphics: (NSDictionary *)  graphics 
[optional, inherited]

Tells the delegate that a point on the map was tapped and held at specified location.

Parameters:
mapView Map tapped and held by the user.
screen Location in screen coordinates.
mappoint Location in map coordinates.
graphics Graphics from all graphics layers in the map that intersect or contain the location. The dictionary contains layer name (key) : AGSGraphic array (value)
Since:
1.8
- (BOOL) mapView: (AGSMapView *)  mapView
shouldProcessClickAtPoint: (CGPoint)  screen
mapPoint: (AGSPoint *)  mappoint 
[optional, inherited]

Asks the delegate if the map should process the click at the given location. The default value if this method is not implemented is YES.

Parameters:
mapView Map tapped by the user.
screen Location in screen coordinates.
mappoint Location in map coordinates.
Returns:
BOOL value whether the click should be processed by the map.
Since:
2.0
- (void) moveVertexInPart: (int)  partIndex
atIndex: (int)  coordinateIndex
toPoint: (AGSPoint *)  point 

Moves a vertex to a specified location.

Parameters:
partIndex The index of the part to insert the point.
coordinateIndex The index of the coordinate at which to insert the point.
point The location to move the point to.
Since:
1.8
- (void) removeAllGraphics  

Remove all graphics from the layer. You must call dataChanged to redraw the layer.

Since:
1.0
- (void) removeGraphic: (AGSGraphic *)  graphic  

Remove graphic from the graphics collection. You must call dataChanged to redraw the layer.

Parameters:
graphic The graphic to be removed.
Since:
1.0
- (void) removePartAtIndex: (int)  partIndex  

Removes a part at a specified index.

Parameters:
partIndex Index of the part to remove.
Since:
1.8
- (BOOL) removeSelectedPart  

Removes the selected part.

Returns:
Boolean value that specifies if the remove succeeded.
Since:
1.8
- (BOOL) removeSelectedVertex  

Removes the selected vertex.

Returns:
Boolean value that specifies if the remove succeeded.
Since:
1.8
- (void) removeVertexInPart: (int)  partIndex
atIndex: (int)  coordinateIndex 

Remove a vertex in a specified part and index.

Parameters:
partIndex The index of the part to remove the vertex.
coordinateIndex The index of the coordinate to remove.
Since:
1.8
- (void) selectLastVertex  

Selects the last vertex in the geometry.

Since:
1.8

Property Documentation

- (id<AGSLayerDelegate>) delegate [read, write, assign, inherited]

Delegate to be notified when the layer is loaded or fails to load. When this layer is loaded, a corresponding AGSLayerView object is automatically set as the delegate. This delegate must not be replaced.

Since:
1.0
- (NSError*) error [read, retain, inherited]

Information about the error associated with a layer.

Since:
1.0
- (id<AGSExportMapImageDelegate>) exportDelegate [read, write, assign, inherited]

Delegate to be notified of events related to exporting the map image. When this layer is loaded, a corresponding View object is automatically set as the exportDelegate which should not be replaced.

Since:
1.0
- (AGSEnvelope*) fullEnvelope [read, assign, inherited]

Full extent of the layer.

Since:
1.0

Implemented in AGSBingMapLayer, AGSGPResultLayer, and AGSOpenStreetMapLayer.

- (AGSGeometry*) geometry [read, write, retain]

The geometry that is populated as the user sketches. Must be a mutable geometry because it will be modified by the layer while the user is sketching.

Since:
1.8
- (AGSDynamicLayerGPSAutoPanDrawingMode) gpsAutoPanDrawingMode [read, write, assign, inherited]

Defines the drawing behavior for a dynamic layer when the map's gps is in an auto-pan mode. For some layers, especially those that make network request, you may want this property accordingly. When the map is navigating from the gps it can generate a lot of requests resulting in a heavy server load.

Since:
2.1
- (NSMutableArray*) graphics [read, retain, inherited]

The array of AGSGraphic objects that need to be displayed on the map.

Since:
1.0
- (AGSEnvelope*) initialEnvelope [read, write, retain, inherited]

Gets or sets the initial envelope of the layer.

Since:
1.0

Implements AGSLayer.

- (BOOL) loaded [read, assign, inherited]

A property indicating whether the layer is loaded and ready to be used. When the layer is loaded, the value becomes YES, and layer properties can be accessed.

Since:
1.0
See also:
AGSLayerDelegate
- (AGSCompositeSymbol*) mainSymbol [read, write, retain]

Composite symbol that contains the symbology for drawing the lines and fills for what the user sketches.

Since:
1.8
- (double) maxScale [read, write, assign, inherited]

The maximum scale at which this layer is visible. If the map is zoomed in beyond this scale, the layer will not be visible.

Since:
1.0

Implements AGSDynamicLayer.

- (AGSMarkerSymbol*) midVertexSymbol [read, write, retain]

Symbol to display the mid vertices.

Since:
1.8
- (double) minScale [read, write, assign, inherited]

The minimum scale at which this layer is visible. If the map is zoomed out beyond this scale, the layer will not be visible.

Since:
1.0

Implements AGSDynamicLayer.

- (NSString*) name [read, retain, inherited]

The name of the layer. This property will be set by the framework when the layer is added to the map.

Since:
1.8
- (AGSRenderer*) renderer [read, write, retain, inherited]

AGSRenderer assigned to the layer. It is responsible for symbolizing the graphics. It is optional as each graphic may have it's own symbol. If a graphic has a symbol, that will be used for drawing the graphic instead of the renderer.

Since:
1.0
- (BOOL) renderNativeResolution [read, write, assign, inherited]

Flag indicating if the layer renders at the native resolution. This property will not have any affect iOS devices without a retina display. If using an iOS device with a retina display and you want to take advantage of that display you can set this value to YES. The property must be set before the layer loads.

When rendering at the native resolution, this layer will use more memory (because the map images will be bigger).

Since:
2.1

Implements AGSLayer.

- (AGSMarkerSymbol*) selectedVertexSymbol [read, write, retain]

Symbol used to display the selected vertex.

Since:
1.8
- (AGSSpatialReference*) spatialReference [read, assign, inherited]

The spatial reference of the layer.

Since:
1.0

Implemented in AGSBingMapLayer, AGSGPResultLayer, and AGSOpenStreetMapLayer.

- (BOOL) timeAware [read, assign, inherited]

A property indicating whether the layer is time-aware.

Since:
1.0
- (NSUndoManager*) undoManager [read, retain]

The undo manager.

Since:
1.8
- (AGSUnits) units [read, write, assign, inherited]

The units the layer is in. Possible values include

  • AGSUnitsCentimeters
  • AGSUnitsDecimalDegrees
  • AGSUnitsDecimeters
  • AGSUnitsFeet
  • AGSUnitsInches
  • AGSUnitsKilometers
  • AGSUnitsMeters
  • AGSUnitsMiles
  • AGSUnitsMillimeters
  • AGSUnitsNauticalMiles
  • AGSUnitsPoints
  • AGSUnitsUnknown
  • AGSUnitsYards
Since:
1.0
- (AGSMarkerSymbol*) vertexSymbol [read, write, retain]

Symbol used to display the vertices.

Since:
1.8