Hello I was trying to but together a quick and dirty bing/osm map using leaflet and leaflet plugin. My problem comes in when adding a layer from cartodb.The points do not show and I am not getting any errors, however when I change opacity on the tile where my points should be they show up. So it looks like the base maps are taking priority over my layer. Is there a way to fix this?

    function main() {
    var map = new L.Map('map', {
            center: new L.LatLng(39.095,-75.54),
            zoom: 2

    var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
    var bing = new L.BingLayer("AulNwbEkrE4P0VQrC8JI3SKoJDC4A9V63I8q4tixTNo6HUkfUyjWJuXSgpgysdZ5");
        map.addControl(new L.Control.Layers({'OSM':osm, "Bing":bing}, {}));
          cartodb.createLayer(map, 'http://centuryeng.cartodb.com/api/v2/viz/a7fd6eb2-f6ee-11e3-b807-0e73339ffa50/viz.json')
            .on('done', function (layer) {


    window.onload = main;

1 Answer 1


You need to set the desired basemap as: var basemap = L.Tilelayer (drop "new")... They're all being added as overlay layers as is

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.