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

chore(examples): Rewrite I3S BSL example with React FC #2885

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

maxkuznetsov-actionengine
Copy link
Collaborator

No description provided.

@maxkuznetsov-actionengine maxkuznetsov-actionengine changed the title chore(examples): Rewrite BSL example React FC chore(examples): Rewrite I3S BSL example with React FC Feb 14, 2024
@maxkuznetsov-actionengine
Copy link
Collaborator Author

Example is re-factored to get it based on react functional components.
deck.gl-community layers is added to support filtering by attributes in the example.

color: black;
}
`;

export const Font = `
font-family: 'Uber Move' sans-serif;
Copy link
Collaborator

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...

Copy link
Collaborator Author

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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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] +=
Copy link
Collaborator

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.

Copy link
Collaborator Author

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[]) => {
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@maxkuznetsov-actionengine maxkuznetsov-actionengine merged commit ad93787 into master Feb 16, 2024
3 checks passed
@maxkuznetsov-actionengine maxkuznetsov-actionengine deleted the rewrite_bsl_example_react_fc branch February 16, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants