Skip to content

Instantly share code, notes, and snippets.

View ernesmb's full-sized avatar

Ernesto Martínez Becerra ernesmb

View GitHub Profile
@ernesmb
ernesmb / index.html
Created February 16, 2016 16:31
Hover Tooltip using createLayer()
<!DOCTYPE html>
<html>
<head>
<title>Tooltip on hover with createLayer() | 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="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<script src="http://libs.cartocdn.com/cartodb.js/v3/3.15/cartodb.js"></script>
@ernesmb
ernesmb / index.html
Last active March 22, 2016 10:14
GPS track with altimeter
<!DOCTYPE html>
<html>
<head>
<title>CartoDB with Chart.js altimeter | 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>
html, body, #map {
@ernesmb
ernesmb / index.html
Created January 27, 2016 16:21
CreateLayer() using HTTPS II
<!DOCTYPE html>
<html>
<head>
<title>CreateLayer() using HTTPS II | 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" />
<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>
@ernesmb
ernesmb / index.html
Last active January 27, 2016 16:31
createLayer() using HTTPS
<!DOCTYPE html>
<html>
<head>
<title>createLayer() with HTTPS | 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>
html, body, #map {
@ernesmb
ernesmb / index.html
Last active February 6, 2016 12:05
Static features appearing on Torque time
<html>
<head>
<title>Make points appear as Torque goes over them | 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>
html, body, #map {
height: 100%;
padding: 0;
@ernesmb
ernesmb / index.html
Last active February 6, 2016 12:08
Custom Torque Slider with createLayer()
<!DOCTYPE html>
<html>
<head>
<title>Custom Torque Slider with createLayer() | 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%;
@ernesmb
ernesmb / auth_calls.md
Last active October 23, 2017 19:27
Named Maps Test

Authenticated call to create a template

curl -X POST -H 'Content-Type: application/json' -d @template_test.json 'https://ernestomb.cartodb.com/api/v1/map/named?api_key=API_KEY'

Authenticated call to update a template

curl -X PUT -H 'Content-Type: application/json' -d @template_test.json 'https://ernestomb.cartodb.com/api/v1/map/named/template_test?api_key=API_KEY'
@ernesmb
ernesmb / index.html
Last active March 22, 2016 10:14
Aggregated content from clustered features II - Average Population
<!DOCTYPE html>
<html>
<head>
<title>Aggregated content from clustered features II - Average Population| 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>
html, body, #map {
@ernesmb
ernesmb / index.html
Last active February 6, 2016 12:15
Actions on Feature Click
<!DOCTYPE html>
<html>
<head>
<title>Actions on Feature Click | 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" />
<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>
@ernesmb
ernesmb / index.html
Last active February 6, 2016 12:21
ZoomInfo control w/ createLayer()
<!DOCTYPE html>
<html>
<head>
<title>Custom ZoomLevel Control w/ createLayer() | 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%;