There are multiple ways to fix your solution. As another answer here states, you may bind click events to the relevant element of your SVG graphics -- like an explicitly defined hitbox for the arrow, the entire arrow, the tip of it or whatever else.
Another solution, and I personally think it's the one you should be preferring -- because your SVG dimensions are seemingly arbitrary and do not make much sense considering it's just hardcoded and your arrow occupies just part of it. What you want is to correct your SVG document viewport through the use of the viewBox
attribute on your SVG elements.
The SVG specification covers it very well, but in short your problem is that your SVG has the dimensions of 100 x 100 pixels, while the arrow graphics it renders are much smaller. Remove width
and height
attributes from the root SVG element, add the viewBox
attribute instead with appropriate values for the viewport (sizing it to the bounding box of your arrow graphics), and use CSS to control rendered dimensions of your svg
elements on the map.
I have been researching and found some things to the topic but nothing was usable in my situation and often to hard for me to implement. I'd like to get a div to fade in when you begin to scroll on ...
I have been researching and found some things to the topic but nothing was usable in my situation and often to hard for me to implement. I'd like to get a div to fade in when you begin to scroll on ...
Let's assume I have a simple array const simpleArray = [1, 2, 3, 4, 5]; In case of, for example, I want to create a carousel and connect dots to click events in Vue or React. So clicking on a dot I ...
Let's assume I have a simple array const simpleArray = [1, 2, 3, 4, 5]; In case of, for example, I want to create a carousel and connect dots to click events in Vue or React. So clicking on a dot I ...
I have a Rails project where a newly added javascript file (plotly.min.js) is causing rake assets:precompile to hang indefinitely in production mode only. Since the problem is related to javascript ...
I have a Rails project where a newly added javascript file (plotly.min.js) is causing rake assets:precompile to hang indefinitely in production mode only. Since the problem is related to javascript ...
I have the following state. state = { friends: { nickNames: ['Polly', 'P', 'Pau'], ... here more k:v }, } } And I want to update nickNames array with a value coming from an ...
I have the following state. state = { friends: { nickNames: ['Polly', 'P', 'Pau'], ... here more k:v }, } } And I want to update nickNames array with a value coming from an ...