0

I've created a map on the CartoDB site and now wish to add some interactivity using CartoDB.js.

I'd like the interactive map to have the same basemap as on the CartoDB site, Nokia Hybrid Day.

The createVis method automatically loads the CartoDB basemap. But I need to use the createLayer method, which does not.

Could you please tell me how I can load the basemap I'm using on the CartoDB site for use with the createLayer method?

2 Answers 2

1

I've got the same problem. I resolved it add a googlemap Layer to my map and not nokia map.

var map // create google maps map var mapOptions = { zoom: 15, center: new google.maps.LatLng(43.44, 11.9), mapTypeId: google.maps.MapTypeId.HYBRID

      };

      map = new google.maps.Map(document.getElementById('map'),  mapOptions);

    var sublayers;

    // Add other data layer to your map..........
1
  • Thank you for your suggestion. Could you please provide the code you use to add the CartoDB layers to a Google map object. The code I'm using cartodb.createLayer(map, vizjson).addTo(map) works with a Leaflet object, but is throwing an error when given a Google object.
    – Bill
    Commented May 16, 2015 at 2:29
0

Check on this website on examples of layers to add to leaflet. Searching HERE you'll find different basemaps that you can add to your blank leaflet map and after that, call createLayer.

Remember that in order to use HERE basemaps you need to register as a developer and get an app-id and app_code.

Additionally, you can also use the leaflet-providers plugin to instantiate those basemaps more easily.

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.