MSFCelestialObject
Objective-C
@interface MSFCelestialObject : NSObject {
void *swigCPtr;
BOOL swigCMemOwn;
}
Swift
class MSFCelestialObject : NSObject
A base class for objects that are placed in the sky rather than on the map.
An object is anchored in one of two ways:
- by DIRECTION (azimuth and altitude), with an optional distance. A distance of 0 means infinitely far: the object keeps its direction whatever the camera does, which is what a body at an effectively infinite distance needs. A finite distance gives real parallax and is what an aircraft or a satellite overhead needs.
- by geographic POSITION plus an altitude in meters, for an object that belongs to a place on the map but is above it.
Objects are hit-tested against the touch ray like any other layer’s elements, so a click on one is reported through the layer’s listener, and terrain in front of it wins the hit.
-
Checks if this object is equal to the specified object.
Declaration
Objective-C
- (BOOL)isEqual:(id)object;Swift
func isEqual(_ object: Any!) -> BoolParameters
objectThe reference object.
Return Value
True when objects are equal, false otherwise.
-
Returns the hash value of this object.
Declaration
Objective-C
- (NSUInteger)hash;Swift
func hash() -> UIntReturn Value
The hash value of this object.
-
Returns true if the object is anchored by direction, false if by geographic position.
Declaration
Objective-C
- (BOOL)isDirectionAnchored;Swift
func isDirectionAnchored() -> BoolReturn Value
True if the object is anchored by direction.
-
Returns the azimuth of a direction-anchored object.
Declaration
Objective-C
- (float)getAzimuth;Swift
func getAzimuth() -> FloatReturn Value
The azimuth in degrees, clockwise from north.
-
Returns the altitude of a direction-anchored object.
Declaration
Objective-C
- (float)getAltitude;Swift
func getAltitude() -> FloatReturn Value
The altitude in degrees above the horizon.
-
Returns the distance of a direction-anchored object.
Declaration
Objective-C
- (double)getDistance;Swift
func getDistance() -> DoubleReturn Value
The distance in meters, or 0 for infinitely far.
-
Anchors the object by direction. This is the anchor for anything that behaves like a celestial body.
Declaration
Objective-C
- (void)setDirection:(float)azimuth altitude:(float)altitude distance:(double)distance;Swift
func setDirection(_ azimuth: Float, altitude: Float, distance: Double)Parameters
azimuthThe azimuth in degrees, clockwise from north.
altitudeThe altitude in degrees above the horizon.
distanceThe distance in meters. 0 means infinitely far, so the object never parallaxes when the camera moves.
-
Returns the altitude of a position-anchored object.
Declaration
Objective-C
- (double)getPositionAltitude;Swift
func getPositionAltitude() -> DoubleReturn Value
The altitude in meters above the ground.
-
Anchors the object above a place on the map. Use this for aircraft, satellites, or anything else that has a real location.
Declaration
Objective-C
- (void)setPosition:(MSFMapPos *)pos altitude:(double)altitude;Swift
func setPosition(_ pos: MSFMapPos!, altitude: Double)Parameters
posThe position, in the coordinate system of the layer’s data source projection.
altitudeThe altitude in meters above the ground.
-
Returns the visibility of the object.
Declaration
Objective-C
- (BOOL)isVisible;Swift
func isVisible() -> BoolReturn Value
True if the object is drawn.
-
Sets the visibility of the object. An invisible object is neither drawn nor clickable.
Declaration
Objective-C
- (void)setVisible:(BOOL)visible;Swift
func setVisible(_ visible: Bool)Parameters
visibleThe new visibility.
-
Returns a meta data value.
Declaration
Objective-C
- (MSFVariant *)getMetaDataElement:(NSString *)key;Swift
func getMetaDataElement(_ key: String!) -> MSFVariant!Parameters
keyThe key of the value.
Return Value
The value, or an empty variant if the key does not exist.
-
Sets a meta data value. Meta data is carried through to the click listener, which is how an application tells its objects apart.
Declaration
Objective-C
- (void)setMetaDataElement:(NSString *)key element:(MSFVariant *)element;Swift
func setMetaDataElement(_ key: String!, element: MSFVariant!)Parameters
keyThe key of the value.
elementThe value.
-
Undocumented
Declaration
Objective-C
-(void)dealloc;Swift
func dealloc()