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

Fix sharing when using initfile #7270

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#### next release (8.7.9)

- Fix sharing when using initfile.
- [The next improvement]

#### 8.7.8 - 2024-11-01
Expand All @@ -19,7 +20,7 @@

- Remove RollbarErrorServiceProvder
- Error services now instantiated externally to terriajs

- [The next improvement]
- Fix remaining lint warnings
- Augment cesium types and start using import instead of require in ts files
- Update to sass 1.79.1
Expand Down
7 changes: 7 additions & 0 deletions lib/ReactViews/Map/Panels/SharePanel/BuildShareLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ function buildBaseShareUrl(
) {
const uri = new URI(document.baseURI).fragment("").search("");

const usefulSubs = new URL(document.URL).hash
.split(/[#&]/)
.filter((elem) =>
elem !== "" && !elem.includes("share=") && !elem.includes("start=")
);
usefulSubs.forEach(sub => { uri.addSearch(sub) });

if (terria.developmentEnv) {
uri.addSearch(toJS(terria.userProperties));
} else {
Expand Down