-
Notifications
You must be signed in to change notification settings - Fork 195
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
chore(examples): Rewrite I3S BSL example with React FC #2885
chore(examples): Rewrite I3S BSL example with React FC #2885
Conversation
Example is re-factored to get it based on react functional components. |
color: black; | ||
} | ||
`; | ||
|
||
export const Font = ` | ||
font-family: 'Uber Move' sans-serif; |
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.
Nit: Move away from Uber fonts...
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.
Removed
* We need to calculate projection of camera direction onto the ellipsoid surface. | ||
* We use this projection as offset to add it to the tileset cartographic center position. | ||
*/ | ||
const projection = zmin * Math.tan((pitch * Math.PI) / 180); |
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.
Nit: UPPER_CASE for constants.
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.
This logic came from old i3s example. Actually it's not needed here, so I've removed it.
/** | ||
* Shift longitude | ||
*/ | ||
projectedPostion[0] += |
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.
If possible avoid relying on global side effects. Create a function that calculates the constant.
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.
This logic came from old i3s example. Actually it's not needed here, so I've removed it.
} | ||
}; | ||
|
||
const renderSublayers = (sublayers: Sublayer[]) => { |
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.
Just as my preference, I prefer function
syntax, at least for longer functions, so that is how most examples in this repo will look. But we don't necessarily need to be consistent
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.
Done
No description provided.