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(web): fix default infobox behavior #681

Merged
merged 3 commits into from Sep 13, 2023
Merged

chore(web): fix default infobox behavior #681

merged 3 commits into from Sep 13, 2023

Conversation

keiya01
Copy link
Member

@keiya01 keiya01 commented Sep 11, 2023

Overview

What I've done

What I haven't done

How I tested

It should not show the infobox

const layerId = window.reearth?.layers?.add?.({
      type: "simple",
      data: {
        type: "3dtiles",
        url: "https://assets.cms.plateau.reearth.io/assets/4a/30f295-cd07-46b0-b0ab-4a4b1b3af06b/13100_tokyo23-ku_2022_3dtiles_1_1_op_bldg_13102_chuo-ku_lod2_no_texture/tileset.json",
      },
      "3dtiles": {
        pbr: false,
      },
    });

setTimeout(() => {
  if (layerId) {
    reearth.camera.flyTo(layerId);
  }
}, 0);

It should show the infobox

const layerId = window.reearth?.layers?.add?.({
      type: "simple",
      data: {
        type: "3dtiles",
        url: "https://assets.cms.plateau.reearth.io/assets/4a/30f295-cd07-46b0-b0ab-4a4b1b3af06b/13100_tokyo23-ku_2022_3dtiles_1_1_op_bldg_13102_chuo-ku_lod2_no_texture/tileset.json",
      },
      "3dtiles": {
        pbr: false,
      },
      infobox: {}
    });

setTimeout(() => {
  if (layerId) {
    reearth.camera.flyTo(layerId);
  }
}, 0);

Which point I want you to review particularly

Memo

@keiya01 keiya01 self-assigned this Sep 11, 2023
@netlify
Copy link

netlify bot commented Sep 11, 2023

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 14c37cd
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/64ffedbc70038d00080b19af
😎 Deploy Preview https://deploy-preview-681--reearth-web.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we can't just do selectedLayer.layer.layer.infobox ? {title: ....,...,...} : undefined?
That way we don't have to check visibility or not. Or...do we "hide" the infobox somehow? I don't think in any UI we have a user-facing option for that, but maybe the plugin API has it, and that is why using visible is best?
Let me know

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, because this is inherited from classic. I'll try it

Copy link
Member Author

Choose a reason for hiding this comment

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

I fixed your comment.
refactor

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #681 (14c37cd) into main (02cb8d1) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #681   +/-   ##
=======================================
  Coverage   26.66%   26.66%           
=======================================
  Files        1555     1555           
  Lines      169732   169731    -1     
  Branches     3878     3878           
=======================================
  Hits        45262    45262           
+ Misses     123381   123380    -1     
  Partials     1089     1089           
Flag Coverage Δ
web 24.93% <0.00%> (+<0.01%) ⬆️
web-beta 24.93% <0.00%> (+<0.01%) ⬆️
web-classic 24.93% <0.00%> (+<0.01%) ⬆️
web-utils 24.93% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
web/src/beta/lib/core/Visualizer/hooks.ts 0.00% <0.00%> (ø)
web/src/beta/lib/core/Visualizer/index.tsx 0.00% <0.00%> (ø)

@keiya01 keiya01 merged commit a364159 into main Sep 13, 2023
17 checks passed
@keiya01 keiya01 deleted the fix/default-infobox branch September 13, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants