I just published a very large parcel dataset on CartoDB. Another website would like to link their parcel dataset to ours. Meaning, if you click on a parcel on their site and want to know more information about that parcel that's published on our site, they can link directly to the individual parcel. That info is shown in a CartoDB info window on our site.

Is there a way to link directly to that individual pop-up -- perhaps in the URL?


I don't know about linking to info-windows, but you can use an SQL statement that retrieves attributes from your table to write them to HTML in some off-map location on your site or the other site. If you give each parcel list item "id='[cartodb_id]'", it might look something like:

var sql = cartodb.SQL({ user: 'username' });
    $('.cartodb_id').on('click', function () {
        sql.execute("select cartodb_id, parcel, description from table_name where cartodb_id = " + $(this).attr('id'), function (data) {  
         var list = data.rows[0];
         var parcel = list.parcel;
         var description = list.description;
         $('#div').append('<h1>'+ parcel + '</h1><h2>' + description + '</h2>');

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.