Skip to content

Instantly share code, notes, and snippets.

@ernesmb
Last active February 6, 2016 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ernesmb/eb484b19f26db188c371 to your computer and use it in GitHub Desktop.
Save ernesmb/eb484b19f26db188c371 to your computer and use it in GitHub Desktop.
Sphere Robinson vs. Web Mercator
<!DOCTYPE html>
<html>
<head>
<title>Title</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="http://cartodb.com/assets/favicon.ico" />
<link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script>
<style>
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function main() {
map = L.map('map', {
zoomControl: true,
center: [36,0],
zoom:2,
});
//add CartoDB code
cartodb.createLayer(map, {
user_name:'ernestomb',
type: 'cartodb',
sublayers:[{
sql:'SELECT ST_Transform(the_geom, 53030) AS the_geom_webmercator FROM world_table',
cartocss:'Map {background-color:#000;} #world_table{polygon-fill:#2C82C9;}'
},
{
sql:'SELECT the_geom_webmercator FROM world_table',
cartocss:'#world_table{polygon-fill:#666;polygon-opacity:0.2;line-width:0.5;line-color:#FFF;line-opacity:0.7}'}]
},{https:true}).addTo(map);
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment