Skip to content

Instantly share code, notes, and snippets.

@lmullen lmullen/
Created Dec 16, 2014

What would you like to do?
Unzoomable d3-carto-map

Using d3-carto-map to create a map which cannot be zoomed or panned.

<!DOCTYPE html>
<title>D3-carto-map with Albers USA projection</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="style.css">
<body onload="makeMap();">
<div id="viz"></div>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src="visualization.js"></script>
#viz {
width: 100%;
height: 100%;
.city {
fill: none;
stroke: red;
stroke-width: 1px;
.land {
fill: lightgray;
stroke: black;
stroke-width: 1px;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function makeMap() {
var map =;"#viz").call(map);
usLayer = d3.carto.layer.topojson();
.centerOn([-98.5795,39.8282], "latlong")
d3.selectAll(".d3MapControlsBox").style("display", "none");
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.