0

How can I change the offset of the CartoDB tooltip from the cursor? When I add a
to the template content, the cursor overruns the tooltip and I would like to tweak the offset a bit so its 5,-5 pixels up and left of the cursor.

vis.addOverlay({
   layer: spillLayer,
   type: 'tooltip',
   template: '<p>{{type}} spill of <br>{{totvol}} gallons</p>'
});
1

Editing the CSS for the tooltip seems to do it.

.cartodb-tooltip p {
   margin-top: -10px !important;
   margin-left: -10px !important;
   }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.