-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add region zooming when filtered by region. #226
base: master
Are you sure you want to change the base?
Conversation
@itpcc have some problem on mobile, but I saw this on chrome simulator (Iphone X). could you please check with the real mobile? |
Maybe I should multiply with the screen ratio instead. I'll do what I can. |
Up date with the upstream to prevent conflict.
As far as I can investigate, when using a mobile phone, if the tab 'map' is not active on page loading, the But if the tab 'map' is already active on page load, the problem won't happen. So, I'll detect tab changing event to re-position the map to solve this problem. However, this needed to take more time than I expected because the event handling is so complex for me. Your suggestion will be very helpful. Thanks in advance. |
Code Climate has analyzed commit 9152c89 and detected 3 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 0.0% (0% is the threshold). This pull request will bring the total coverage in the repository to 8.0% (0.0% change). View more on Code Climate. |
Okay, I've found @heytitle , @dodadoa , please check the result again. Thanks |
Umm, thank you for your contribution krub. However, this approach is not robust a krub since all translation and scale are hard coded, which is subjected to I was working on a method that computes bounds from all the zones in each region and compute that back to I would put this one on hold kon na krub. Please do not merge yet. |
According to #222, I try to solve this issue by zooming to the selected region.
In this PR, when user use to filter by region,
ElectionMapContainer
component will check whether thezoom
attribute exists in the filter or not. If it exists, it'll pass toElectionMap
via component data nameregionZoom
.In
render
ofElectionMap
,regionZoom
object is not empty, the map will be zoomed using D3Zoom'sscaleTo
andtranslateTo
method.resetZoom
to clear the map to inital zoom state.You can see the example in the screenshot below:
I develop and test using Google Chrome Desktop with the screen resolution at WXGA (1440x900). So, I'm not sure will it has any impact with the mobile-based browser?
If you have any suggestion, please reply to the message. I'm glad to help and make it better.
Regards,