10.2.5: AGSMapViewBase Class Reference
10.2.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
AGSMapViewBase Class Reference

Description

A base class for AGSMapView to facilitate code reuse between iOS and Mac platforms

Inheritance diagram for AGSMapViewBase:
AGSMapView

Instance Methods

(void) - addMapLayer:
 
(void) - addMapLayer:withName:
 
(void) - centerAtPoint:animated:
 
(void) - disableWrapAround
 
(void) - enableWrapAround
 
(void) - insertMapLayer:atIndex:
 
(void) - insertMapLayer:withName:atIndex:
 
(AGSLayer *) - mapLayerForName:
 
(void) - removeMapLayer:
 
(void) - removeMapLayerWithName:
 
(void) - reset
 
(double) - resolutionForScale:
 
(double) - scaleForResolution:
 
(void) - setRotationAngle:animated:
 
(void) - setRotationAngle:aroundMapPoint:animated:
 
(void) - setRotationAngle:aroundScreenPoint:animated:
 
(AGSEnvelope *) - toMapEnvelope:
 
(AGSPoint *) - toMapPoint:
 
(CGPoint) - toScreenPoint:
 
(CGRect) - toScreenRect:
 
(AGSPolygon *) - visibleArea
 
(AGSMapViewWrapAroundStatus- wrapAroundStatus
 
(void) - zoomIn:
 
(void) - zoomOut:
 
(void) - zoomToEnvelope:animated:
 
(void) - zoomToGeometry:withPadding:animated:
 
(void) - zoomToResolution:animated:
 
(void) - zoomToResolution:withCenterPoint:animated:
 
(void) - zoomToScale:animated:
 
(void) - zoomToScale:withCenterPoint:animated:
 
(void) - zoomWithFactor:atAnchorPoint:animated:
 

Properties

BOOL allowCallout
 
BOOL allowMagnifierToPanMap
 
BOOL allowRotationByPinching
 
BOOL animating
 
AGSColorbackgroundColor
 
AGSLayerbaseLayer
 
AGSCalloutcallout
 
id< AGSMapViewCalloutDelegatecalloutDelegate
 
AGSColorgridLineColor
 
CGFloat gridLineWidth
 
CGFloat gridSize
 
BOOL interacting
 
BOOL lastChangeFromInteraction
 
id< AGSMapViewLayerDelegatelayerDelegate
 
BOOL loaded
 
AGSLocationDisplaylocationDisplay
 
AGSPointmapAnchor
 
NSArray * mapLayers
 
double mapScale
 
AGSEnvelopemaxEnvelope
 
double maxResolution
 
double maxScale
 
double minResolution
 
double minScale
 
BOOL releaseHardwareResourcesWhenBackgrounded
 
double resolution
 
double rotationAngle
 
BOOL showMagnifierOnTapAndHold
 
AGSSpatialReferencespatialReference
 
AGSTimeExtenttimeExtent
 
id< AGSMapViewTouchDelegatetouchDelegate
 
AGSEnvelopevisibleAreaEnvelope
 

Protected Attributes

CGFloat _screenScale
 
CGFloat _screenScaleInverse
 

Method Documentation

- (void) addMapLayer: (AGSLayer *)  lyr

Adds a layer to the map. The layer is added on top of existing layers.

Parameters
lyrlayer to add
Since
10.1.1
- (void) addMapLayer: (AGSLayer *)  mapLayer
withName: (NSString *)  name 

Add a layer to the map using the specified name. The first layer added to the map is treated as a basemap layer. It defines the full extent and spatialReference of the map.

Parameters
mapLayerMap Layer to be added to the map.
nameName of layer. You can pass nil, in which case a name will be provided. If specified and the name is not unique, the layer will be given a uniqe name.
Since
1.0
- (void) centerAtPoint: (AGSPoint *)  point
animated: (BOOL)  animated 

Center map at specified location.

Parameters
pointMap point to center map. Point must have the same spatial reference as the map. Point must be in map units.
animatedDetermines if the centering should be animated or immediate.
Since
1.0
- (void) disableWrapAround

Disables wrap around on the map.

Since
10.1.1
- (void) enableWrapAround

Attempts to enable wrap around on the map. Please check the wrapAroundStatus to see if the attempt was successful.

Since
10.1.1
- (void) insertMapLayer: (AGSLayer *)  lyr
atIndex: (NSInteger)  index 

Inserts a layer at the specified index

Parameters
lyrLayer to insert
indexat which to insert. 0 is bottom most.
Since
10.1.1
- (void) insertMapLayer: (AGSLayer *)  mapLayer
withName: (NSString *)  name
atIndex: (NSUInteger)  index 

Inserts a layer to the map with specified name at index.

Parameters
mapLayerMap Layer of type AGSLayer to be added to map.
nameName of layer. You can pass nil, in which case a name will be provided. If specified and the name is not unique, the layer will be given a uniqe name.
indexIndex where layer will be inserted.
Since
1.0
- (AGSLayer*) mapLayerForName: (NSString *)  name

A convenience method to retrieve a layer in the map based on its name.

Parameters
nameof layer to retrieve from the map
Since
10.1.1
- (void) removeMapLayer: (AGSLayer *)  lyr

Removes the given layer from the map

Parameters
lyrLayer to remove
Since
10.1.1
- (void) removeMapLayerWithName: (NSString *)  name

Remove a layer from the map with specified name. Even when the basemap layer is removed, the map's visibleArea , maxEnvelope, and spatialReference properties remain unchanged.

Parameters
nameName of the layer to be removed.
Since
1.0
- (void) reset

Resets the map to an original and unloaded state. Will remove any and all layers from the map. The spatial reference, extents, and othe properties related to the layer will be cleared. The first layer subsequently added to the map after invoking this method will be treated as a basemap layer.

Since
1.8
- (double) resolutionForScale: (double)  mapScale

This function converts a given map scale to resolution.

Since
10.2.2
- (double) scaleForResolution: (double)  resolution

This function converts a given resolution to map scale.

Since
10.2.2
- (void) setRotationAngle: (double)  angle
animated: (BOOL)  animated 

Rotate the map in counter-clockwise direction based on the angle (degrees) specified.

Parameters
angleto rotate the map by
animatedflag indicating if the map should animate to new rotation angle
Since
2.1
- (void) setRotationAngle: (double)  angle
aroundMapPoint: (AGSPoint *)  mapPoint
animated: (BOOL)  animated 

Rotate the map in counter-clockwise direction based on the angle (degrees) specified.

Parameters
angleto rotate the map by
mapPointthe location on the map around which the map should be rotated. The point should have the same spatial reference as the map.
animatedflag indicating if the map should animate to new rotation angle
Since
2.1
- (void) setRotationAngle: (double)  angle
aroundScreenPoint: (CGPoint)  screenPoint
animated: (BOOL)  animated 

Rotate the map in counter-clockwise direction based on the angle (degrees) specified.

Parameters
angleto rotate the map by
screenPointthe location on screen around which the map should be rotated
animatedflag indicating if the map should animate to new rotation angle
Since
2.1
- (AGSEnvelope *) toMapEnvelope: (CGRect)  rect

Converts a rectangle in screen coordinates to an envelope in map units.

Parameters
rectRectangle in screen coordinates to convert from.
Returns
Envelope in map units. Envelope will have the same spatial reference as the map.
Since
1.0
- (AGSPoint *) toMapPoint: (CGPoint)  point

Convert the specified point in screen units to a point in map units.

Parameters
pointPoint in screen units.
Returns
Point in map units. Point will have the same spatial reference as the map.
Since
1.0
- (CGPoint) toScreenPoint: (AGSPoint *)  point

Convert the specified point in map units to a point in screen units.

Parameters
pointPoint in map units. Point must have the same spatial reference as the map.
Returns
Point in screen units.
Since
1.0
- (CGRect) toScreenRect: (AGSEnvelope *)  envelope

Convert the specified envelope in map units to a CGRect in screen units.

Parameters
envelopeEnvelope in map units. Envelope must have the same spatial reference as the map.
Returns
CGRect in screen coordinates
Since
1.0
- (AGSPolygon*) visibleArea

A polygon representing the map's visible area. The polygon always contains 1 ring with 4 vertices, each representing a corner of the map.

An envelope is no longer be used to represent the visible area because the map may be rotated and each corner of the map may contain unique x-y coordinates, where as an envelope only permits 2 unique x coordinates (xmin, xmax) and 2 unique y coordinates (ymin, ymax).

Since
2.1
- (AGSMapViewWrapAroundStatus) wrapAroundStatus

Returns the wrap around status of the map.

Since
10.1.1
- (void) zoomIn: (BOOL)  animated

Zooms in to the current center of the map by a factor of .5.

Parameters
animatedDetermines if the zooming in should be animated or immediate.
Since
1.0
- (void) zoomOut: (BOOL)  animated

Zooms out to the current center of the map by a factor of 2.

Parameters
animatedDetermines if the zooming out should be animated or immediate.
Since
1.0
- (void) zoomToEnvelope: (AGSEnvelope *)  envelope
animated: (BOOL)  animated 

Zoom/Pan the map to specified envelope.

Parameters
envelopeMap envelope to zoom/pan to. Envelope must have the same spatial reference as the map. Envelope must be in map units.
animatedDetermines if the scrolling should be animated or immediate.
Since
1.0
- (void) zoomToGeometry: (AGSGeometry *)  geometry
withPadding: (CGFloat)  padding
animated: (BOOL)  animated 

Zooms the map such that the given geometry fits the bounds of the map.

Parameters
geometryto zoom to
paddingin points so that the geometry may not touch any edges of the map
animatedflag indicating whether to animate the zoom action
Since
2.1
- (void) zoomToResolution: (double)  res
animated: (BOOL)  animated 

Zooms the map to the given resolution

Parameters
resThe resolution (map units per pixel) to zoom to. See
animatedflag indicating whether to animate the zoom action
Since
10.1.1
See also
- convertedResolutionForLodResolution: (AGSTiledLayer) to convert AGSLOD::resolution to map resolution.
- (void) zoomToResolution: (double)  res
withCenterPoint: (AGSPoint *)  centerPoint
animated: (BOOL)  animated 

Zooms the map to the given resolution

Parameters
resThe resolution (map units per pixel) to zoom to
centerPointto zoom around. If nil and AGSLocationDisplay::autoPanMode is AGSLocationDisplayAutoPanModeNavigation or AGSLocationDisplayAutoPanModeCompassNavigation, the map zooms around the location symbol. If the locationDisplay is not in those modes, but the centerPoint is nil, map zooms around its center.
animatedflag indicating whether to animate the zoom action
Since
2.1
See also
- convertedResolutionForLodResolution: (AGSTiledLayer) to convert AGSLOD::resolution to map resolution.
- (void) zoomToScale: (double)  scale
animated: (BOOL)  animated 

Zooms the map to the given scale

Parameters
scaleto zoom to
animatedflag indicating whether to animate the zoom action
Since
10.1.1
See also
- convertedScaleForLodScale: (AGSTiledLayer) to convert AGSLOD::scale to map scale.
- (void) zoomToScale: (double)  scale
withCenterPoint: (AGSPoint *)  centerPoint
animated: (BOOL)  animated 

Zooms the map to the given scale

Parameters
scaleto zoom to
centerPointto zoom around. If nil and the #c AGSLocationDisplay::autoPanMode is AGSLocationDisplayAutoPanModeNavigation or AGSLocationDisplayAutoPanModeCompassNavigation, the map zooms around the location symbol. If the locationDisplay is not in those modes, but the centerPoint is nil, map zooms around its center.
animatedflag indicating whether to animate the zoom action
Since
2.1
See also
- convertedScaleForLodScale: (AGSTiledLayer) to convert AGSLOD::scale to map scale.
- (void) zoomWithFactor: (double)  factor
atAnchorPoint: (CGPoint)  anchorPoint
animated: (BOOL)  animated 

Zooms map by a factor. Anchor Point is in screen coordinates of the map view.

Parameters
factorUsed to determine the amount to zoom. For example, use 0.5 to zoom in twice as far and 2.0 to zoom out twice as far.
anchorPointPoint in screen coordinates around which to zoom. This is ignored if the AGSLocationDisplay::autoPanMode is AGSLocationDisplayAutoPanModeNavigation or AGSLocationDisplayAutoPanModeCompassNavigation in which case map zooms around the location symbol.
animatedDetermines if the zooming should be animated or immediate.
Since
1.0

Property Documentation

- (BOOL) allowCallout
readwritenonatomicassign

Whether or not the map will allow the callout to be shown as a result of tapping/clicking on the map. The default is YES. The callout can still be shown programmatically by calling the methods on the callout when this property is set to NO.

Since
10.2
- (BOOL) allowMagnifierToPanMap
readwritenonatomicassign

Flag to indicate if the map should pan when the magnifer gets near the edge of the map's bounds. The default is YES.

Since
10.1.1
- (BOOL) allowRotationByPinching
readwritenonatomicassign

Flag to indicate if a user should be allowed to rotate the map using a two finger twist gesture. Default is NO.

Since
2.1
- (BOOL) animating
readnonatomicassign

Whether the map is in a state of animating.

Since
10.1.1
- (AGSColor*) backgroundColor
readwritenonatomicstrong

The background color of the map.

Since
10.1.1
- (AGSLayer*) baseLayer
readnonatomicstrong

The first layer added to the map.

Since
10.1.1
- (AGSCallout*) callout
readnonatomicstrong

A callout view for displaying information on the map.

Since
1.0
- (id<AGSMapViewCalloutDelegate>) calloutDelegate
readwritenonatomicweak

Delegate to be notified when map callout actions occur.The delegate class must adopt the AGSMapViewCalloutDelegate protocol.

Deprecated:
Deprecated at 10.2. Use AGSCallout::delegate instead.
Since
1.8
- (AGSColor*) gridLineColor
readwritenonatomicstrong

The color of the grid lines.

Since
10.1.1
- (CGFloat) gridLineWidth
readwritenonatomicassign

The width of the grid lines.

Since
10.1.1
- (CGFloat) gridSize
readwritenonatomicassign

The size of the grid squares.

Since
10.1.1
- (BOOL) interacting
readnonatomicassign

Whether the map is currently being dragged, pinched, rotated or scrolled by the user.

Since
10.1.1
- (BOOL) lastChangeFromInteraction
readnonatomicassign

Whether the last change to the map's scale, resolution, extent or angle was due to user interaction (panning, pinching, etc).

Since
10.1.1
- (id< AGSMapViewLayerDelegate >) layerDelegate
readwritenonatomicweak

Delegate to be notified when map layer actions occur. The delegate class must adopt the AGSMapViewLayerDelegate protocol.

Since
1.8
- (BOOL) loaded
readnonatomicassign

After the first layer added to the map is loaded, this value is set to true.

Since
1.0
- (AGSLocationDisplay*) locationDisplay
readnonatomicstrong

Display's a location on the map from a datasource such as a gps feed.

Since
10.1.1
- (AGSPoint*) mapAnchor
readnonatomiccopy

The map coordinates of where the map display is anchored. Usually this is the center of the map. However it could be different. For example, if the map is anchored on the location display, this will be the coordinate of the location display.

Since
10.1.1
- (NSArray*) mapLayers
readnonatomiccopy

Array of AGSLayer objects representing the layers in the map. Depending upon the type of layer, each object will be specific sub-class of AGSLayer.

Since
1.8
- (double) mapScale
readnonatomicassign

The current scale of the map. Will return 0 if it cannot be calculated.

Since
1.0
- (AGSEnvelope*) maxEnvelope
readwritenonatomicstrong

Limits the amount by which the map can be panned such that its anchor point (typically the center) never goes outside this envelope. By default, this is the full envelope of the basemap layer. If you set a custom extent, the envelope must have the same spatial reference as the map.

Since
2.1
- (double) maxResolution
readwritenonatomicassign

Gets or sets the maximum resolution that can be zoomed out to on the map. Changing this will affect the value of maxScale.

Since
10.2.2
See also
- resolutionForScale: and - scaleForResolution: to convert between map resolution and scale.
- (double) maxScale
readwritenonatomicassign

Gets or sets the maximum map scale that can be zoomed in to on the map. Changing this will affect the value of maxResolution.

Since
10.2.2
See also
- resolutionForScale: and - scaleForResolution: to convert between map resolution and scale.
- (double) minResolution
readwritenonatomicassign

Gets or sets the minimum resolution that can be zoomed in to on the map. Changing this will affect the value of minScale.

Since
10.2.2
See also
- resolutionForScale: and - scaleForResolution: to convert between map resolution and scale.
- (double) minScale
readwritenonatomicassign

Gets or sets the minimum map scale that can be zoomed out to on the map. Changing this will affect the value of minResolution.

Since
10.2.2
See also
- resolutionForScale: and - scaleForResolution: to convert between map resolution and scale.
- (BOOL) releaseHardwareResourcesWhenBackgrounded
readwritenonatomicassign

If set to YES then all the hardware resources will be released when the application is backgrounded. This will default to NO because it takes a few seconds to recreate these resources. Based on this document http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html you should not set this to YES except under extreme cases.

Since
10.1.1
- (double) resolution
readnonatomicassign

The map's current resolution (map units per Point).

Since
1.0
- (double) rotationAngle
readwritenonatomicassign

The rotation angle (in degrees). The map is rotated in a counter-clockwise direction by the amount specified. To specify a new angle, see

See also
- setRotationAngle:animated:
- setRotationAngle:aroundMapPoint:animated:
- setRotationAngle:aroundScreenPoint:animated:
Since
2.1
- (BOOL) showMagnifierOnTapAndHold
readwritenonatomicassign

Flag to indicate if the map should show the magnifier when the user performs a tap and hold gesture on the map. Default is NO

- (AGSSpatialReference*) spatialReference
readnonatomicstrong

The spatial reference of the map. Defined by the basemap layer.

Since
1.0
- (AGSTimeExtent*) timeExtent
readwritenonatomiccopy

The time extent for the map. Will be used only for time-aware layers.

Availability:
This feature is only available with services from ArcGIS Server 10.0 or above

See also
Conceptual Doc: Viewing Temporal Data
Sample: Temporal
Since
1.0
- (id<AGSMapViewTouchDelegate>) touchDelegate
readwritenonatomicweak

Delegate to be notified when touch events occur on the map.The delegate class must adopt the AGSMapViewTouchDelegate protocol.

Since
1.8
- (AGSEnvelope*) visibleAreaEnvelope
readnonatomiccopy

An bounding envelope for the map's visibleArea. The envelope and the visible area will be the same if the map has not been rotated. Otherwise, the envelope will be slightly larger to fully contain the visible area.

Since
10.1.1