4

All,

Back in December it seemed there was no way to bring in a CartoDB layer into a Mapbox.js or Tilemill project.

Has this changed?

(http://support.mapbox.com/discussions/mapbox-tiles/763-cartodb-and-mapboxjs-how-do-they-talk)

I'd like to implement this on a few local government projects I'll be working on shortly.

Thanks!

-mb

3

another example that may be useful:

...
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.uncompressed.js"></script>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.2.0/mapbox.standalone.js'></script>
...
function main() {
  var map = new L.Map('map', {
    zoomControl: false,
    center: [43, 0],
    zoom: 3
  });

  L.mapbox.tileLayer('examples.map-20v6611k').addTo(map)
  cartodb.createLayer(map, 'http://documentation.cartodb.com/api/v2/viz/2b13c956-e7c1-11e2-806b-5404a6a683d5/viz.json').addTo(map)
}

full example here: https://gist.github.com/javisantana/7200781

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 1
    You should always post the relevant content along with your link in case the link ever breaks or goes dead. – Evil Genius Dec 19 '13 at 15:58
  • Not necessary to -1, but agreed that more text would be great. – DPSSpatial Dec 19 '13 at 16:20
  • I edited to add the relevant code, thanks for the suggestion – javisantana Dec 20 '13 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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