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

Color of Clicked from Legend Map reset when Mouse-hovered #409

Open
cnscniel15 opened this issue Oct 23, 2019 · 0 comments
Open

Color of Clicked from Legend Map reset when Mouse-hovered #409

cnscniel15 opened this issue Oct 23, 2019 · 0 comments

Comments

@cnscniel15
Copy link

cnscniel15 commented Oct 23, 2019

Description

Upon running the web, the default opacity of the whole map is 0.6
here's the code
From html code:
map: {
name: "france_departments",
defaultArea: {
attrs: {
stroke: "#fff",
"stroke-width": 1,
opacity: 0.6
},
attrsHover: {
"stroke-width": 2,
opacity: 1 }}},
from js code:
hideElemsOnClick: {
enabled: true,
opacity: 1,
animDuration: 300
},
I had done this because i want the opposite feature of Mapael,
instead of fade-out color when I click a legend, i want to highlight it [by making the opacity to 1].
Also in hover, instead of fading-out, i want them to highlight when hover.
Thus the code above.
Here's the example https://jsfiddle.net/cnscniel15/fnc9sy2p/

Expected Behavior

Upon trying to do the opposite feature of Mapael. I am expecting them to highlight the map when I clicked the legend [the color will be shown 100%] or when I hover each map (slice), they will highlight [Orange color highlight] too. I am expecting also that when I hover the clicked legend map, the highlight color will be shown. Then when I remove the mouse, they will return to their own color status before I hover it

Current Behavior

All from the expected behavior worked but one. While I hover the clicked legend map, the highlight will be shown but after hover, the color of the clicked legend map return to its original opacity 0.6 instead to its clicked status [opacity 1].
I need your expertise/guide on this so that when I hover the clicked legend map, instead of returning to its original opacity [0.6 when they are not click on the legend], it will return to its clicked status color of the map [opacity 1]. Thanks a lot!

Environment

  • Mapael version: 2.2.0
  • Raphael version: 2.2.7
  • Browser Name and version: Google Chrome version 78.0.3904.70
  • Operating System and version (desktop or mobile): Windows 10 Pro version 1903
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant