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

[R20-1745] Added title attribute when hovering over map pins #1043

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/ripple-ui-maps/src/components/map/RplMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,18 @@
const point = getfeaturesAtMapPixel(map, evt.pixel)
if (point && point.features) {
document.querySelector('.rpl-map canvas').style.cursor = 'pointer'

// if there is only one feature, set the title attribute to the feature title
if (point.features.length === 1) {
document
.querySelector('.rpl-map canvas')
.setAttribute('title', point.features[0].getProperties().title)
}
} else {
document.querySelector('.rpl-map canvas').style.cursor = 'default'

// clear the title attribute
document.querySelector('.rpl-map canvas').setAttribute('title', '')
}
}
}
Expand Down Expand Up @@ -231,7 +241,7 @@
<div
v-if="noresults && !hideNoResults"
class="rpl-map__noresults"
ref="noResultsRef"

Check warning on line 244 in packages/ripple-ui-maps/src/components/map/RplMap.vue

View workflow job for this annotation

GitHub Actions / Test

Attribute "ref" should go before "class"
>
<button
title="dismiss no results message"
Expand Down
Loading