-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: geo map component #1430
Conversation
6a483c7
to
b89acf3
Compare
b89acf3
to
fdfd140
Compare
8a13ca4
to
0622d24
Compare
efd54d2
to
4403e7e
Compare
4403e7e
to
1bf3821
Compare
packages/analytics/analytics-geo-map/src/components/AnalyticsGeoMap.vue
Outdated
Show resolved
Hide resolved
packages/analytics/analytics-geo-map/src/components/AnalyticsGeoMap.vue
Outdated
Show resolved
Hide resolved
packages/analytics/analytics-geo-map/src/components/AnalyticsGeoMap.vue
Outdated
Show resolved
Hide resolved
packages/analytics/analytics-geo-map/src/components/AnalyticsGeoMap.vue
Outdated
Show resolved
Hide resolved
packages/analytics/analytics-geo-map/src/components/AnalyticsGeoMap.vue
Outdated
Show resolved
Hide resolved
packages/analytics/analytics-geo-map/src/components/AnalyticsGeoMap.vue
Outdated
Show resolved
Hide resolved
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
There was a problem hiding this 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
Summary
https://konghq.atlassian.net/browse/MA-2941
Resources