2

I am using the code below to add a search bar to my mapping application, is there a way to include an autocomplete search bar? Something that would provide suggestions based on what the user is typing?

//add search bar to map     
var v = cdb.vis.Overlay.create('search', map.viz, {})
v.show();
$('#map').append(v.render().el);
$('.cartodb-searchbox').find('input.text').attr('placeholder', 'Enter Location...');

I would like to use something that does not point back to my datasets but points to something like google's geocoder, bing, etc.

2

Yes, I've just made this example: http://bl.ocks.org/juanignaciosl/7b6f75a4edf875f8a778 (by joining http://bl.ocks.org/javisantana/7932459 with http://bl.ocks.org/javisantana/befa66fc9327f6c2908e).

  • is there a way to not rely on your own data - i.e. use something like google geocoder? – SiennaAvrilPearl Mar 9 '15 at 21:00
0

You can find an example of incorporating an autocomplete google geocoder based search bar in a cartodb viz here.

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.