How do add custom layers to Bertin.js

I need to add a couple of extra layers to the map I’m creating using Bertin.js’s draw() method. Is there a way, or API, to add a custom layer?

One of my additional layer is a north arrow. If I can get access to selection, projection, width, and height properties which are passed internally to the layer drawing function, I can populate north arrow.

I saw @neocarto’s example of using Bertin.js within D3, where I manage projection and dimensions myself. In short, I need to re-write Bertin.js’s draw() function. :wink: Though it is powerful, I’ll lose out a lot of cool features provided by Bertin.js’s like it figures out the height and extents of the map.

1 Like

Grr… those R folks have us beat! :stuck_out_tongue:

Hope @neocarto has a solution!

1 Like

OK. I think I understand. I have no solution to this yet. But I’ll think about it. Could you open an issue on github ?

Thanks @neocarto. I have created an issue on GitHub.

1 Like

If any one looking for the answer @neocarto have added support for custom layers in the latest release of Bertin.js.