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 2 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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- Remove RollbarErrorServiceProvder
- Error services now instantiated externally to terriajs

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

#### 8.7.6 - 2024-08-22
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 @@ -40,6 +40,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