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

Map zooms out when the same location is clicked #208

Open
2 tasks
krizpoon opened this issue Apr 7, 2020 · 0 comments
Open
2 tasks

Map zooms out when the same location is clicked #208

krizpoon opened this issue Apr 7, 2020 · 0 comments

Comments

@krizpoon
Copy link

krizpoon commented Apr 7, 2020

Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • I'm submitting a ...

    • [ x ] bug report
    • feature request
    • support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug?

A bug.

  • What is the current behavior?

In the high risk map, when a location is clicked, a popup will open. When user click on the map, the popup will be closed. When the same location is clicked again, the map zooms out instead of focusing on the location.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Scenario 1

  1. Click on a location in high risk map
  2. Click on the same location, the map zooms out

Scenario 2

  1. Click on a location in high risk map
  2. Click on an empty space on the map, the popup closes
  3. Click on the same location, the map zooms out
  • What is the expected behavior?

Scenario 1
The popup should close but the map should not zoom out

Scenario 2
The location should be focused

  • What is the motivation / use case for changing the behavior?

The map is jumping to unexpected area. User needs to zoom in to the area the he was viewing. That is quite inconvenient.

  • Please tell us about your environment:

    • Version: 0.1.0
    • Browser: Chrome Version 80.0.3987.149
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

The issue is caused by the state activeDataPoint not being cleared when the popup is closed. Suggest to fix it either by listening on the popupclose event to clear activeDataPoint. Or by checking if the popup is currently open in the getActiveHandler method.

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

No branches or pull requests

1 participant