Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Per-attribute transition properties on MGLStyleLayer #8225

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ios] MGLTransition struct moved to MGLTypes.h
  • Loading branch information
fabian-guerra committed Mar 10, 2017
commit 342038220e1bc63b94ec4ee5abc7f10cdccf9b07
15 changes: 0 additions & 15 deletions platform/darwin/src/MGLStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
static MGL_EXPORT const NSInteger MGLStyleDefaultVersion = 9;

/**
A structure containing information about a transition values.
*/
typedef struct MGLTransition {
/**
The duration in seconds to animate any changes to the style URL or to layout and paint attributes.
*/
NSTimeInterval duration;

/**
The delay in seconds to before applying any changes to the style URL or to layout and paint attributes.
*/
NSTimeInterval delay;
} MGLTransition;


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraneous whitespace.

/**
The proxy object for the current map style.
Expand Down
15 changes: 15 additions & 0 deletions platform/darwin/src/MGLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) {
#endif
};

/**
A structure containing information about a transition values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove values.

*/
typedef struct MGLTransition {
/**
The duration in seconds to animate any changes to the style URL or to layout and paint attributes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit of a nonsequitur to talk about style URLs and attributes here. This structure is generic enough that its documentation should be more self-contained. For example:

The amount of time the animation should take, not including the delay.

(It doesn't include the delay, does it?)

*/
NSTimeInterval duration;

/**
The delay in seconds to before applying any changes to the style URL or to layout and paint attributes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove to in to before.

*/
NSTimeInterval delay;
} MGLTransition;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide a factory method MGLTransitionMake(). We might also want to add transition-related methods to NSValue(MGLAdditions) to make it easier to work with MGLTransition instances when an object is needed.

NS_ASSUME_NONNULL_END

#ifndef NS_ARRAY_OF
Expand Down