question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic width and hover/click

See original GitHub issue

Hi, and thanks for this lib. I try to add interactivity on marker (click and mouse hover) but I have a problem, It doesn’t work when marker size is dynamic. Here is the Marker class :

class Marker extends Component {
    static propTypes = {
        lat: PropTypes.number,
        lng: PropTypes.number,
        text: PropTypes.string
    }
    render() {
        let {text, key} = this.props
        const {w, h} = meters2ScreenPixels(300, {lat: this.props.lat, lng: this.props.lng}, mapZoom);
        return (
            <div
                key={key}
                style={{
                    width: w,
                    height: h,
                    fontSize: w/2
                }}
                className="estima-marker">
                {text}
            </div>
        )
    }
}

I w and h are constant, the event onChildClick works, but if I use meters2ScreenPixels, it does not works. The hover zone is still here but not match to the marker overlay. How can I do that ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
JiDaicommented, Oct 19, 2016

Ok thanks for explanations and responsiveness 😃

0reactions
lock[bot]commented, Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - Less - Dynamic width of element on :hover and another ...
Now the question: I need the left side on css :hover event to get width: 30%, and right side accordingly: width: 70%.
Read more >
How hovering over a division element to gradually change the ...
You can use transition property in CSS to make some transition effect as changing the width of an element. The transition effect can...
Read more >
HTML CSS CSS Widget Hover - Java2s.com
Click the following links for the tutorial for CSS Widget and Hover. Make element fly in with mouse hover with dynamic width ·...
Read more >
Create a Hover Button in a React App | Pluralsight
We will see two methods of creating a hover button: using pure CSS and using ... App { 6 display: flex; 7} 8...
Read more >
Button | Webflow University
You can adjust the size of the button by changing its width and height in Style ... Now when you click back into...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found