Skip to content

Commit

Permalink
Fix: #3 Convert hit area to circle
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhutchings committed Mar 16, 2023
1 parent 2cf5e92 commit 5f50e0c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/templates/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,19 @@ const symbol = (type) => {
})
}

// Increase the hit area of the marker by including a transparent
// circle that extends beyond the bounds of the marker.
// This may be useful, for example, to activate a tooltip on hover.
const hitArea = $.circle({
class: "touch",
r: 150,
})

return $.symbol({
class: "symbol shown",
id: `symbol-${type}`,
viewBox: "0 0 100 100",
})([
$.rect({
class: "touch",
x: -150,
y: -150,
width: 300,
height: 300,
}),
symbol,
])
})([hitArea, symbol])
}

export default (data) => {
Expand Down

0 comments on commit 5f50e0c

Please sign in to comment.