I am updating an old demo that used the first versions of Cartodb so that is runs with the latest version of cartodb.js.
I am trying to overlay a set of points on the base map and getting the following error:
TypeError: layer should be provided cartodb.createLayer(b=Object { map_canvas="map_canvas", map="map", user_name="tobagoborn", more...}, d=undefined, e=undefined, f=undefined)cartodb.js (line 23) initialize()lndngsites1.html (line 56) onload(event=load )
Here is my code:
<script type="text/javascript">
function initialize()
{
var map = new L.Map('map_canvas',
{
doubleClickZoom:true,zoomControl:true,scrollWheelZoom: false,touchZoom: false,dragging: true, minZoom: 11, maxZoom: 13
}).setView(new L.LatLng(11.23, -60.70), 6);
var tilesUrl = 'http://tobagoborn.com/tiles/tobagobasemap/{z}/{x}/{y}.png';
L.tileLayer(tilesUrl, {attribution: "Cartodb", maxZoom: 13}).addTo(map);
//alert(cartodb.VERSION)
cartodb_leaflet1 = cartodb.createLayer(
{
map_canvas: 'map_canvas',
map: 'map',
user_name:"tobagoborn",
type: cartodb,
sublayers: [{
table_name: 'lsites',
query: "SELECT * FROM {{table_name}}",
interactivity: "landing_sites,number_of_boats,top_species,site_code"
}]
}).addTo(map_canvas)
}
</script>