Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G g1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 68
    • Issues 68
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cto
  • g1
  • Issues
  • #118

Closed
Open
Created Dec 12, 2018 by Bhanu K@bhanu.k🤺Maintainer

Mapviewer's buildlayer doesn't support tooltip

Summary

tooltip enabled and applied via buildLayer doesn't apply

Steps to reproduce

  • use g1.mapviewer and create a map via buildLayer -- map.buildLayer('layername', layer_opts) where map is a g1.mapviewer() object and layer_opts are layer options
  • one of the attributes in layer_opts is tooltip: function(d) { return d.value; }

What is the current bug behavior?

Tooltip doesn't show up

Possible fixes

In src/mapviewer.js, do the below:

case 'topojson':
case 'geojson':
if() {
  ...
  self.renderTooltip(layerName, layerConfig)
  ...
} else {
  ...
  self.renderTooltip(layerName, layerConfig)
  ...
}

with this a developer can define

    tooltip: function(d) {
      // console.log(d)
      return d[_map_data['metric']] !== undefined ? d[_map_data['metric']].toString() : d[_map_data['metric']];
    },
    tooltipOptions: {
      direction: function (args) {
        return args.centerPoint[1] > args.tooltipPoint.x[1] ? 'top' : 'bottom'
      },
      sticky: true
    },

note that tooltipOptions is optional

Edited Dec 12, 2018 by Bhanu K
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking