MaplyRenderControllerProtocol

Objective-C

@protocol MaplyRenderControllerProtocol

Swift

protocol MaplyRenderControllerProtocol

Render Controler Protocol defines the methods required of a render controller.

The view controllers and offscreen rendere implement this protocol.

  • Set the offset for the screen space objects.

    In general you want the screen space objects to appear on top of everything else. There used to be structural versions for this, but now you can mix and match where everything appears. This controls the offset that’s used to push screen space objects behind everything else in the list (and thus, on top).

    If you set this to 0, you can control the ordering of everything more precisely.

    Declaration

    Objective-C

    @property (nonatomic) int screenObjectDrawPriorityOffset;

    Swift

    var screenObjectDrawPriorityOffset: Int32 { get set }
  • Clear all the currently active lights.

    There are a default set of lights, so you’ll want to do this before adding your own.

    Declaration

    Objective-C

    - (void)clearLights;

    Swift

    func clearLights()
  • Reset the lighting back to its default state at startup.

    This clears out all the lights and adds in the default starting light source.

    Declaration

    Objective-C

    - (void)resetLights;

    Swift

    func resetLights()
  • Add the given light to the list of active lights.

    This method will add the given light to our active lights. Most shaders will recognize these lights and do the calculations. If you have a custom shader in place, it may or may not use these.

    Triangle shaders use the lights, but line shaders do not.

    Declaration

    Objective-C

    - (void)addLight:(MaplyLight *_Nonnull)light;

    Swift

    func add(_ light: MaplyLight)
  • Remove the given light (assuming it’s active) from the list of lights.

    Declaration

    Objective-C

    - (void)removeLight:(MaplyLight *_Nonnull)light;

    Swift

    func remove(_ light: MaplyLight)
  • Set the rendering hints to control how the renderer is configured.

    This is a bit vestigial, but still has a few important uses. The hints should be set right after the init call. Any later and they’ll probably be ignored.

    The rendering hints are as follows.

    Key Type Description
    kMaplyRenderHintZBuffer bool If set, we’ll explicitly turn on the Z buffer. Normally it’s off until a drawable requests it, allowing us to play neat tricks with overlays. The only time you should be turning this on is if you’re doing 3D elevation. The default is off.
    kMaplyRenderHintCulling bool If set, we’ll use the internal culling logic. Texture and drawable atlases have largely made this pointless. Leave it off unless you have a compelling reason to turn it on.
    kMaplyRendererLightingMode NSString This can be set to @“none”, in which case we use optimized shaders that do no lighting or “regular”. The latter is the default.

    Declaration

    Objective-C

    - (void)setHints:(NSDictionary *_Nonnull)hintsDict;

    Swift

    func setHints(_ hintsDict: [AnyHashable : Any])
  • Add a cluster generator for making clustered marker images on demand.

    When the layout system clusters a bunch of markers or labels together, it needs new images to represent the cluster.

    You can provide a custom image for each group of markers by filling in one of these generates and passing it in.

    Declaration

    Objective-C

    - (void)addClusterGenerator:
        (NSObject<MaplyClusterGenerator> *_Nonnull)clusterGen;

    Swift

    func add(_ clusterGen: MaplyClusterGenerator)
  • Add one or more screen markers to the current scene.

    This method will add the given MaplyScreenMaker objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyColor UIColor The color we’ll use for the rectangle that makes up a marker. White by default.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The marker will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The marker will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyDrawPriority NSNumber If set, the markers are sorted by this number. Larger numbers will be sorted later.
    kMaplyFade NSNumber The number of seconds to fade a marker in when it appears and out when it disappears.
    kMaplyFadeIn NSNumber The number of seconds to fade a marker in when it appears. This overrides kMaplyFade.
    kMaplyFadeOut NSNumber The number of seconds to fade a marker out when it disappears. This override kMaplyFade.
    kMaplyFadeOutTime NSNumber If you want to create an object, just to have it fade out at a specific time, this is what you set.
    kMaplyShader NSString If set, this is the name of the MaplyShader to use when rendering the screen markers.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:
    kMaplyEnableStart NSNumber If set, this controls when the resulting objects will be activated.
    kMaplyEnableEnd NSNumber If set, this controls when the resulting objects will be deactivated.
    kMaplyClusterGroup NSNumber If set, the screen markers will be clustered together according to the given group ID. Off by default, but 0 is the default cluster.

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addScreenMarkers:(NSArray *_Nonnull)markers
                                                   desc:
                                                       (NSDictionary *_Nullable)desc
                                                   mode:(MaplyThreadMode)threadMode;

    Swift

    func addScreenMarkers(_ markers: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    markers

    An NSArray of MaplyScreenMarker objects.

    desc

    The desciption dictionary which controls how the markers will be constructed. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more 3D markers to the current scene.

    This method will add the given MaplyMarker objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyColor UIColor The color we’ll use for the rectangle that makes up a marker. White by default.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The marker will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The marker will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a marker in when it appears and out when it disappears.
    kMaplyFadeIn NSNumber The number of seconds to fade a marker in when it appears. This overrides kMaplyFade.
    kMaplyFadeOut NSNumber The number of seconds to fade a marker out when it disappears. This override kMaplyFade.
    kMaplyFadeOutTime NSNumber If you want to create an object, just to have it fade out at a specific time, this is what you set.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyMarkerDrawPriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s off by default, meaning that the geometry will draw on top of anything (respecting the kMaplyDrawPriority).
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addMarkers:(NSArray *_Nonnull)markers
                                             desc:(NSDictionary *_Nullable)desc
                                             mode:(MaplyThreadMode)threadMode;

    Swift

    func addMarkers(_ markers: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    markers

    An NSArray of MaplyMarker objects.

    desc

    The desciption dictionary which controls how the markers will be constructed. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more screen labels to the current scene.

    This method will add the given MaplyScreenLabel objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyTextColor UIColor Color we’ll use for the text. Black by default.
    kMaplyBackgroundColor UIColor Color we’ll use for the rectangle background. Use clearColor to make this invisible.
    kMaplyFont UIFont The font we’ll use for the text.
    kMaplyLabelHeight NSNumber Height of the text in points.
    kMaplyLabelWidth NSNumber Width of the text in points. It’s best to set Height and leave this out. That way the width will be calculated by the toolkit.
    kMaplyJustify NSString This can be set to @“middle”, @“left”, or @“right” to justify the text around the location.
    kMaplyTextJustify NSString This can be kMaplyTextJustifyRight, kMaplyTextJustifyCenter, or kMaplyTextJustifyLeft
    kMaplyShadowSize NSNumber If set, we’ll draw a shadow with the kMaplyShadowColor offset by this amount. We recommend using an outline instead.
    kMaplyShadowColor UIColor If we’re drawing a shadow, this is its color.
    kMaplyTextOutlineSize NSNumber If set, we’ll draw an outline around the text (really draw it twice). The outline will be this large.
    kMaplyTextOutlineColor UIColor If we’re drawing an outline, it’s in this color.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The label will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The label will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyDrawPriority NSNumber If set, the labels are sorted by this number. Larger numbers will be sorted later.
    kMaplyFade NSNumber The number of seconds to fade a screen label in when it appears and out when it disappears.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:
    kMaplyEnableStart NSNumber If set, this controls when the resulting objects will be activated.
    kMaplyEnableEnd NSNumber If set, this controls when the resulting objects will be deactivated.

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addScreenLabels:(NSArray *_Nonnull)labels
                                                  desc:(NSDictionary *_Nullable)desc
                                                  mode:(MaplyThreadMode)threadMode;

    Swift

    func addScreenLabels(_ labels: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    labels

    An NSArray of MaplyScreenLabel objects.

    desc

    The desciption dictionary which controls how the labels will be constructed. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more 3D labels to the current scene.

    This method will add the given MaplyLabel objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyTextColor UIColor Color we’ll use for the text. Black by default.
    kMaplyBackgroundColor UIColor Color we’ll use for the rectangle background. Use clearColor to make this invisible.
    kMaplyFont UIFont The font we’ll use for the text.
    kMaplyLabelHeight NSNumber Height of the text in display coordinates. For the globe these are based on radius = 1.0.
    kMaplyLabelWidth NSNumber Width of the text in display coordinates. It’s best to set Height and leave this out. That way the width will be calculated by the toolkit.
    kMaplyJustify NSString This can be set to @“middle”, @“left”, or @“right” to justify the text around the location.
    kMaplyShadowSize NSNumber If set, we’ll draw a shadow with the kMaplyShadowColor offset by this amount. We recommend using an outline instead.
    kMaplyShadowColor UIColor If we’re drawing a shadow, this is its color.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The label will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The label will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a label in when it appears and out when it disappears.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyLabelDrawPriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s off by default, meaning that the geometry will draw on top of anything (respecting the kMaplyDrawPriority).
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addLabels:(NSArray *_Nonnull)labels
                                            desc:(NSDictionary *_Nullable)desc
                                            mode:(MaplyThreadMode)threadMode;

    Swift

    func addLabels(_ labels: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    labels

    An NSArray of MaplyLabel objects.

    desc

    The desciption dictionary which controls how the labels will be constructed. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more vectors to the current scene.

    This method will add the given MaplyVectorObject objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the vector features.
    kMaplyVecWidth NSNumber If the geometry is not filled, this is the width of the GL lines.
    kMaplyFilled NSNumber boolean If set, the areal geometry will be tesselated, taking holes into account. The resulting triangles will be displayed instead of the vectors.
    kMaplySubdivType NSString When present, this requests that the geometry be broken up to follow the globe (really only makes sense there). It can be set to kMaplySubdivGreatCircle or kMaplySubdivSimple which do a great circle subdivision and a simple 3-space subdivision respectively. If the key is missing, we do no subdivision at all.
    kMaplySubdivEpsilon NSNumber If there’s a kMaplySubdivType set this is the epsilon we’ll pass into the subdivision routine. The value is in display coordinates. 0.01 is a reasonable value. Smaller results in more subdivision.
    kMaplyVecTexture UIImage If set and the kMaplyFilled attribute is set, we will apply the given texture across any areal features. How the texture is applied can be controlled by kMaplyVecTexScaleX, kMaplyVecTexScaleY, kMaplyVecCenterX, kMaplyVecCenterY, and kMaplyVecTextureProjection
    kMaplyVecTexScaleX,kMaplyVecTexScaleY NSNumber These control the scale of the texture application. We’ll multiply by these numbers before generating texture coordinates from the vertices.
    kMaplyVecCenterX,kMaplyVecCenterY NSNumber These control the center of a texture application. If not set we’ll use the areal’s centroid. If set, we’ll use these instead. They should be in local coordinates (probably geographic radians).
    kMaplyVecTextureProjection NSString This controls how a texture is projected onto an areal feature. By default we just use the geographic coordinates and stretch them out. This looks odd for very large features. If you set this to kMaplyProjectionTangentPlane then we’ll take the center of the feature, make a tangent plane and then project the coordinates onto that tangent plane to get texture coordinates. This looks nice at the poles. If set to kMaplyProjectionScreen the texture is mapped on after screen space projection around the center of the feature.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The vectors will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The vectors will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a vector in when it appears and out when it disappears.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyVectorDrawPriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s off by default, meaning that the geometry will draw on top of anything (respecting the kMaplyDrawPriority).
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:
    kMaplySelectable NSNumber boolean Off by default. When enabled, the vector feature will be selectable by a user.

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addVectors:(NSArray *_Nonnull)vectors
                                             desc:(NSDictionary *_Nullable)desc
                                             mode:(MaplyThreadMode)threadMode;

    Swift

    func addVectors(_ vectors: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    vectors

    An NSArray of MaplyVectorObject objects.

    desc

    The desciption dictionary which controls how the vectors will look. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Make a copy of the base object and apply the attributes given for the new version.

    This call makes a cheap copy of the vectors in the given MaplyComponentObject and applies the given description to them. You can use this to make a wider or thinner version of a set of vectors, or change their color, while continuing to draw the originals. Or not, as the case may be.

    This is useful for vector maps where we tend to reuse the same geometry at multiple levels and with different colors and line widths.

    Instancing only works with a handful of visual changes. For instance, you can’t make a filled and non-filled version.

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the vector features.
    kMaplyVecWidth NSNumber If the geometry is not filled, this is the width of the GL lines.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The vectors will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The vectors will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyVectorDrawPriorityDefault.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)instanceVectors:
                                           (MaplyComponentObject *_Nonnull)baseObj
                                                  desc:(NSDictionary *_Nullable)desc
                                                  mode:(MaplyThreadMode)threadMode;

    Swift

    func instanceVectors(_ baseObj: MaplyComponentObject, desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    baseObj

    The MaplyComponentObject returned by an addVectors: call. This only works for vectors.

    desc

    The description dictionary with controls how vectors will be displayed. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more widened vectors to the current scene.

    Build widened vectors

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the features.
    kMaplyVecWidth NSNumber If the geometry is not filled, this is the width of the lines.
    kMaplyWideVecCoordType NSNumber Vectors can be widened in real coordinates (kMaplyWideVecCoordTypeReal) or screen coordinates (kMaplyWideVecCoordTypeScreen). In the latter case they stay the same size now matter how you zoom.
    kMaplyWideVecJoinType NSNumber When lines meet in a join there are several options for representing them. These include kMaplyWideVecMiterJoin, which is a simple miter join and kMaplyWideVecBevelJoin which is a more complicated bevel. See http://www.w3.org/TR/SVG/painting.html#StrokeLinejoinProperty for how these look.
    kMaplyWideVecMiterLimit NSNumber When using miter joins you can trigger them at a certain threshold.
    kMaplyWideVecTexRepeatLen NSNumber This is the repeat size for a texture applied along the widened line. For kMaplyWideVecCoordTypeScreen this is pixels.
    kMaplyVecTexture UIImage or MaplyTexture This the texture to be applied to the widened vector.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The vectors will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The vectors will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyVectorDrawPriorityDefault.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addWideVectors:(NSArray *_Nonnull)vectors
                                                 desc:(NSDictionary *_Nullable)desc
                                                 mode:(MaplyThreadMode)threadMode;

    Swift

    func addWideVectors(_ vectors: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    desc

    The description dictionary which controls how vectors will be displayed. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more model instances.

    Each MaplyGeomInstance points to a MaplyGeomModel. All those passed in here will be grouped and processed together.

    Key Type Description
    kMaplySelectable NSNumber boolean Off by default. When enabled, the vector feature will be selectable by a user.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)
        addModelInstances:(NSArray *_Nonnull)modelInstances
                     desc:(NSDictionary *_Nullable)desc
                     mode:(MaplyThreadMode)threadMode;

    Swift

    func addModelInstances(_ modelInstances: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    desc

    The description dictionary which controls how the models are displayed, selected, and so forth.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or raw geometry models.

    Each MaplyGeometryModel holds points and triangles in display space. These are relatively “raw” geometry and are passed to the geometry manager as is.

    Key Type Description
    kMaplySelectable NSNumber boolean Off by default. When enabled, the vector feature will be selectable by a user.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addGeometry:(NSArray *_Nonnull)geom
                                              desc:(NSDictionary *_Nullable)desc
                                              mode:(MaplyThreadMode)threadMode;

    Swift

    func addGeometry(_ geom: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    desc

    The description dictionary which controls how the geometry is displayed, selected, and so forth.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more MaplyShape children to the current scene.

    This method will add the given MaplyShape derived objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the shape features.
    kMaplyShapeSampleX NSNumber Number of samples to use in one direction when converting to polygons.
    kMaplyShapeSampleY NSNumber Number of samples to use in the other direction when converting to polygons.
    kMaplyShapeInsideOut NSNumber boolean If set to YES, we’ll make the spheres inside out and such. Set to NO by default.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The shapes will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The shapes will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a shape in when it appears and out when it disappears.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyVectorShapePriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s on by default, meaning that the geometry can be occluded by things drawn first.
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addShapes:(NSArray *_Nonnull)shapes
                                            desc:(NSDictionary *_Nullable)desc
                                            mode:(MaplyThreadMode)threadMode;

    Swift

    func addShapes(_ shapes: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    shapes

    An NSArray of MaplyShape derived objects.

    desc

    The desciption dictionary which controls how the shapes will look. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add one or more MaplySticker objects to the current scene.

    This method will add the given MaplySticker objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the stickers.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The stickers will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The stickers will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a sticker in when it appears and out when it disappears.
    kMaplySampleX NSNumber Stickers are broken up along two dimensions to adhere to the globe. By default this is done adaptively. If you want to override it, this is the X dimension for the sticker.
    kMaplySampleY NSNumber If you want to override it, this is the Y dimension for the sticker.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyVectorShapePriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s off by default, meaning that it will draw on top of things before it..
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:
    kMaplyShader NSString If set, this is the name of the MaplyShader to use when rendering the sticker(s).

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addStickers:(NSArray *_Nonnull)stickers
                                              desc:(NSDictionary *_Nullable)desc
                                              mode:(MaplyThreadMode)threadMode;

    Swift

    func addStickers(_ stickers: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    stickers

    An NSArray of MaplySticker derived objects.

    desc

    The desciption dictionary which controls how the stickers will look. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Modify an existing sticker. This only supports changing the active textures.

    This method will change attributes of a sticker that’s currently in use. At present that’s just the images it’s displaying.

    Key Type Description
    kMaplyStickerImages NSARray The array of images to apply to the sticker. You can reuse old ones or introduce new ones.

    Declaration

    Objective-C

    - (void)changeSticker:(MaplyComponentObject *_Nonnull)compObj
                     desc:(NSDictionary *_Nullable)desc
                     mode:(MaplyThreadMode)threadMode;

    Swift

    func changeSticker(_ compObj: MaplyComponentObject, desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode)

    Parameters

    compObj

    The component object representing one or more existing stickers.

    desc

    The description dictionary for changes we’re making to the sticker.

  • Add one or more MaplyBillboard objects to the current scene.

    This method will add the given MaplyBillboard objects to the current scene. It will use the parameters in the description dictionary and it will do it on the thread specified.

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the billboards.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The billboards will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The billboards will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyBillboardDrawPriorityDefault.
    kMaplyBillboardOrient NSNumber Controls the billboard orientation. It’s either directly toward the eye with kMaplyBillboardOrientEye or takes the ground into account with kMaplyBillboardOrientGround. Ground is the default.

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addBillboards:(NSArray *_Nonnull)billboards
                                                desc:(NSDictionary *_Nullable)desc
                                                mode:(MaplyThreadMode)threadMode;

    Swift

    func addBillboards(_ billboards: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    billboards

    An NSArray of MaplyBillboard objects.

    desc

    The description dictionary that controls how the billboards will look. It takes the following entries.

    threadMode

    MaplyThreadAny is preferred and will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread.

  • Add a particle system to the scene.

    This adds a particle system to the scene, but does not kick off any particles.

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)
        addParticleSystem:(MaplyParticleSystem *_Nonnull)partSys
                     desc:(NSDictionary *_Nullable)desc
                     mode:(MaplyThreadMode)threadMode;

    Swift

    func add(_ partSys: MaplyParticleSystem, desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    partSys

    The particle system to start.

    desc

    Any additional standard parameters (none at present).

    threadMode

    MaplyThreadAny will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread. For particles, it’s best to make a separate thread and use MaplyThreadCurrent.

  • Change the render target for a particle system.

    This changes the render target for an existing particle system that’s already been created. Can pass in nil, which means the particles are rendered to the screen directly. This change takes place immediately, so call it on the main thread.

    Declaration

    Objective-C

    - (void)changeParticleSystem:(MaplyComponentObject *_Nonnull)compObj
                    renderTarget:(MaplyRenderTarget *_Nullable)target;

    Swift

    func changeParticleSystem(_ compObj: MaplyComponentObject, renderTarget target: MaplyRenderTarget?)
  • Add a batch of particles to the current scene.

    Particles are short term objects, typically very small. We create them in large groups for efficience.

    You’ll need to fill out the MaplyParticleSystem initially and then the MaplyParticleBatch to create them.

    Declaration

    Objective-C

    - (void)addParticleBatch:(MaplyParticleBatch *_Nonnull)batch
                        mode:(MaplyThreadMode)threadMode;

    Swift

    func add(_ batch: MaplyParticleBatch, mode threadMode: MaplyThreadMode)

    Parameters

    batch

    The batch of particles to add to an active particle system.

    threadMode

    MaplyThreadAny will use another thread, thus not blocking the one you’re on. MaplyThreadCurrent will make the changes immediately, blocking this thread. For particles, it’s best to make a separate thread and use MaplyThreadCurrent.

  • Change the representation of the given vector features.

    This will change how any vector features represented by the compObj look.

    You can change kMaplyColor, kMaplyMinVis, kMaplyMaxVis, and kMaplyDrawPriority.

    This version takes a thread mode.

    Declaration

    Objective-C

    - (void)changeVector:(MaplyComponentObject *_Nonnull)compObj
                    desc:(NSDictionary *_Nullable)desc
                    mode:(MaplyThreadMode)threadMode;

    Swift

    func changeVector(_ compObj: MaplyComponentObject, desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode)
  • Adds the MaplyVectorObject’s passed in as lofted polygons.

    Lofted polygons are filled polygons draped on top of the globe with height. By using a transparent color, these can be used to represent selection or relative values on the globe (or map).

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the lofted polygons. A bit of alpha looks good.
    kMaplyLoftedPolyHeight NSNumber Height of the top of the lofted polygon in display units. For the globe display units are based on a radius of 1.0.
    kMaplyLoftedPolyBase NSNumber If present, we’ll start the lofted poly at this height. The height is in globe units, based on a radius of 1.0.
    kMaplyLoftedPolyTop NSNumber boolean If on we’ll create the geometry for the top. On by default.
    kMaplyLoftedPolySide NSNumber boolean If on we’ll create geometry for the sides. On by default.
    kMaplyLoftedPolyGridSize NSNumber The size of the grid (in degrees) we’ll use to chop up the vector features to make them follow the sphere (for a globe).
    kMaplyLoftedPolyOutline NSNumber boolean If set to @(YES) this will draw an outline around the top of the lofted poly in lines.
    kMaplyLoftedPolyOutlineBottom NSNumber boolean If set to @(YES) this will draw an outline around the bottom of the lofted poly in lines.
    kMaplyLoftedPolyOutlineColor UIColor If the outline is one this is the outline’s color.
    kMaplyLoftedPolyOutlineWidth NSNumber This is the outline’s width if it’s turned on.
    kMaplyLoftedPolyOutlineDrawPriority NSNumber Draw priority of the lines created for the lofted poly outline.
    kMaplyLoftedPolyOutlineSide NSNumber boolean If set and we’re drawing an outline, this will create lines up the sides.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The lofted polys will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The lofted polys will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a lofted poly in when it appears and out when it disappears.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyLoftedPolysShapePriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s on by default, meaning that it can be occluded by geometry coming before it.
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addLoftedPolys:(NSArray *_Nonnull)polys
                                                 desc:(NSDictionary *_Nullable)desc
                                                 mode:(MaplyThreadMode)threadMode;

    Swift

    func addLoftedPolys(_ polys: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    polys

    An NSArray of MaplyVectorObject.

    desc

    The desciption dictionary which controls how the lofted polys will look. It takes the following entries.

    threadMode

    For MaplyThreadAny we’ll do the add on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the add. MaplyThreadAny is preferred.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Add a group of points to the display.

    Adds a group of points all at once. We’re assuming you want to draw a lot of points, so you have to group them together into a MaplyPoints.

    Key Type Description
    kMaplyColor UIColor Color we’ll use for the lofted polygons. A bit of alpha looks good.
    kMaplyMinVis NSNumber This is viewer height above the globe or map. The lofted polys will only be visible if the user is above this height. Off by default.
    kMaplyMaxVis NSNumber This is viewer height above the globe or map. The lofted polys will only be visible if the user is below this height. Off by default.
    kMaplyMinViewerDist NSNumber Minimum distance from the viewer at which to display object(s).
    kMaplyMaxViewerDist NSNumber Maximum distance from the viewer at which to display object(s).
    kMaplyViewableCenterX MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center X coordinate.
    kMaplyViewableCenterY MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Y coordinate.
    kMaplyViewableCenterZ MaplyCoordinate3dWrapper When evaulating min/max viewer distance, we’ll use this center Z coordinate.
    kMaplyFade NSNumber The number of seconds to fade a lofted poly in when it appears and out when it disappears.
    kMaplyDrawPriority NSNumber Geometry is sorted by this value before being drawn. This ensures that some objects can come out on top of others. By default this is kMaplyLoftedPolysShapePriorityDefault.
    kMaplyZBufferRead NSNumber boolean If set this geometry will respect the z buffer. It’s on by default, meaning that it can be occluded by geometry coming before it.
    kMaplyZBufferWrite NSNumber boolean If set this geometry will write to the z buffer. That means following geometry that reads the z buffer will be occluded. This is off by default.
    kMaplyEnable NSNumber boolean On by default, but if off then the feature exists, but is not turned on. It can be enabled with enableObjects:

    Declaration

    Objective-C

    - (MaplyComponentObject *_Nullable)addPoints:(NSArray *_Nonnull)points
                                            desc:(NSDictionary *_Nullable)desc
                                            mode:(MaplyThreadMode)threadMode;

    Swift

    func addPoints(_ points: [Any], desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyComponentObject?

    Parameters

    points

    The points to add to the scene.

    desc

    The desciption dictionary which controls how the points will look. It takes the following entries.

    threadMode

    For MaplyThreadAny we’ll do the add on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the add. MaplyThreadAny is preferred.

    Return Value

    Returns a MaplyComponentObject, which can be used to make modifications or delete the objects created.

  • Represent an image as a MaplyTexture.

    This version of addTexture: allows more precise control over how the texture is represented. It replaces the other addTexture: and addTextureToAtlas calls.

    Key Type Description
    kMaplyTexFormat NSNumber The texture format to use for the image. Consult addTexture:imageFormat:wrapFlags:mode: for a list. Default is MaplyImageIntRGBA.
    kMaplyTexMinFilter NSNumber Filter to use for minification. This can be kMaplyMinFilterNearest or kMaplyMinFilterLinear. Default is kMaplyMinFilterLinear.
    kMaplyTexMagFilter NSNumber Filter to use for magnification. This can be kMaplyMinFilterNearest or kMaplyMinFilterLinear. Default is kMaplyMinFilterLinear.
    kMaplyTexWrapX NSNumber boolean Texture wraps in x direction. Off by default.
    kMaplyTexWrapY NSNumber boolean Texture wraps in y direction. Off by default.
    kMaplyTexAtlas NSNumber boolean If set, the texture goes into an appropriate atlas. If not set, it’s a standalone texture (default).

    Declaration

    Objective-C

    - (MaplyTexture *_Nullable)addTexture:(id)image
                                     desc:(NSDictionary *_Nullable)desc
                                     mode:(MaplyThreadMode)threadMode;

    Swift

    func addTexture(_ image: Any!, desc: [AnyHashable : Any]?, mode threadMode: MaplyThreadMode) -> MaplyTexture?

    Parameters

    image

    The UIImage to add as a texture.

    desc

    A description dictionary controlling how the image is converted to a texture and represented in the system.

    threadMode

    For MaplyThreadAny we’ll do the add on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the add. MaplyThreadAny is preferred.

  • Create an empty texture and return it.

    Empty textures are used for offscreen rendering and other crazy stuff. You probably don’t want to do this.

    Key Type Description
    kMaplyTexFormat NSNumber The texture format to use for the image. Consult addTexture:imageFormat:wrapFlags:mode: for a list. Default is MaplyImageIntRGBA.
    kMaplyTexMinFilter NSNumber Filter to use for minification. This can be kMaplyMinFilterNearest or kMaplyMinFilterLinear. Default is kMaplyMinFilterLinear.
    kMaplyTexMagFilter NSNumber Filter to use for magnification. This can be kMaplyMinFilterNearest or kMaplyMinFilterLinear. Default is kMaplyMinFilterLinear.
    kMaplyTexWrapX NSNumber boolean Texture wraps in x direction. Off by default.
    kMaplyTexWrapY NSNumber boolean Texture wraps in y direction. Off by default.
    kMaplyTexAtlas NSNumber boolean If set, the texture goes into an appropriate atlas. If not set, it’s a standalone texture (default).
    kMaplyTexMipmap NSNumber boolean If set, we’ll create the given texture with mipmap levels.

    Declaration

    Objective-C

    - (MaplyTexture *_Nullable)createTexture:(NSDictionary *_Nullable)spec
                                       sizeX:(int)sizeX
                                       sizeY:(int)sizeY
                                        mode:(MaplyThreadMode)threadMode;

    Swift

    func createTexture(_ spec: [AnyHashable : Any]?, sizeX: Int32, sizeY: Int32, mode threadMode: MaplyThreadMode) -> MaplyTexture?

    Parameters

    spec

    The description dictionary controlling the format and other textures goodies.

    sizeX

    The horizontal size of the textures (in pixels).

    sizeY

    Vertical size of the texture (in pixels).

  • Creates a new texture that references part of an existing texture.

    Declaration

    Objective-C

    - (MaplyTexture *_Nullable)addSubTexture:(MaplyTexture *_Nonnull)tex
                                     xOffset:(int)x
                                     yOffset:(int)y
                                       width:(int)width
                                      height:(int)height
                                        mode:(MaplyThreadMode)threadMode;

    Swift

    func addSubTexture(_ tex: MaplyTexture, xOffset x: Int32, yOffset y: Int32, width: Int32, height: Int32, mode threadMode: MaplyThreadMode) -> MaplyTexture?

    Parameters

    x

    Horizontal offset within the existing texture.

    y

    Vertical offset within the existing texture.

    width

    Width of the chunk to make a new texture.

    height

    Height of the chunk to make a new texture.

    threadMode

    For MaplyThreadAny we’ll do the add on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the add. MaplyThreadAny is preferred if you’re on the main thread.

  • Remove the OpenGL ES textures associated with the given MaplyTextures.

    MaplyTextures will remove their associated OpenGL textures when they go out of scope. This method does it expicitly and clears out the internals of the MaplyTexture.

    Only call this if you’re managing the texture explicitly and know you’re finished with them.

    Declaration

    Objective-C

    - (void)removeTextures:(NSArray *_Nonnull)texture
                      mode:(MaplyThreadMode)threadMode;

    Swift

    func removeTextures(_ texture: [Any], mode threadMode: MaplyThreadMode)
  • Add a render target to the system

    Sets up a render target and will start rendering to it on the next frame.

    Keep the render target around so you can remove it later.

    Declaration

    Objective-C

    - (void)addRenderTarget:(MaplyRenderTarget *_Nonnull)renderTarget;

    Swift

    func add(_ renderTarget: MaplyRenderTarget)
  • Set the texture a given render target is writing to.

    Render targets start out with one, but you may wish to change it.

    Declaration

    Objective-C

    - (void)changeRenderTarget:(MaplyRenderTarget *_Nonnull)renderTarget
                           tex:(MaplyTexture *_Nullable)tex;

    Swift

    func change(_ renderTarget: MaplyRenderTarget, tex: MaplyTexture?)
  • Remove the given render target from the system.

    Ask the system to stop drawing to the given render target. It will do this on the next frame.

    Declaration

    Objective-C

    - (void)removeRenderTarget:(MaplyRenderTarget *_Nonnull)renderTarget;

    Swift

    func remove(_ renderTarget: MaplyRenderTarget)
  • Normally the layout layer runs periodically if you change something or when you move around. You can ask it to run ASAP right here. Layout runs on its own thread, so there may still be a delay.

    Declaration

    Objective-C

    - (void)runLayout;

    Swift

    func runLayout()
  • Request a one time clear for the render target.

    Rather than clearing every frame, you may want to specifically request a clear. This will be executed at the next frame and then not again.

    Declaration

    Objective-C

    - (void)clearRenderTarget:(MaplyRenderTarget *_Nonnull)renderTarget
                         mode:(MaplyThreadMode)threadMode;

    Swift

    func clear(_ renderTarget: MaplyRenderTarget, mode threadMode: MaplyThreadMode)
  • Remove all information associated with the given MaplyComponentObject’s.

    Every add call returns a MaplyComponentObject. This will remove any visible features, textures, selection data, or anything else associated with it.

    Declaration

    Objective-C

    - (void)removeObjects:(NSArray *_Nonnull)theObjs
                     mode:(MaplyThreadMode)threadMode;

    Swift

    func remove(_ theObjs: [Any], mode threadMode: MaplyThreadMode)

    Parameters

    theObjs

    The MaplyComponentObject’s we wish to remove.

    threadMode

    For MaplyThreadAny we’ll do the removal on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the removal. MaplyThreadAny is preferred.

  • Disable a group of MaplyComponentObject’s all at once.

    By default all of the geometry created for a given object will appear. If you set kMaplyEnable to @(NO) then it will exist, but not appear. This has the effect of setting kMaplyEnable to @(NO).

    Declaration

    Objective-C

    - (void)disableObjects:(NSArray *_Nonnull)theObjs
                      mode:(MaplyThreadMode)threadMode;

    Swift

    func disableObjects(_ theObjs: [Any], mode threadMode: MaplyThreadMode)

    Parameters

    theObjs

    The objects to disable.

    threadMode

    For MaplyThreadAny we’ll do the disable on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the disable. MaplyThreadAny is preferred.

  • Enable a group of MaplyComponentObject’s all at once.

    By default all of the geometry created for a given object will appear. If you set kMaplyEnable to @(NO) then it will exist, but not appear. This has the effect of setting kMaplyEnable to @(YES).

    Declaration

    Objective-C

    - (void)enableObjects:(NSArray *_Nonnull)theObjs
                     mode:(MaplyThreadMode)threadMode;

    Swift

    func enable(_ theObjs: [Any], mode threadMode: MaplyThreadMode)

    Parameters

    theObjs

    The objects to enable.

    threadMode

    For MaplyThreadAny we’ll do the enable on another thread. For MaplyThreadCurrent we’ll block the current thread to finish the enable. MaplyThreadAny is preferred.

  • Pass a uniform block through to a shader. Only for Metal.

    Custom Metal shaders may have their own uniform blocks associated with a known bufferID. This is how you pass those through for objects you’ve already created. Useful for things like custom animation.

    Declaration

    Objective-C

    - (void)setUniformBlock:(NSData *_Nonnull)uniBlock
                     buffer:(int)bufferID
                 forObjects:(NSArray<MaplyComponentObject *> *_Nonnull)compObjs
                       mode:(MaplyThreadMode)threadMode;

    Swift

    func setUniformBlock(_ uniBlock: Data, buffer bufferID: Int32, for compObjs: [MaplyComponentObject], mode threadMode: MaplyThreadMode)
  • Call this to start journaling changes for this thread.

    Your can collect up your add/remove/enable changes on the current thread. Call startChanges to start collecting and endChanges to flush the changes.

    This has no real meaning on the main thread and don’t collect too many changes. They take memory.

    Declaration

    Objective-C

    - (void)startChanges;

    Swift

    func startChanges()
  • Call this to flush your journal changes out ot the scene.

    This is the other end of startChanges.

    Declaration

    Objective-C

    - (void)endChanges;

    Swift

    func endChanges()
  • Add a compiled shader. We’ll refer to it by the scene name.

    Once you’ve create a MaplyShader, you’ll need to add it to the scene to use it.

    Declaration

    Objective-C

    - (void)addShaderProgram:(MaplyShader *_Nonnull)shader;

    Swift

    func addShaderProgram(_ shader: MaplyShader)

    Parameters

    shader

    The working shader (be sure valid is true) to add to the scene.

  • Look for a shader with the given name.

    This is the shader’s own name as specified in the init call, not the scene name as might be specified in addShaderProgram:sceneName:

    Declaration

    Objective-C

    - (MaplyShader *_Nullable)getShaderByName:(NSString *_Nonnull)name;

    Swift

    func getShaderByName(_ name: String) -> MaplyShader?

    Return Value

    Returns the registered shader if it found one.

  • Remove a shader that was added earlier.

    Declaration

    Objective-C

    - (void)removeShaderProgram:(MaplyShader *_Nonnull)shader;

    Swift

    func removeShaderProgram(_ shader: MaplyShader)
  • Return the coordinate system being used for the display.

    This returns the local coordinate system, which is used to unroll the earth (for the globe) or via a scaling factor (for the flat map).

    Declaration

    Objective-C

    - (MaplyCoordinateSystem *_Nullable)coordSystem;

    Swift

    func coordSystem() -> MaplyCoordinateSystem?
  • Undocumented

    Declaration

    Objective-C

    - (void)setClearColor:(UIColor *__nonnull)clearColor;

    Swift

    func setClearColor(_ clearColor: Any!)
  • Return the framebuffer size in pixels (no scale)

    Declaration

    Objective-C

    - (CGSize)getFramebufferSize;

    Swift

    func getFramebufferSize() -> CGSize
  • Undocumented

    Declaration

    Objective-C

    - (MaplyRenderController * __nullable)getRenderControl;

    Swift

    func getRenderControl() -> MaplyRenderController?
  • Return the renderer type being used

    Declaration

    Objective-C

    - (MaplyRenderType)getRenderType;

    Swift

    func getRenderType() -> MaplyRenderType
  • Add the given active object to the scene.

    Active objects are used for immediate, frame based updates. They’re fairly expensive, so be careful. After you create one, you add it to the scene here.

    Declaration

    Objective-C

    - (void)addActiveObject:(MaplyActiveObject *_Nonnull)theObj;

    Swift

    func add(_ theObj: MaplyActiveObject)
  • Remove an active object from the scene.

    Declaration

    Objective-C

    - (void)removeActiveObject:(MaplyActiveObject *_Nonnull)theObj;

    Swift

    func remove(_ theObj: MaplyActiveObject)
  • Remove an array of active objects from the scene

    Declaration

    Objective-C

    - (void)removeActiveObjects:(NSArray *_Nonnull)theObjs;

    Swift

    func removeActiveObjects(_ theObjs: [Any])
  • Add a MaplyControllerLayer to the globe or map.

    At present, layers are for paged geometry such as image tiles or vector tiles. You can create someting like a MaplyQuadImageTilesLayer, set it up and then hand it to addLayer: to add to the scene.

    Declaration

    Objective-C

    - (_Bool)addLayer:(MaplyControllerLayer *_Nonnull)layer;

    Swift

    func add(_ layer: MaplyControllerLayer) -> Bool
  • Remove a MaplyControllerLayer from the globe or map.

    Declaration

    Objective-C

    - (void)removeLayer:(MaplyControllerLayer *_Nonnull)layer;

    Swift

    func remove(_ layer: MaplyControllerLayer)
  • Remove zero or more MaplyControllerLayer objects from the globe or map.

    Declaration

    Objective-C

    - (void)removeLayers:(NSArray *_Nonnull)layers;

    Swift

    func removeLayers(_ layers: [Any])
  • Remove all the user created MaplyControllerLayer objects from the globe or map.

    Declaration

    Objective-C

    - (void)removeAllLayers;

    Swift

    func removeAllLayers()
  • Return a tile fetcher we may share between loaders

    Declaration

    Objective-C

    - (MaplyRemoteTileFetcher *_Nullable)addTileFetcher:(NSString *_Nonnull)name;

    Swift

    func addTileFetcher(_ name: String) -> MaplyRemoteTileFetcher?
  • If in Metal rendering mode, return the Metal device being used.

    Declaration

    Objective-C

    - (id<MTLDevice> _Nullable)getMetalDevice;

    Swift

    func getMetalDevice() -> MTLDevice?
  • If in Metal rendering mode, return the shader library set up by the toolkit.

    Declaration

    Objective-C

    - (id<MTLLibrary> _Nullable)getMetalLibrary;

    Swift

    func getMetalLibrary() -> MTLLibrary?
  • An explicit teardown. For render controllers you allocate standalone, this is a good idea.

    Declaration

    Objective-C

    - (void)teardown;

    Swift

    func teardown()