1

I am trying to apply the custom tooltip example from http://bl.ocks.org/xavijam/6efe7494eee798a0dbf5 to my map at https://afterfibre.nsrc.org/af_dev.html The code seems relatively straightforward:

      var aftTooltip = new cdb.geo.ui.Tooltip({
          layer: aftLayer,
          template: '<div class="cartodb-tooltip-content-wrapper"> <div class="rTable"><div class="rTableRow"><div class="rTableCell"><img src="/flag/{{iso2}}.png"></div><div class="rTableCellTitle"><h4 style="font-size: larger;"><a href="{{weburl}}" target="_blank">{{operator}}</a></h4></div></div></div></div>', 
          width: 200,
          position: 'bottom|right'
      });
      $('#cartodb-map').append(aftTooltip.render().el);

And yet the tooltips do not render and the console produces an error that says: "Uncaught Error: mapView should be present". I've googled for this error but not much comes up. Full code at https://github.com/stevesong/nsrc-afterfibre/blob/master/af_dev.html

1 Answer 1

3

This problem is due a bug in the latest versions of CartoDB.js (the 3.14 and 3.15). We are looking into it to solve the problem and to update those versions with the fix as soon as possible.

We have detected that for the versions 3.11, 3.12 and 3.13, the tooltip works and it doesn't show the error message "Uncaught Error: mapView should be present".

Here are the URLs of the CartoDB.js versions that work with the tooltip:

<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.11/cartodb.js"></script> 
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.12/cartodb.js"></script> 
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.13/cartodb.js"></script> 

Change the CartoDB.js version (3.15) of your file for one of the versions that works ( 3.11, 3.12 or 3.13).

The issue has been reported here: https://github.com/CartoDB/cartodb.js/issues/690

1
  • That worked! Once again awesome support from CartoDB. Thanks!
    – SteveSong
    Sep 24, 2015 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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