I have a table in CartoDB containing some points. I want to render these points dynamically with Leaflet. There is cartodb.js for such tasks, but it does not support full customization of Tooltips, as I have seen. Instead I found a Leaflet-Plugin for that.
In my HTML I have the following JS-Code, but it does not work except showing the Base Map. What am I doing wrong? Are there other solutions for Leaflet?
var map = new L.Map('map').setView([51.0, 10.0], 6);
var defaultLayer = L.TileLayer.provider('MapQuestOpen.OSM');
map.addLayer(defaultLayer);
var baseLayers = {
"Mapquest OSM": defaultLayer,
"OpenStreetMap German Style": L.TileLayer.provider('OpenStreetMap.DE'),
};
// Use Leaflet Vector Layers plugin to show data from CartoDB
var cartodblayer = new lvector.CartoDB({
user: "user",
table: "example_data",
scaleRange: [6, 20],
symbology: {
vectorOptions: {
icon: new customIcon({
iconUrl: "/icon/icon.png"
})
}
},
popupTemplate: '<p>{homepage}</p>',
singlePopup: false
});
cartodblayer.setMap(map);
map.addControl(new L.Control.Layers(baseLayers, '', {collapsed: true}));