AGSSimpleMarkerSymbol Class Reference


Description

Instances of this class represent simple marker symbols. Symbols describe how graphics look on the map. Different symbols are used for graphics with different geometry types. Marker symbols are used to display those graphics which are based on point or multipoint geometry. Simple marker symbols display graphics using simple, predefined markers such as circle, cross, etc. In addition, the markers can have an optional outline, which is defined by a line symbol.

Defined in:
AGSMarkerSymbol.h ( ArcGIS library)
Since:
1.0
Inheritance diagram for AGSSimpleMarkerSymbol:
AGSMarkerSymbol AGSSymbol <AGSCoding>

List of all members.

Public Member Functions

(void) - decodeWithJSON:
(void) - drawGraphic:atX:y:inContext:
(void) - drawGraphic:inContext:forEnvelope:atResolution:
(CGSize) - drawingSize
(NSDictionary *) - encodeToJSON
(BOOL) - hitTestGraphic:withEnvelope:atResolution:
(id) - initWithColor:
(id) - initWithJSON:
(void) - invalidateCache
(BOOL) - shouldDrawGraphic:forEnvelope:atResolution:
(UIImage *) - swatchForGeometryType:size:

Static Public Member Functions

(id) + simpleMarkerSymbol
(id) + simpleMarkerSymbolWithColor:
(CGPoint) + toScreenPointWithX:y:envelope:resolution:

Properties

CGFloat angle
UIColor * color
CGPoint hotspot
AGSSimpleLineSymboloutline
BOOL readyToDraw
BOOL rotateAroundOffset
BOOL shouldCacheSymbol
CGFloat size
AGSSimpleMarkerSymbolStyle style
CGFloat xoffset
CGFloat yoffset

Member Function Documentation

- (void) decodeWithJSON: (NSDictionary *)  json   [optional, inherited]

Decode object from JSON representation.

Parameters:
json The JSON representation of the object to be decoded.
Since:
1.0
- (void) drawGraphic: (AGSGraphic *)  graphic
atX: (float)  x
y: (float)  y
inContext: (CGContextRef)  context 

This must be implemented by derived classes, don't implement drawGraphic:inContext:forEnvelope:withResolution, implement this instead.

Since:
2.2
- (void) drawGraphic: (AGSGraphic *)  graphic
inContext: (CGContextRef)  context
forEnvelope: (AGSEnvelope *)  env
atResolution: (double)  resolution 

Method called by AGSGraphicsLayer to draw geometry onto context.

Since:
1.8
- (CGSize) drawingSize  

This must be implemented by derived classes. Returns the screen size in points of the symbol to be drawn.

Since:
2.2
- (NSDictionary *) encodeToJSON   [optional, inherited]

Encode and return JSON representation for object.

Returns:
JSON representation of object.
Since:
1.0
- (BOOL) hitTestGraphic: (AGSGraphic *)  graphic
withEnvelope: (AGSEnvelope *)  envelope
atResolution: (double)  resolution 

Called to see if the geometry passes a hit test for this symbol.

Since:
1.8
- (id) initWithColor: (UIColor*)  color  

Initializes with a color.

Parameters:
color The color to initialize the marker symbol with.
Since:
1.0
- (id) initWithJSON: (NSDictionary *)  json   [optional, inherited]

Initialize and return object from JSON representation.

Parameters:
json The JSON representation of the object to be created.
Returns:
Object decoded from JSON representation.
Since:
1.0

Reimplemented in AGSWebMapFeatureCollection.

- (void) invalidateCache  

This may be called by derived classes when a property changes and it needs to invalidate the cache. For example, when you change the size of a simple marker symbol, SMS will call it so that it draws correctly, if the symbol is cached.

Since:
2.2
- (BOOL) shouldDrawGraphic: (AGSGraphic *)  graphic
forEnvelope: (AGSEnvelope *)  envelope
atResolution: (double)  resolution 

Called to see if the symbol should draw for a specific envelope.

Since:
1.8
+ (id) simpleMarkerSymbol  

Get autoreleased symbol initialized with default values.

