stadiamaps / maplibre-swiftui-dsl-playground

DSL and SwiftUI integration for MapLibre
BSD 3-Clause "New" or "Revised" License
20 stars 6 forks source link

expose text font names as a modifier #47

Closed NaifAlrashed closed 1 month ago

NaifAlrashed commented 1 month ago

Consumers of SwiftUI dsl are now able to customize the font family for the text attribute for SymbolLayer. It provides a solution to this problem. According to the docs, the font family can be set to nil to reset to default value, so the exposed type is [String]?

hactar commented 1 month ago

Looking at the other properties we have so far and their documentation, all expressions are optional, but so far we have been adding the underlying variable as non optional, this appears to be the first one we are adding as optional. Not saying this is wrong, but trying to understand in which case this needs to be optional and in which cases it doesn't. Whats the criteria here?

ianthetechie commented 1 month ago

That's a good question... I didn't notice that; thanks for catching it!

Can anyone think of a (non-contrived) use case for building a symbol style layer (reminder: this is currently always from scratch; not loading from JSON or something) and needing to set a property to null? I can't (which is why they are non-optional elsewhere).

NaifAlrashed commented 1 month ago

I cannot think of a use case to pass nil. In fact, our internal solution was [String]. I just did it to expose the whole functionality because I thought this is library code. Would you like me to make it [String]?

ianthetechie commented 1 month ago

I'll wait to hear if @hactar or @Archdoog have any arguments otherwise, but yeah I'm leaning toward making it [String].

hactar commented 4 weeks ago

I can't think of a useful use case either...

ianthetechie commented 3 weeks ago

Ok; I'll fix this up ;)