Stats Review: Add CountriesMapView (P7) - #24719
Closed
kean wants to merge 1 commit into
Closed
Conversation
Collaborator
Generated by 🚫 Danger |
kean
force-pushed
the
review/contry-map-view
branch
from
August 5, 2025 14:59
7676155 to
e46c581
Compare
|
crazytonyli
reviewed
Aug 6, 2025
| svgContent: svgContent, | ||
| data: parameters.data, | ||
| style: resolvedStyle | ||
| ) |
Contributor
There was a problem hiding this comment.
You should be able to manipulate the SVG styles using JavaScript in the web view? Considering the SVG is already parsed as DOM, it might be more straightforward to do it in JavaScript, instead of searching and replacing strings in Swift.
Contributor
Author
There was a problem hiding this comment.
Yeah, it wouldn't been easier to use JS and selectors. I didn't think of that. I'm not going to redo it for the sake of it right now, but if it needs changes in the future, it would be good to refactor it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR adds
CountriesMapViewto show traffic on a map. It's a replacement for the previous map view based onFSInteractiveMap. The previous implementation had unacceptably slow performance. In a nutshell, it just takes the input map as an SVG file and renders SVG. The best component for doing it isWKWebView, which is what I used.I also added basic interaction where you can tap to see a tooltip. It works, but it has a couple of known issues: the tooltip doesn't dismiss automatically, the selection highlight appears only after the second tap. I thought it was still worth including this interaction despite the known issues.