AWFMapOverlayFactory

Objective-C

@protocol AWFMapOverlayFactory <NSObject>

Swift

protocol AWFMapOverlayFactory : NSObjectProtocol

The AWFMapOverlayFactory protocol is adopted by an object that provides the necessary overlay and annotation objects required for rendering elements using a specific mapping strategy.

  • Returns an array of overlay objects for a series of AWFGeographicObject instances.

    Declaration

    Objective-C

    - (nonnull NSArray *)overlaysFromObjects:(nonnull NSArray *)objects;

    Swift

    func overlays(from objects: [Any]) -> [Any]

    Parameters

    objects

    An array of AWFGeographicObject instances to create overlays for

    Return Value

    An array of overlay objects

  • Returns an array of polygon overlay objects for a series of AWFGeographicObject instances. These objects must have a valid polygon string or AWFGeoPolygon instance in order for a polygon to be created for it.

    Declaration

    Objective-C

    - (nonnull NSArray<NSObject<AWFPolygon> *> *)polygonsFromObjects:
        (nonnull NSArray *)objects;

    Parameters

    objects

    An array of AWFGeographicObject instances to create polygon overlays for

    Return Value

    An array of polygon objects

  • Returns an array of polyline overlay objects for a series of AWFGeographicObject instances. These objects must have a valid polyline string or AWFGeoPolygon instance in order for a polyline to be created for it.

    Declaration

    Objective-C

    - (nonnull NSArray<NSObject<AWFPolyline> *> *)polylinesFromObjects:
        (nonnull NSArray *)objects;

    Parameters

    objects

    An array of AWFGeographicObject instances to create polyline overlays for

    Return Value

    An array of polyline objects

  • Returns an array of polygon overlay objects for a series of AWFGeoPolygon instances.

    Declaration

    Objective-C

    - (nonnull NSArray *)polygonsFromGeoPolygons:(nonnull NSArray *)geoPolygons;

    Swift

    func polygons(fromGeoPolygons geoPolygons: [Any]) -> [Any]

    Parameters

    geoPolygons

    An array of AWFGeoPolygon objects to create polygon overlays for

    Return Value

    An array of polygon objects

  • Returns an array of polyline overlay objects for a series of AWFGeoPolygon instances.

    Declaration

    Objective-C

    - (nonnull NSArray *)polylinesFromGeoPolygons:(nonnull NSArray *)geoPolygons;

    Swift

    func polylines(fromGeoPolygons geoPolygons: [Any]) -> [Any]

    Parameters

    geoPolygons

    An array of AWFGeoPolygon objects to create polyline overlays for

    Return Value

    An array of polyline objects

  • Returns a single overlay object that conforms to the AWFMultiShapeOverlay protocol for managing and rendering multiple polygons and polylines into a single overlay renderer.

    Declaration

    Objective-C

    - (nonnull id)
        combinedOverlayForPolygons:(nonnull NSArray<id<AWFPolygon>> *)polygons
                         polylines:(nonnull NSArray<id<AWFPolyline>> *)polylines;

    Parameters

    polygons

    An array of polygons to add to the overlay.

    polylines

    An array of polylines to add to the overlay.

    Return Value

    The multi-shape overlay instance

  • Iterates through an array of polygon objects and returns an array of polygon overlays that the strategy’s map view requires when adding to the map. This method will pull out the overlay instances stored within AWFPolygon and AWFPolyline objects in order to add them to the map view.

    Declaration

    Objective-C

    - (nonnull NSArray *)reducePolygonsToMapPolygons:(nonnull NSArray *)polygons;

    Swift

    func reducePolygons(toMapPolygons polygons: [Any]) -> [Any]

    Parameters

    polygons

    An array of polygon objects.

    Return Value

    An array of polygon overlay instances that can be added to the map view.

  • Returns a tile data layer initialized with the URLTemplate to use for tile URLs.

    Declaration

    Objective-C

    - (nonnull AWFTileSource *)tileOverlayWithURLTemplate:
        (nonnull NSString *)URLTemplate;

    Swift

    func tileOverlay(withURLTemplate URLTemplate: String) -> AWFTileSource

    Parameters

    URLTemplate

    The template for generating tile URLs

    Return Value

    An initialized tile data source object

  • Returns a tile source initialized with the URLTemplate to use for tile URLs.

    Declaration

    Objective-C

    - (nonnull AWFTileSource *)tileOverlayWithURLTemplate:
                                   (nonnull NSString *)URLTemplate
                                                    isAmp:(BOOL)isAmp;

    Swift

    func tileOverlay(withURLTemplate URLTemplate: String, isAmp: Bool) -> AWFTileSource

    Parameters

    URLTemplate

    The template for generating tile URLs

    isAmp

    Whether or not the returned source should be an AMP tile source

    Return Value

    An initialized tile data source object

  • Returns an array of annotation objects for a series of AWFGeographicObject instances. These objects must have a valid coordinate in order for an annotation to be created for it.

    Declaration

    Objective-C

    - (nonnull NSArray *)annotationsFromObjects:(nonnull NSArray *)objects;

    Swift

    func annotations(from objects: [Any]) -> [Any]

    Parameters

    objects

    An array of AWFGeographicObject instances to create annotations for

    Return Value

    An array of annotation objects

  • Returns an array of text annotation objects for a series of AWFGeographicObject instances. These objects must have a valid coordinate in order for an annotation to be created for it.

    Declaration

    Objective-C

    - (nonnull NSArray *)textAnnotationsFromObjects:(nonnull NSArray *)objects;

    Swift

    func textAnnotations(from objects: [Any]) -> [Any]

    Parameters

    objects

    An array of AWFGeographicObject instances to create annotations for

    Return Value

    An array of annotation objects