Skip to content

Instantly share code, notes, and snippets.



Created Mar 4, 2015
What would you like to do?
Blocking panning with createVis
<!DOCTYPE html>
<title>Easy example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="" />
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
<link rel="stylesheet" href="" />
<div id="map"></div>
<!-- include cartodb.js library -->
<script src=""></script>
function main() {
cartodb.createVis('map', '')
.done(function(vis, layers) {
// you can get the native map to work with it
var map = vis.getNativeMap();
// now, perform any operations you need
// map.setZoom(3);
// map.panTo([50.5, 30.5]);
.error(function(err) {
window.onload = main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.