img-mapper / react-img-mapper

React Component to highlight interactive zones in images
https://img-mapper.github.io/react-docs
MIT License
122 stars 39 forks source link

Is there a way to have pointer over highlited area? #57

Closed gmunumel closed 1 year ago

gmunumel commented 1 year ago

Hello,

Thanks for the library.

I want to know if it's possible to have pointer cursor over highlighted area? I'd like to have as CSS, like this:

<ImageMapper
      src={url}
      map={map}
      width={180}
      height={561}
      style={{ cursor: 'pointer' }}
    />
NishargShah commented 1 year ago

Hello @gmunumel

You can apply cursor css on img-mapper-map and it will apply to the whole image and for the highlighted area you can use img-mapper-area-highlighted.

For that please upgrade to v1.4.1

Demo: https://codesandbox.io/s/trusting-wright-htxxbg?file=/src/App.js

NishargShah commented 1 year ago

Feel free to reopen, if you have any doubts.

bmakan commented 1 year ago

This didn't work for me. What worked was adding styles for map element.

.container map {
    cursor: 'pointer';
}

Now when I hover over mapped areas my cursor changes.