Skip to content

PB-506 : embed sends information to parent about selected features#847

Merged
pakb merged 3 commits intodevelopfrom
feat_PB-506_iframe_feature_selection_event
May 24, 2024
Merged

PB-506 : embed sends information to parent about selected features#847
pakb merged 3 commits intodevelopfrom
feat_PB-506_iframe_feature_selection_event

Conversation

@pakb
Copy link
Contributor

@pakb pakb commented May 16, 2024

using postMessage API to send the feature ID and layer ID of selected features to parent

Can be tested in the this codepen (by changing the URL from test.map.geo.admin.ch to this PR's testlink) codepen here

Test link

@cypress
Copy link

cypress bot commented May 16, 2024

Passing run #2298 ↗︎

0 206 20 0 Flakiness 0

Details:

better "no feature" detection
Project: web-mapviewer Commit: 8f53ffdfed
Status: Passed Duration: 05:25 💡
Started: May 24, 2024 2:02 PM Ended: May 24, 2024 2:07 PM

Review all test suite changes for PR #847 ↗︎

@pakb pakb requested review from ltkum, ltshb and schtibe May 16, 2024 13:37
Copy link
Contributor

@schtibe schtibe left a comment

Choose a reason for hiding this comment

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

It doesn't work on the test link, or maybe I don't do it correctly (I selected public transport stops). I'm gonna check out the branch tomorrow and test it locally again!

@pakb
Copy link
Contributor Author

pakb commented May 16, 2024

It doesn't work on the test link, or maybe I don't do it correctly (I selected public transport stops). I'm gonna check out the branch tomorrow and test it locally again!

right... I have not added a relative URL to the debug view but a localhost one... Will update that tomorrow

@pakb pakb force-pushed the feat_PB-506_iframe_feature_selection_event branch 2 times, most recently from 390de90 to cf837c5 Compare May 17, 2024 08:57
@pakb pakb force-pushed the feat_PB-506_iframe_feature_selection_event branch from cf837c5 to f6dd363 Compare May 23, 2024 07:00
@pakb pakb requested review from ltshb and schtibe May 23, 2024 07:11
@pakb pakb force-pushed the feat_PB-506_iframe_feature_selection_event branch 2 times, most recently from f142941 to 3add735 Compare May 23, 2024 12:43
using postMessage API to send the feature ID and layer ID of selected features to parent
@pakb pakb force-pushed the feat_PB-506_iframe_feature_selection_event branch from 3add735 to fec32b8 Compare May 24, 2024 10:07
if the app was embedded in an iframe with featureInfo=none in the URL, it is because this iframe shouldn't show any tooltip at all (and the user will managed feature selection through the postMessage API), so no reset is needed at first feature selection (it is essentially persistent)
@pakb pakb force-pushed the feat_PB-506_iframe_feature_selection_event branch from fec32b8 to 40b6b23 Compare May 24, 2024 10:41
Copy link
Contributor

@schtibe schtibe left a comment

Choose a reason for hiding this comment

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

Apart from the little detail about the optional chaining operator, which is maybe irrelevant, this looks good to me!

with features given as null the code could break in some ways, here we make sure we have an array that contains something
@pakb pakb merged commit 2425c19 into develop May 24, 2024
@pakb pakb deleted the feat_PB-506_iframe_feature_selection_event branch May 24, 2024 14:10
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

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

@pakb why did you not implemented it as well in the map view ? iframe don't always uses the embed view and some user might use this feature with the mapview !

@pakb
Copy link
Contributor Author

pakb commented May 27, 2024

@pakb why did you not implemented it as well in the map view ? iframe don't always uses the embed view and some user might use this feature with the mapview !

good point, see #863

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.

3 participants