2

I know that it is possible to add the CartoDB search box when you link to a visualization such as this. However, I have a map which is created at runtime, using the same method as here. Does anybody know, when a visualization is created at runtime, if there is any way to add the CartoDB search box?

2

It is possible. Here is a working example,

http://bl.ocks.org/javisantana/befa66fc9327f6c2908e

The key bit is instantiating the overlay and then adding it to the page, you do that with this part,

var v = cdb.vis.Overlay.create('search', map.viz, {})
v.show();
$('#map').append(v.render().el);

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.