Returns:
A new, autoreleased, marker symbol object.
Since:
1.0
+ (id) simpleMarkerSymbolWithColor: (UIColor*)  color  

Get autoreleased simple marker symbol with a color.

Parameters:
color The color to initialize the marker symbol with.
Since:
1.0
- (UIImage *) swatchForGeometryType: (AGSGeometryType geometryType
size: (CGSize)  size 

Returns an image that represents a swatch for a particular geometry type.

Parameters:
geometryType The type of the geometry determines what kind of swatch is drawn.
size Size of the output swatch.
Returns:
UIImage of the drawn swatch.
+ (CGPoint) toScreenPointWithX: (double)  x
y: (double)  y
envelope: (AGSEnvelope *)  env
resolution: (double)  res 

A method that derived classes can call to help during drawing.

Since:
2.2

Property Documentation

- (CGFloat) angle [read, write, assign, inherited]

The rotation angle (in degrees) of the marker. The marker is rotated in a counter-clockwise direction by the amount specified.

Since:
1.0
- (UIColor*) color [read, write, retain, inherited]

Symbol color.

Since:
1.0
- (CGPoint) hotspot [read, write, assign, inherited]

The location in pixels that defines whether a user tapped on this symbol or not.

For example, consider an AGSPictureMarkerSymbol using the image of a pushpin. By default, the hotspot would be in the center of the image and so a tap would be registered only if a user tapped in the middle of the pushpin. To allow the user to tap on the head of the pin to show a callout, you would need to specify the corresponding location's hotspot. Furthermore, the callout’s leader will be anchored to this hotspot location.

Since:
1.0
- (AGSSimpleLineSymbol*) outline [read, write, retain]

Outline of the marker.

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

Property called by the framework. Most symbols should have this set to YES as soon as the symbol is init'ed. If a symbol needs to access a resource asynchronously before it's ready to draw then it should be set to NO initially then YES once it is ready. This is not as efficient as if a symbol is readyToDraw to begin with, however, so custom symbols should only set this to NO initially if absolutely necessary.

- (BOOL) rotateAroundOffset [read, write, assign, inherited]

If true, the symbol will rotate around the offset location as opposed to the center of the symbol.

Since:
1.8
- (BOOL) shouldCacheSymbol [read, write, assign, inherited]

This property determines whether or not the symbol can be cached for better performance. Default is YES. Set to NO if you have a symbol that changes often, or if it is a temporary symbol that you only use to draw once. For most cases this should be YES.

Since:
2.2
- (CGFloat) size [read, write, assign]

Size of the marker.

Since:
1.0
- (AGSSimpleMarkerSymbolStyle) style [read, write, assign]

The marker style. Possible values include

  • AGSSimpleMarkerSymbolStyleCircle
  • AGSSimpleMarkerSymbolStyleCross
  • AGSSimpleMarkerSymbolStyleDiamond
  • AGSSimpleMarkerSymbolStyleSquare
  • AGSSimpleMarkerSymbolStyleX

Default is AGSSimpleMarkerSymbolStyleCircle.

Since:
1.0
- (CGFloat) xoffset [read, write, assign, inherited]

The offset on the x-axis in points, relative to the center of the marker. Default is 0.0 For example, a value of -5 will shift the marker left by 5 points.

This is useful when the marker needs to be offset to properly coincide with a location on the map.

For example, consider an AGSPictureMarkerSymbol using the image of a pushpin. By default, the center of the image will be used as the anchor to center the image at the map location. However, if you wanted the needle of the pushpin to end at the map location, you would need to specify an xoffset and a yoffset to shift the image appropriately.

Since:
1.0
- (CGFloat) yoffset [read, write, assign, inherited]

The offset on the y-axis in points, relative to the center of the marker. Default is 0.0 For example, a value of -5 will shift the marker down by 5 points.

This is useful when the marker needs to be offset to properly conicide with a location on the map.

For example, consider an AGSPictureMarkerSymbol using the image of a pushpin. By default, the center of the image will be used as the anchor to center the image at the map location. However, if you wanted the needle of the pushpin to end at the map location, you would need to specify an xoffset and a yoffset to shift the image appropriately.

Since:
1.0