Skip to content

Support constructing layers as children of sources with an implicit reference #3

Open
@ianthetechie

Description

@ianthetechie

This would remove the possibility for many dumb errors. The React Native API actually does a really nice job of this. I'm not sure how easy it is, but it would be a nice feature.

Theoretical example usage:

ShapeSource(identifier: "pedestrian-polyline") {
    // One or more features...
    MGLPolylineFeature(coordinates: samplePedestrianWaypoints)

    // Followed by one or more layers, which wouldn't need to specify a source
    LineStyleLayer(identifier: "route-line-casing")
        .lineCap(constant: .round)
        .lineJoin(constant: .round)
        .lineColor(constant: .white)
        .lineWidth(interpolatedBy: .zoomLevel,
                   curveType: .exponential,
                   parameters: NSExpression(forConstantValue: 1.5),
                   stops: NSExpression(forConstantValue: [14: 6, 18: 24]))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions