0

How do I set no-world-wrap or pan limits to a CartoDB map? I have a world map displaying data and client is not keen on panning around the globe.

UncleJune
  • 45
  • 9

1 Answers1

0

This should do the trick:

cartodb.createVis('map', 'URL TO THE VIZ.json')
    .done(function(vis, layers) {
        layers[0].leafletMap.setMaxBounds([
          [40.712, -74.227], // lat long top left
          [40.774, -74.125]  // lat long bottom right
        ])
      }
);

https://github.com/Vizzuality/cartodb-leaflet