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

feat: slpk from local filesystem feature #377

Merged
merged 8 commits into from
Nov 28, 2024

Conversation

dariaterekhova-actionengine
Copy link
Collaborator

First part of changes for slpk from local filesystem feature

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-377.d3nof3l3x2sso4.amplifyapp.com

@dsavinov-actionengine
Copy link

@belom88 Please review as soon as you can

const fileSystem = new ZipFileSystem(archive);
options.fetch = fileSystem.fetch.bind(fileSystem) as (filename: string) => Promise<Response>;
} catch (e) {
console.log("error", e);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
console.log("error", e);
console.error(e);

src/redux/slices/flattened-sublayers-slice.ts Show resolved Hide resolved
@@ -238,8 +248,9 @@ export const ViewerApp = () => {
setSelectedFeatureAttributes(null);
setSelectedFeatureIndex(-1);
if (buildingExplorerOpened && tilesetsData[0]) {
const tilesetDataUrl = typeof tilesetsData[0].url === "string" ? tilesetsData[0].url : tilesetsData[0].url.name;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some utility function getDatasetUrl(dataset: LayerExample | TilesetMetadata) => string. You reuse this pattern many times. This function would make the code more readable.

Suggested change
const tilesetDataUrl = typeof tilesetsData[0].url === "string" ? tilesetsData[0].url : tilesetsData[0].url.name;
const tilesetDataUrl = getDatasetUrl(tilesetsData[0]);

Comment on lines +223 to +228
let params = { tilesetUrl: "" as string | File, token: "" };
if (typeof layer.url === "string") {
params = parseTilesetUrlParams(layer.url, layer);
} else {
params.tilesetUrl = layer.url;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this part is different in src/pages/debug-app/debug-app.tsx and src/components/comparison/comparison-side/comparison-side.tsx?

@@ -95,7 +95,7 @@ export const findExampleAndUpdateWithViewState = (

for (const example of examplesCopy) {
// We can't compare by tileset.url === example.url because BSL and Scene examples url is not loaded as tileset.
if (tileset.url.includes(example.url) && !example.viewState) {
if (tileset.url.includes(typeof example.url === "string" ? example.url : example.url.name) && !example.viewState) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (tileset.url.includes(typeof example.url === "string" ? example.url : example.url.name) && !example.viewState) {
if (tileset.url.includes(getLayerUrl(example.url)) && !example.viewState) {

@dariaterekhova-actionengine dariaterekhova-actionengine merged commit 19f7be4 into master Nov 28, 2024
3 checks passed
@dariaterekhova-actionengine dariaterekhova-actionengine deleted the dt/local_file_reading branch November 28, 2024 13:43
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.

3 participants