Per my previous question - here - how do I get the legend to toggle (I have it turned off now) in conjunction with toggling the cartodb layer via the leaflet layer control? Maybe adding it as a variable some way?
var cdb_url = 'http://ift.tt/1wYrS4v';
cartodb.createLayer(map, cdb_url, {legends:false})
.addTo(map)
.on('done', function(crashes) {
crashes.setZIndex(2);
var overlayMaps = {
"Vehicle Crashes": crashes
};
L.control.layers(baseMaps, overlayMaps, {collapsed: false}).addTo(map);
})
.on('error', function(err) {
alert("some error occurred: " + err);
});
Aucun commentaire:
Enregistrer un commentaire