Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ianthetechie opened this issue Aug 27, 2023 · 0 comments
Labels
DSL enhancement New feature or request

Comments

@ianthetechie
Copy link
Collaborator

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]))
}
@ianthetechie ianthetechie added enhancement New feature or request DSL labels Aug 27, 2023
ianthetechie pushed a commit that referenced this issue Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DSL enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant