LayerContainer
public protocol LayerContainer
Implemented by any object that can contain Layer
s (such as a Map
)
-
layers(_:
Extension method) Filters the
Layer
s contained by the supplied filters. It does no further type restriction although of course theLayer.Kind
of the layer can be used to extractLayer.Kind
specifc informationThrows
An exception will be thrown if there are no filters or no layers matchDeclaration
Swift
func layers(_ matching: LayerFilter...) throws -> [Layer]
Parameters
matching
Zero or more filters to use to reduce the set of matching layers
Return Value
A new
LayerContainer
containing the filteredLayer
s -
groupLayer(_:
Extension methodat: ) Returns a single
GroupLayer
that matches the supplied filtersThrows
Any exception will be thrown if there are no filters, no layers match, or more than one layer matches the supplied filtersDeclaration
Swift
func groupLayer(_ matching: LayerFilter..., at index: Int? = nil) throws -> GroupLayer
Parameters
matching
The filters that should result in a single
Layer
being identifiedindex
If you know that the filters which match multiple and want a specific result specify it here
Return Value
The matching
GroupLayer
-
objectLayer(_:
Extension methodat: ) Returns a single
ObjectLayer
that matches the supplied filtersThrows
Any exception will be thrown if there are no filters, no layers match, or more than one layer matches the supplied filtersDeclaration
Swift
func objectLayer(_ matching: LayerFilter..., at index: Int? = nil) throws -> ObjectLayer
Parameters
matching
The filters that should result in a single
Layer
being identifiedReturn Value
The matching
ObjectLayer
-
tileLayer(_:
Extension methodat: ) Returns a single
TileLayer
that matches the supplied filtersThrows
Any exception will be thrown if there are no filters, no layers match, or more than one layer matches the supplied filtersDeclaration
Swift
func tileLayer(_ matching: LayerFilter..., at index: Int? = nil) throws -> TileLayer
Parameters
matching
The filters that should result in a single
Layer
being identifiedReturn Value
The matching
TileLayer
-
imageLayer(_:
Extension methodat: ) Returns a single
ImageLayer
that matches the supplied filtersThrows
Any exception will be thrown if there are no filters, no layers match, or more than one layer matches the supplied filtersDeclaration
Swift
func imageLayer(_ matching: LayerFilter..., at index: Int? = nil) throws -> ImageLayer
Parameters
matching
The filters that should result in a single
Layer
being identifiedReturn Value
The matching
ImageLayer
-
object(_:
Extension methoddeep: ) Retreives an object with the specified
id
. By default the search is recursive (searching within groups).Declaration
Swift
func object(_ id: Int, deep recursiveSearch: Bool = true) -> Object?
Parameters
id
The desired id
recursiveSearch
If
true
then the search will search within groups until it finds object layer containing the object with the id.Return Value
An
Object
ornil
if no object with that id exists -
objects(deep:
Extension methodmatching: ) Retreives all of the objects contained by the layers of the container that match the supplied filters
Declaration
Swift
func objects(deep recursiveSearch: Bool = true, matching filters: ObjectFilter...) -> [Object]
Parameters
recursiveSearch
If
true
any groups will be recursively searched for the objectsfilters
The
LayerFilter
s objects must matchReturn Value
All matching
Object
s