Skip to content

Stats Review: Add CountriesMapView (P7) - #24719

Closed
kean wants to merge 1 commit into
review/stats-utilitiesfrom
review/contry-map-view
Closed

Stats Review: Add CountriesMapView (P7)#24719
kean wants to merge 1 commit into
review/stats-utilitiesfrom
review/contry-map-view

Conversation

@kean

@kean kean commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

This PR adds CountriesMapView to show traffic on a map. It's a replacement for the previous map view based on FSInteractiveMap. 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 is WKWebView, 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.

Screenshot 2025-08-05 at 10 57 16 AM

@kean kean added this to the Pending milestone Aug 5, 2025
@kean kean added the Stats label Aug 5, 2025
@kean kean mentioned this pull request Aug 5, 2025
14 tasks
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@kean
kean force-pushed the review/contry-map-view branch from 7676155 to e46c581 Compare August 5, 2025 14:59
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2025

Copy link
Copy Markdown

svgContent: svgContent,
data: parameters.data,
style: resolvedStyle
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@kean kean closed this Aug 29, 2025
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