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

Add support for default tooltip option & tooltip functions #347

Closed
techfg opened this issue Jan 23, 2021 · 0 comments · Fixed by #350
Closed

Add support for default tooltip option & tooltip functions #347

techfg opened this issue Jan 23, 2021 · 0 comments · Fixed by #350

Comments

@techfg
Copy link
Collaborator

techfg commented Jan 23, 2021

Is your feature request related to a problem and/or adding functionality? Please describe.
Currently, in order to trigger a tooltip, an area configuration must be supplied based on the mapKey and the tooltip only supports text and jQuery values. Having to specify an area config just to display a tooltip can be extremely cumbersome especially in larger maps.

Describe the solution you'd like
Add the following features:

  1. Support the ability to have the value for a toolTip be a function in addition to the current text & jQuery options
  2. Add a toolTip property to the standard mapster options in order to have a single option drive all toolTips
('img').mapster({
    ....
    toolTip: function(data) {
        // default applies to any area that is not explicitly specify its own toolTip
        return $(data.target).data('firstname');
    },
    areas: [
        {
            key: 'george',
            // george has a customized tooltip
            toolTip: $('<div/>').text('A tooltip for George')
        }        
    ]
});

Describe alternatives you've considered
N/A

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant