Skip to content

Instantly share code, notes, and snippets.

@Xatpy
Xatpy / debug_cartodbjs.html
Created November 19, 2014 10:00
Debugging CartoDB.js development
<body onload="main()">
<div id="map"></div>
<script src="../src/cartodb.js"></script>
<script type="text/javascript">
function main() {
cdb.load('../src/', function() {
var vizjson_url = "http://development.localhost.lan:3000/api/v2/viz/fdc76b62-5cb7-11e3-928e-003ee1fffe8b/viz.json";
@Xatpy
Xatpy / index.html
Last active August 29, 2015 14:11
Show image while loading
<!DOCTYPE html>
<html>
<head>
<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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
/*position:absolute;*/
@Xatpy
Xatpy / index.html
Last active August 29, 2015 14:11
World flags
<!DOCTYPE html>
<html>
<head>
<title>World flags | 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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
@Xatpy
Xatpy / index.html
Last active August 29, 2015 14:11
Tooltips custom (max. population)
<!DOCTYPE html">
<html>
<head>
<title>
Tooltips | CartoDB
</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">
<style type="text/css">
@Xatpy
Xatpy / index.md
Last active August 29, 2015 14:13
[Tutorial] How to use Import API without guessing

How to use CartoDB Import API without guessing

Documentation URL

  1. Using MacOSX.

  2. Open your browser and log in your CartoDB account.

  3. Get your API key:

2a) Click on your "user-->Your API keys" option. (Up-right section)

@Xatpy
Xatpy / index.md
Last active August 29, 2015 14:13
NOTES developing CartoDB

Update submodule

While we're devoloping CartoDB, we've to update the CartoDB.js version that we're pointing. To do that:

git submodule update


rake db:migrate

Before updating, if there are errors like for example:

@Xatpy
Xatpy / index.html
Last active October 19, 2023 22:43
CartoDB basemaps list
<!DOCTYPE html>
<html>
<head>
<title>Basemaps | 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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, .map {
height: 200px;
@Xatpy
Xatpy / index.html
Last active August 29, 2015 14:13
Named maps - Layer selector
<!DOCTYPE html>
<html>
<head>
<title>Named Map with layer selectors | 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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
@Xatpy
Xatpy / index.html
Last active August 29, 2015 14:14
Poistron basemap HTTPS
<!DOCTYPE html>
<html>
<head>
<title>Positron HTTPS| 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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
@Xatpy
Xatpy / index.html
Last active August 29, 2015 14:14
Testing bug_ie_layerInteraction
<!DOCTYPE html>
<html>
<head>
<title>Bug IE | 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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;