MSFMassifInterop
Objective-C
@interface MSFMassifInterop : NSObject {
void *swigCPtr;
BOOL swigCMemOwn;
}
Swift
class MSFMassifInterop : NSObject
The bridge between the object API and the facade; split off so MassifApi names no SDK type and a hand-written binding can carry it whole (#159). Only needed while migrating to the facade.
-
Adopts an object built with the object API, so it can be addressed by id and handle. The parameter type picks what is adopted;
kindis only the id namespace. Not namedregister: a C/C++ keyword, so not a legal Objective-C selector piece.Declaration
Objective-C
+ (int)adopt:(NSString *)kind objectId:(NSString *)objectId options:(MSFOptions *)options;Swift
class func adopt(_ kind: String!, objectId: String!, options: MSFOptions!) -> Int32Parameters
kindThe namespace, e.g. “options”. Ids only collide within a kind.
objectIdThe caller’s name for the object. “id” is a keyword in Objective-C.
optionsThe object.
Return Value
The handle, or 0 when the id is already taken.
-
The same for a layer or a source built with the object API. The concrete class is recovered at runtime, so an adopted VectorTileLayer answers to its own properties.
Declaration
Objective-C
+ (int)adopt:(NSString *)kind objectId:(NSString *)objectId layer:(MSFLayer *)layer;Swift
class func adopt(_ kind: String!, objectId: String!, layer: MSFLayer!) -> Int32Return Value
The handle, or 0 when the id is taken or the class is not a wrapped one.
-
Registers the map’s layer list, so a layer built from a spec can be put on the map: a spec builds an object but does not place it. Call add/remove on the returned handle.
-
Declaration
Objective-C
+ (int)adopt:(NSString *)kind objectId:(NSString *)objectId source:(MSFTileDataSource *)source;Swift
class func adopt(_ kind: String!, objectId: String!, source: MSFTileDataSource!) -> Int32 -
The same for a vector data source: a binding-side subclass (the extension mechanism) is adopted here. Named
vectorSource, notsource: Objective-C builds selectors from parameter names, and twosourceoverloads would collide asadopt:objectId:source:.Declaration
Objective-C
+ (int)adopt:(NSString *)kind objectId:(NSString *)objectId vectorSource:(MSFVectorDataSource *)vectorSource;Swift
class func adopt(_ kind: String!, objectId: String!, vectorSource: MSFVectorDataSource!) -> Int32 -
The same for an asset package, typically a binding-side subclass. A spec’s
assetskey resolves a string as an id of this kind, e.g.{"type":"cartocss","css":…,"assets":"shared"}.Declaration
Objective-C
+ (int)adopt:(NSString *)kind objectId:(NSString *)objectId assets:(MSFAssetPackage *)assets;Swift
class func adopt(_ kind: String!, objectId: String!, assets: MSFAssetPackage!) -> Int32 -
The map view, which carries the camera: once adopted, moveTo, flyTo, fitBounds, screenToMap, mapToScreen and stopFlight are facade calls, and focusPos, zoom, rotation, tilt and flightActive read-only properties.
Declaration
Objective-C
+ (int)adopt:(NSString *)kind objectId:(NSString *)objectId view:(MSFBaseMapView *)view;Swift
class func adopt(_ kind: String!, objectId: String!, view: MSFBaseMapView!) -> Int32 -
Returns a source built or adopted earlier, so it can be handed to the object API.
Declaration
Objective-C
+ (MSFTileDataSource *)getSource:(NSString *)objectId;Swift
class func getSource(_ objectId: String!) -> MSFTileDataSource! -
The same by handle, for an object never given an id (a child read off a property, a call result).
Declaration
Objective-C
+ (MSFTileDataSource *)getSourceByHandle:(int)handle;Swift
class func getSourceByHandle(_ handle: Int32) -> MSFTileDataSource! -
The object-API face of a registered map: its Options (a
maphandle), its Layers (alayershandle) and its view (aviewhandle). For code that still builds with the object API on a map the SDK created; null when the handle is not of that class.Declaration
Objective-C
+ (MSFOptions *)getOptionsByHandle:(int)handle;Swift
class func getOptionsByHandle(_ handle: Int32) -> MSFOptions! -
Declaration
Objective-C
+ (MSFBaseMapView *)getViewByHandle:(int)handle;Swift
class func getViewByHandle(_ handle: Int32) -> MSFBaseMapView! -
Builds the listener that turns a map’s callbacks into facade events on a target. Install it with setMapEventListener; it chains the previous listener since that slot is single:
mapView.setMapEventListener(MassifInterop.createEventBridge(handle, mapView.getMapEventListener())).Declaration
Objective-C
+ (MSFMapEventListener *)createEventBridge:(int)handle chained:(MSFMapEventListener *)chained;Swift
class func createEventBridge(_ handle: Int32, chained: MSFMapEventListener!) -> MSFMapEventListener!Parameters
handleThe target events are emitted on.
chainedThe listener already installed, or null.
Return Value
The bridge.
-
The same for a vector tile layer’s clicks; install with setVectorTileEventListener. The click is claimed if either the chained listener or a consuming subscriber claims it.
Declaration
Objective-C
+ (MSFVectorTileEventListener *) createVectorTileEventBridge:(int)handle chained:(MSFVectorTileEventListener *)chained;Swift
class func createVectorTileEventBridge(_ handle: Int32, chained: MSFVectorTileEventListener!) -> MSFVectorTileEventListener! -
The same for a vector layer’s element clicks.
Declaration
Objective-C
+ (MSFVectorElementEventListener *) createVectorElementEventBridge:(int)handle chained:(MSFVectorElementEventListener *)chained;Swift
class func createVectorElementEventBridge(_ handle: Int32, chained: MSFVectorElementEventListener!) -> MSFVectorElementEventListener! -
The same for a celestial layer’s object clicks; install with setCelestialEventListener.
Declaration
Objective-C
+ (MSFCelestialEventListener *) createCelestialEventBridge:(int)handle chained:(MSFCelestialEventListener *)chained;Swift
class func createCelestialEventBridge(_ handle: Int32, chained: MSFCelestialEventListener!) -> MSFCelestialEventListener! -
The three below install a click bridge on a layer given by handle, chaining the listener already there, with the layer as the target the events are emitted on. They spare a binding from touching the Layer class just to call setXEventListener.
Declaration
Objective-C
+ (BOOL)attachVectorTileEvents:(int)handle;Swift
class func attachVectorTileEvents(_ handle: Int32) -> BoolReturn Value
False if the handle is not a layer of the matching kind.
-
Declaration
Objective-C
+ (BOOL)attachVectorElementEvents:(int)handle;Swift
class func attachVectorElementEvents(_ handle: Int32) -> Bool -
Declaration
Objective-C
+ (BOOL)attachCelestialEvents:(int)handle;Swift
class func attachCelestialEvents(_ handle: Int32) -> Bool -
Undocumented
Declaration
Objective-C
-(void)dealloc;Swift
func dealloc()