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

GSLUX-722: Fix embedded mode #125

Merged
merged 12 commits into from
Jul 31, 2024
Merged

Conversation

AlitaBernachot
Copy link
Contributor

@AlitaBernachot AlitaBernachot commented Jul 22, 2024

JIRA issue

https://jira.camptocamp.com/browse/GSLUX-722

Description

  • Add new functionality to v4: embedded mode (just add param ?embedded=true in url)
  • Force resize map when embedded mode, with a timer for v3 (because of angular component, wait until they have finish rendering header and footer that will disappear, otherwise, there is an unwanted gutter). For v4, no timer needed.

NB. This PR needs Geoportail-Luxembourg/geoportailv3#3179

Copy link
Contributor

GitHub Pages links: * Luxembourg-geoportail: https://geoportail-luxembourg.github.io/luxembourg-geoportail/GSLUX-722-fix-embedded-mode/

@AlitaBernachot AlitaBernachot marked this pull request as draft July 23, 2024 08:13
@AlitaBernachot AlitaBernachot force-pushed the GSLUX-722-fix-embedded-mode branch 2 times, most recently from 747c315 to 9ffa6eb Compare July 29, 2024 13:49
@AlitaBernachot AlitaBernachot marked this pull request as ready for review July 29, 2024 16:23
@AlitaBernachot AlitaBernachot requested review from tkohr and mki-c2c July 30, 2024 06:46
Copy link
Contributor

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks, @AlitaBernachot ! Works well in standalone as well as lib.

VITE_DEFAULT_MAX_EXTENT=[2.6, 47.7, 8.6, 51]

# Mode lib in v3
VITE_MODE_LIB=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// TODO: Add slide effect and do this update after slide animation ends
}
onMounted(() => window.addEventListener('resize', map.resize))
onUnmounted(() => window.removeEventListener('resize', map.resize))
</script>

<template>
<div class="h-screen flex flex-col overflow-hidden">
Copy link
Contributor

Choose a reason for hiding this comment

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

Could it make sense to move the v-if="!embedded" here and add a v-else for the map-container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, with template tag

Copy link
Contributor

Choose a reason for hiding this comment

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

great, thanks!

Comment on lines 76 to 79
<fullscreen-control v-if="!embedded" />
<attribution-control v-if="!embedded" />
<map-3d-control v-if="v4_standalone && !embedded" />
<location-control v-if="!embedded" />
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, maybe a div around it with the v-if="!embedded" condition could simplify the template.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will try, I hope adding a div won't break all the display.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a <template v-if="!embedded"> tag instead of a <div> to wrap the controls. This way it won't add a useless node in the DOM.

Copy link
Contributor

@mki-c2c mki-c2c left a comment

Choose a reason for hiding this comment

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

looks great when configuring the map view via the controls and then passing in embedded mode,
thanks.

@AlitaBernachot AlitaBernachot force-pushed the GSLUX-722-fix-embedded-mode branch from 36c75b4 to 15d398d Compare July 30, 2024 19:16
@AlitaBernachot AlitaBernachot force-pushed the GSLUX-722-fix-embedded-mode branch from 15d398d to 7aa7f77 Compare July 30, 2024 19:18
@AlitaBernachot AlitaBernachot force-pushed the GSLUX-722-fix-embedded-mode branch from 7aa7f77 to 4d383a6 Compare July 31, 2024 07:28
@AlitaBernachot AlitaBernachot merged commit 7223361 into main Jul 31, 2024
2 checks passed
@AlitaBernachot AlitaBernachot deleted the GSLUX-722-fix-embedded-mode branch July 31, 2024 08:50
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