Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何为 CartoDB 地图设置 no-world-wrap 或 pan 限制?我有一张显示数据的世界地图,而客户并不热衷于在全球范围内平移。
这应该可以解决问题:
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