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

Share current view of map via URL search params #2437

Merged
merged 9 commits into from
Jun 18, 2024

Conversation

ianguerin
Copy link
Collaborator

@ianguerin ianguerin commented Jun 7, 2024

Includes heading, pitch, roll, latitude, longitude, height, and enabled layers.
Add feature behind Map config showShareUrl.

QuickDemoShareViewToURL.webm

#1806

@robyngit robyngit linked an issue Jun 7, 2024 that may be closed by this pull request
@ianguerin ianguerin force-pushed the feature-1806-save-to-url branch from fe03591 to b121572 Compare June 10, 2024 16:17
Comment on lines 382 to 385
this.model.get("name") +
" " +
MetacatUI.appModel.get("portalTermSingular") +
" can be viewed in the ",
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
this.model.get("name") +
" " +
MetacatUI.appModel.get("portalTermSingular") +
" can be viewed in the ",
this.model.get("name") +
" " +
MetacatUI.appModel.get("portalTermSingular") +
" can be viewed in the ",

Comment on lines 508 to 509
"#portal-section-tabs",
),
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
"#portal-section-tabs",
),
"#portal-section-tabs",
),

@@ -533,7 +535,7 @@ define([
} catch (error) {
console.log(
"Error re-arranging tabs according to the pageOrder option. Error message: " +
error,
error,
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
error,
error,

Comment on lines 588 to 591
MetacatUI.root +
"/css/portal-layouts/" +
layout +
".css",
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
MetacatUI.root +
"/css/portal-layouts/" +
layout +
".css",
MetacatUI.root +
"/css/portal-layouts/" +
layout +
".css",

Comment on lines 610 to 611
". Error details: " +
error,
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
". Error details: " +
error,
". Error details: " +
error,

Comment on lines 986 to 988
//If the request to the monitor/status API fails, then show the not-found message
view.showNotFound.call(view);
},
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
//If the request to the monitor/status API fails, then show the not-found message
view.showNotFound.call(view);
},
//If the request to the monitor/status API fails, then show the not-found message
view.showNotFound.call(view);
},

Comment on lines 994 to 996
"\".</p><p><i class='icon icon-exclamation-sign'></i> If this portal was created in the last few minutes, it may still be processing, since there are currently <b>" +
sizeOfQueue +
"</b> submissions in the queue.</p>",
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
"\".</p><p><i class='icon icon-exclamation-sign'></i> If this portal was created in the last few minutes, it may still be processing, since there are currently <b>" +
sizeOfQueue +
"</b> submissions in the queue.</p>",
"\".</p><p><i class='icon icon-exclamation-sign'></i> If this portal was created in the last few minutes, it may still be processing, since there are currently <b>" +
sizeOfQueue +
"</b> submissions in the queue.</p>",

Comment on lines 1038 to 1039
"The data portal \"<span id='portal-view-not-found-name'></span>" +
"\" doesn't exist.",
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
"The data portal \"<span id='portal-view-not-found-name'></span>" +
"\" doesn't exist.",
"The data portal \"<span id='portal-view-not-found-name'></span>" +
"\" doesn't exist.",

Comment on lines 1106 to 1110
icon +
"'></i>" +
errorTitle +
"</h4>" +
errorMsg,
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
icon +
"'></i>" +
errorTitle +
"</h4>" +
errorMsg,
icon +
"'></i>" +
errorTitle +
"</h4>" +
errorMsg,

@@ -1111,19 +1119,19 @@ define([
} catch (error) {
console.log(
"There was a problem trying to display the error message in the Portal View. Error details: " +
error,
error,
Copy link
Contributor

Choose a reason for hiding this comment

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

[prettier] reported by reviewdog 🐶

Suggested change
error,
error,

@ianguerin ianguerin force-pushed the feature-1806-save-to-url branch from b121572 to b817596 Compare June 10, 2024 16:34
Copy link
Collaborator

@yvonnesjy yvonnesjy left a comment

Choose a reason for hiding this comment

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

Have we tested this on a main repo map?

CONTRIBUTING.md Show resolved Hide resolved
src/css/map-view.css Outdated Show resolved Hide resolved
src/css/map-view.css Outdated Show resolved Hide resolved
src/js/common/SearchParams.js Outdated Show resolved Hide resolved
src/js/common/SearchParams.js Outdated Show resolved Hide resolved
src/js/views/maps/CesiumWidgetView.js Show resolved Hide resolved
src/js/views/maps/ToolbarView.js Outdated Show resolved Hide resolved
src/js/views/maps/ToolbarView.js Show resolved Hide resolved
src/js/views/maps/ToolbarView.js Outdated Show resolved Hide resolved
src/js/views/portals/PortalView.js Show resolved Hide resolved
@ianguerin ianguerin force-pushed the feature-1806-save-to-url branch 2 times, most recently from 05a6e43 to e3e2132 Compare June 14, 2024 19:45
@ianguerin ianguerin requested a review from yvonnesjy June 14, 2024 19:52
src/js/models/maps/assets/MapAsset.js Outdated Show resolved Hide resolved
src/js/models/maps/assets/MapAsset.js Outdated Show resolved Hide resolved
src/js/views/maps/CesiumWidgetView.js Outdated Show resolved Hide resolved
src/js/views/maps/ToolbarView.js Outdated Show resolved Hide resolved
src/js/views/portals/PortalView.js Show resolved Hide resolved
@yvonnesjy
Copy link
Collaborator

yvonnesjy commented Jun 15, 2024

Have we tested this on a main repo map?

Tested on ADC and it works! The map is too skinny in the 3-part view though so the copy button is not shown immediately. Can we make clicking on the input box a copy action as well?
image

Copy link
Member

@robyngit robyngit left a comment

Choose a reason for hiding this comment

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

This works so well @ianguerin, people are going to be really excited about this!

Approved pending changes @yvonnesjy requested

Comment on lines 266 to 267
// TODO(ianguerin): make this false before checking in.
showShareUrl: true,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO(ianguerin): make this false before checking in.
showShareUrl: true,
showShareUrl: false,

@ianguerin
Copy link
Collaborator Author

Have we tested this on a main repo map?

Tested on ADC and it works! The map is too skinny in the 3-part view though so the copy button is not shown immediately. Can we make clicking on the input box a copy action as well? image

I've added the ability to copy by clicking the input

@ianguerin ianguerin requested a review from yvonnesjy June 18, 2024 18:14
@ianguerin ianguerin force-pushed the feature-1806-save-to-url branch from 7ed0a42 to 844a1a6 Compare June 18, 2024 18:57
@ianguerin ianguerin merged commit fd5daaf into develop Jun 18, 2024
1 check failed
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.

Save the current Cesium config as a link for sharing
3 participants