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: geo map component #1430

Merged
merged 20 commits into from
Jul 8, 2024
Merged

feat: geo map component #1430

merged 20 commits into from
Jul 8, 2024

Conversation

filipgutica
Copy link
Contributor

@filipgutica filipgutica commented Jun 4, 2024

@filipgutica filipgutica force-pushed the feat/geo-map-component branch 2 times, most recently from 6a483c7 to b89acf3 Compare June 5, 2024 06:29
@filipgutica filipgutica force-pushed the feat/geo-map-component branch from b89acf3 to fdfd140 Compare June 6, 2024 18:09
@filipgutica filipgutica force-pushed the feat/geo-map-component branch from 8a13ca4 to 0622d24 Compare June 18, 2024 05:57
@filipgutica filipgutica force-pushed the feat/geo-map-component branch from efd54d2 to 4403e7e Compare June 20, 2024 07:03
@filipgutica filipgutica force-pushed the feat/geo-map-component branch from 4403e7e to 1bf3821 Compare June 20, 2024 07:07
@filipgutica filipgutica marked this pull request as ready for review July 3, 2024 21:45
@filipgutica filipgutica requested review from kongponents-bot and a team as code owners July 3, 2024 21:45
const { ISO_A2, ADMIN } = feature.properties
const metric = props.countryMetrics[ISO_A2]
if (metric !== undefined) {
popup.setLngLat(e.lngLat).setHTML(`<strong>${ADMIN}</strong>: ${metric} ${props.metricUnit}`).addTo(map.value as Map)
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking, just a thought. Since setHTML doesn't sanitize, hoping we can create a custom plugin here like we did for ChartJS.

Copy link
Contributor Author

@filipgutica filipgutica Jul 4, 2024

Choose a reason for hiding this comment

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

non-blocking, just a thought. Since setHTML doesn't sanitize, hoping we can create a custom plugin here like we did for ChartJS.

This is maplibre's setHTML fn: https://maplibre.org/maplibre-gl-js/docs/API/classes/Popup/#sethtml

We can iterate on this. values templated into the html (metric and metricUnit) are well typed and validated, so for simplicity, we can just use maplibre's api for displaying a popup until we need something more "custom"

Copy link
Contributor

@mihai-peteu mihai-peteu left a comment

Choose a reason for hiding this comment

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

Non-blocking, just looks cleaner without the attribution

mihai-peteu
mihai-peteu previously approved these changes Jul 8, 2024
@filipgutica filipgutica merged commit 5fca70e into main Jul 8, 2024
33 checks passed
@filipgutica filipgutica deleted the feat/geo-map-component branch July 8, 2024 17:29
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

Successfully merging this pull request may close these issues.

3 participants