Tuesday, 25 August 2015

carto - Moving legend with CartoDB.js?


I'm wondering if it's possible to move the position of legend when using CartoDB.js.


I can see in the layer api I can turn it on or off, but ideally I'd like to be able to specify a div for it to be nested within. Is this possible?



Answer



As a workaround I've decided to just use jquery to shuffle the div from one spot to another using the following


$(".cartodb-legend-stack").detach().appendTo('#newDiv');

This seems to work reasonably well, obviously not ideal but a pretty good substitute.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...