I used to use a hack I found online to add a search box to a cartoDB map, which I created using cartodb.createLayer and it used to work, but now it stopped working, the search box does not appear (no error message). Is there another way to do it?

.on('done', function(layer) {
      //hack from https://gist.github.com/javisantana/4e50d53e4eeb7fbdab0e
      var v = cdb.vis.Overlay.create('search', map.viz, {})

Full code is here: https://github.com/childcaremap/NYCdaycare/blob/gh-pages/dev/scoremap.html


1 Answer 1


I found a related question on stackexchange (How do you add a search box to the map when creating a CartoDB visualization at runtime?) and the answer was that I have to add a line now:

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 and acknowledge you have read our privacy policy.

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