-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
87922d5
to
c5a06d2
Compare
c5a06d2
to
41d89a1
Compare
Ready for review @LukasPaczos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great seeing code examples in the javadoc itself! 🚀
While we are at it, some nice-to-haves:
- example usage of
Expression#properties()
andExpression#geometryType()
- javadoc indication that
Expression#string
,Expression#number
etc. return the first type-matching object rather than a boolean that it's present in the set - code example for
exponential(@NonNull Expression expression)
- more complicated styling example combining a couple of expressions at the top of the class?
* symbolLayer.setProperties( | ||
* iconSize( | ||
* switchCase( | ||
* get(KEY_PROPERTY_SELECTED), literal(3.0f), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe one more case option before default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would make it a bit more clear + also added // default value
:
* symbolLayer.setProperties(
* iconSize(
* switchCase(
* get(KEY_TO_BOOLEAN), literal(3.0f),
* get(KEY_TO_OTHER_BOOLEAN), literal(5.0f)
* literal(1.0f) // default value
* )
* )
* );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 🚀
@@ -569,6 +986,7 @@ public static Expression match(@NonNull Expression input, @NonNull Expression de | |||
|
|||
/** | |||
* Evaluates each expression in turn until the first non-null value is obtained, and returns that value. | |||
* // TODO: 26/03/2018 javadoc example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO sneaked in
* {@code | ||
* SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id"); | ||
* symbolLayer.setProperties( | ||
* textField(get(literal("key-to-feature"), properties())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this result in a call without a second argument, get("key-to-feature")
? Can we add an example that uses a different properties object?
* {@code | ||
* SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id"); | ||
* symbolLayer.setProperties( | ||
* textField(get("key-to-feature", properties())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
* {@code | ||
* FillLayer fillLayer = new FillLayer("layer-id", "source-id"); | ||
* fillLayer.setFilter( | ||
* has(string("keyToValue")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be has(literal("keyToValue"))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually has(get("keyToValue"))
* FillLayer fillLayer = new fillLayer("layer-id", "source-id"); | ||
* fillLayer.setProperties( | ||
* fillColor( | ||
* exponential(0.5f), zoom(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
* FillLayer fillLayer = new fillLayer("layer-id", "source-id"); | ||
* fillLayer.setProperties( | ||
* fillColor( | ||
* linear(), zoom(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
* FillLayer fillLayer = new fillLayer("layer-id", "source-id"); | ||
* fillLayer.setProperties( | ||
* fillColor( | ||
* exponential(0.5f), zoom(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
* FillLayer fillLayer = new fillLayer("layer-id", "source-id"); | ||
* fillLayer.setProperties( | ||
* fillColor( | ||
* cubicBezier(0.42f, 0.0f, 1.0f, 1.0f), zoom(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
* FillLayer fillLayer = new fillLayer("layer-id", "source-id"); | ||
* fillLayer.setProperties( | ||
* fillColor( | ||
* cubicBezier(0.42f, 0.0f, 1.0f, 1.0f), zoom(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
41d89a1
to
109439e
Compare
109439e
to
7fd0d14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
WIP, this PR adds inline expression code examples to the javadoc.
closes #11159