CartoType iOS API 7.8.2, 2022-03-25
for development in Swift and Objective C for iOS and Mac OS
Instance Methods | List of all members
CartoTypeMapObject Class Reference

#import <CartoTypeBase.h>

Inheritance diagram for CartoTypeMapObject:
<CartoTypePath>

Instance Methods

(id) - initWithMapObject:
 
(void) - dealloc
 
(CartoTypeMapObjectType- getType
 
(NSString *) - getLayerName
 
(NSString *) - getLabel
 
(NSString *) - getStringAttribute:
 
(NSMutableDictionary *) - getStringAttributes
 
(int32_t) - getIntAttribute
 
(CartoTypePoint- getCenter
 
(CartoTypeRect- getBounds
 
(CartoTypePointAndResult- getCenterInDegrees
 
(CartoTypeRectAndResult- getBoundsInDegrees
 
(CartoTypeGeometryAndResult *) - getGeometryInDegrees
 
(CTResult- getMatch:text:matchMethod:attributes:phrase:
 
(uint64_t) - getObjectId
 
(int) - contourCount
 
(int) - pointCount:
 
(CartoTypePathPoint- point:pointIndex:
 
(void *) - getObject
 
(int) - contourCount
 
(int) - pointCount:
 
(CartoTypePathPoint- point:pointIndex:
 

Detailed Description

A map object: a point, line, polygon or array (texture), with its name, layer, ID and other attributes.

Method Documentation

◆ contourCount

- (int) contourCount

Gets the number of contours (sub-paths) in the path.

Reimplemented from <CartoTypePath>.

◆ dealloc

- (void) dealloc

Destroys the map object.

◆ getBounds

- (CartoTypeRect) getBounds

Returns the axis-aligned bounding box of a map object, in map coordinates.

◆ getBoundsInDegrees

- (CartoTypeRectAndResult) getBoundsInDegrees

Returns the bounding box of a map object in degrees.

◆ getCenter

- (CartoTypePoint) getCenter

Returns the center of a map object in map coordinates. The center is defined as the center of gravity for polygons and arrays, a point half way along the path for lines, and the point itself for points.

◆ getCenterInDegrees

- (CartoTypePointAndResult) getCenterInDegrees

Returns the center of a map object in degrees. The center is defined as the center of gravity for polygons and arrays, a point half way along the path for lines, and the point itself for points. Because the center is calculated using map coordinates then converted to degrees, it depends on the map projection used by the map object.

◆ getGeometryInDegrees

- (CartoTypeGeometryAndResult *) getGeometryInDegrees

Returns the geometry of a map object in degrees.

◆ getIntAttribute

- (int32_t) getIntAttribute

Gets the integer attribute of a map object.

◆ getLabel

- (NSString *) getLabel

Gets the label or standard name of the map object.

◆ getLayerName

- (NSString *) getLayerName

Gets the name of the map layer to which the map object belongs.

◆ getMatch:text:matchMethod:attributes:phrase:

- (CTResult) getMatch: (CartoTypeMatch *)  aMatch
text: (NSString *)  aText
matchMethod: (CartoTypeStringMatchMethod aMethod
attributes: (NSString *)  aAttributes
phrase: (bool)  aPhrase 

Finds the first string attribute matching aText, using aMatchMethod, and returns information about it in aMatch. If aAttributes is non-null this function examines only attributes in the supplied comma-separated list, otherwise it examines all attributes except those starting with an underscore, which by convention are non-textual. Attribute names may contain the wild cards ? and *. If aPhrase is true matches of phrases within the attribute are allowed.

◆ getObject

- (void *) getObject

Gets a pointer to the C++ map object; for internal use only.

◆ getObjectId

- (uint64_t) getObjectId

Gets the object ID of the map object, which can be used to delete objects inserted at run-time.

◆ getStringAttribute:

- (NSString *) getStringAttribute: (NSString *)  aAttribName

Gets any string attribute. If aAttribName is null, gets the label.

◆ getStringAttributes

- (NSMutableDictionary *) getStringAttributes

Gets all the string attributes as a dictionary of key-value pairs.

◆ getType

Gets the type of the map object: point, line, polygon or array.

◆ initWithMapObject:

- (id) initWithMapObject: (void *)  aMapObject

Initializes a CartoTypeMapObject with a C++ map object; for internal use only.

◆ point:pointIndex:

- (CartoTypePathPoint) point: (int)  aContourIndex
pointIndex: (int)  aPointIndex 

Gets a point, given its contour index and point index. Returns (0,0) if the contour index or point index is out of range.

Reimplemented from <CartoTypePath>.

◆ pointCount:

- (int) pointCount: (int)  aContourIndex

Gets the number of points in a certain contour.

Reimplemented from <CartoTypePath>.


The documentation for this class was generated from the following file: