I'm using CartoDB and I can only get one option every to work cartodb_logo
. The rest seem to be ignored. Here's the relevant part of my code. What is wrong with this to cause title
and description
to be ignored (not on my map)?
var layerSource = {
user_name: 'myname',
type: 'cartodb',
sublayers: [{
sql: "SELECT * FROM mydata",
cartocss: "#mydata{marker-width: 10; marker-line-color: #FFF; marker-line-width: 0.5; marker-line-opacity: 1; marker-fill-opacity: 1.0; }"
}]
};
var options = {
https: true,
infowindow: true,
cartodb_logo: false, //this works fine
title: "testing title", //this isn't rendered on map
description: "testing description", //this isn't rendered on map
shareable: true, //no sharing buttons shown
legends: true //no legends either
};
var map_object = new L.Map('test_heat', {
center: [39.8282, -98.5795],
zoom: 5,
});
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>'
}).addTo(map_object);
cartodb.createLayer(map_object, layerSource, options)
.addTo(map_object)
.on('done', function(layer) {
cdb.vis.Vis.addInfowindow(map_object, layer.getSubLayer(0), options, ['cartodb_id', 'number_of_cases'], {
infowindowTemplate: $('#infowindow_template').html()
});
var sublayer = layer.getSubLayer(0);
sublayer.setInteraction(true);
sublayer.on('featureClick', function(e, latlng, pos, data) {
//alert("Hey! You clicked " + data.cartodb_id);
});
})
.done(function(data) {
});