LayerContainer
public protocol LayerContainer
Implemented by any object that can contain Layers (such as a Map)
-
layers(_:Extension method) Filters the
Layers contained by the supplied filters. It does no further type restriction although of course theLayer.Kindof the layer can be used to extractLayer.Kindspecifc informationThrows
An exception will be thrown if there are no filters or no layers matchDeclaration
Swift
func layers(_ matching: LayerFilter...) throws -> [Layer]Parameters
matchingZero or more filters to use to reduce the set of matching layers
Return Value
A new
LayerContainercontaining the filteredLayers -
groupLayer(_:Extension methodat: ) Returns a single
GroupLayerthat 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 -> GroupLayerParameters
matchingThe filters that should result in a single
Layerbeing identifiedindexIf 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
ObjectLayerthat 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 -> ObjectLayerParameters
matchingThe filters that should result in a single
Layerbeing identifiedReturn Value
The matching
ObjectLayer -
tileLayer(_:Extension methodat: ) Returns a single
TileLayerthat 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 -> TileLayerParameters
matchingThe filters that should result in a single
Layerbeing identifiedReturn Value
The matching
TileLayer -
imageLayer(_:Extension methodat: ) Returns a single
ImageLayerthat 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 -> ImageLayerParameters
matchingThe filters that should result in a single
Layerbeing 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
idThe desired id
recursiveSearchIf
truethen the search will search within groups until it finds object layer containing the object with the id.Return Value
An
Objectornilif 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
recursiveSearchIf
trueany groups will be recursively searched for the objectsfiltersThe
LayerFilters objects must matchReturn Value
All matching
Objects
View on GitHub
LayerContainer Protocol Reference