AGSGraphicsLayer Class Reference


Description

This layer allows you to add graphics on the map. By using these graphics, you can add your own places of interest to the map, or highlight existing places.

Each graphic contains a geometry describing the location and the shape of the graphic. A Graphics layer typically contains graphics based on a single geometry type (Point, Multipoint, Polyline, or Polygon). Each graphic can be associated with an AGSSymbol which controls how the graphic looks. Alternatively, the layer can be associated with an AGSRenderer which manages the appearance of all graphics in the layer.

In a Model-View-Controller architecture, this object represents the Model. The corresponding View object, AGSDynamicLayerView, is created when this object is added to the map.

The spatialReference property of a graphics layer is defined either by setting the initialEnvelope with a valid spatial reference or when the first graphic is added with a valid geometry and spatial reference. Furthermore, the geometry of individual graphics in the layer must be of the same spatial reference.

Defined in:
AGSGraphicsLayer.h ( ArcGIS library)
Since:
1.0
See also:
AGSMapViewDelegate for events related to tapping on graphics in the graphics layer.
Inheritance diagram for AGSGraphicsLayer:
AGSDynamicLayer AGSLayer AGSFeatureLayer AGSSketchGraphicsLayer

List of all members.

Public Member Functions

(void) - addGraphic:
(void) - addGraphics:
(void) - dataChanged
(NSOperation
< AGSDynamicLayerDrawingOperation > *) 
- exportMapImage:
(void) - layerDidFailToLoad:
(void) - layerDidLoad
(void) - removeAllGraphics
(void) - removeGraphic:

Static Public Member Functions

(id) + graphicsLayer

Properties

id< AGSLayerDelegatedelegate
NSError * error
id< AGSExportMapImageDelegateexportDelegate
AGSEnvelopefullEnvelope
AGSDynamicLayerGPSAutoPanDrawingMode gpsAutoPanDrawingMode
NSMutableArray * graphics
AGSEnvelopeinitialEnvelope
BOOL loaded
double maxScale
double minScale
NSString * name
AGSRendererrenderer
BOOL renderNativeResolution
AGSSpatialReferencespatialReference
BOOL timeAware
AGSUnits units

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) 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.

- (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
- (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) 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

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.

- (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]

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

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

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
- (double) maxScale [read, write, assign]

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.

- (double) minScale [read, write, assign]

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]

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]

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.

- (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
- (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