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

feat: added multi-layer support to map popup #140

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Dec 22, 2022

Refactor map popup rendering logic,

  1. Abstract a reusable popup rendering logic.
  2. For click-popups which need to display multi-layers information, added an event listener globally and then query features from all layers at the current position.
  3. For hover-popups which show information of the current layer features, moved the popup rendering logic out from the layer render logic(in the layer control panel component).

Signed-off-by: Yulong Ruan [email protected]

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@ruanyl ruanyl requested a review from a team December 22, 2022 11:30
@@ -104,7 +104,7 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => {
if (isCompleteResponse(response)) {
const dataSource = response.rawResponse.hits.hits;
layersFunctionMap[layer.type].render(maplibreRef, layer, dataSource);
layersFunctionMap[layer.type].addTooltip(maplibreRef, layer);
// layersFunctionMap[layer.type].addTooltip(maplibreRef, layer);
Copy link
Member

Choose a reason for hiding this comment

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

Shall we remove this line if not need?

1. Abstract a reusable popup rendering logic.
2. For click-popups which need to display multi-layers
  information, added an event listener globally and then
  query features from all layers at the current position.
3. For hover-popups which show information of the current
  layer features, moved the popup rendering logic out from
  the layer render logic(in the layer control panel component).

Signed-off-by: Yulong Ruan <[email protected]>
@ruanyl ruanyl force-pushed the feature/new-maps-tooltip-improvement branch from 7f1c741 to 97987be Compare December 23, 2022 09:17
@ruanyl ruanyl force-pushed the feature/new-maps-tooltip-improvement branch from 670bac5 to b5f358a Compare December 23, 2022 09:45
@VijayanB VijayanB merged commit 254a252 into opensearch-project:feature/new-maps Dec 23, 2022
@junqiu-lei junqiu-lei added enhancement New feature or request v2.5.0 'Issues and PRs related to version v2.5.0' labels Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.5.0 'Issues and PRs related to version v2.5.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants