Skip to content

Instantly share code, notes, and snippets.

@iriberri
iriberri / index.html
Created September 10, 2015 10:32
Basic store locator example
<!DOCTYPE html>
<html>
<head>
<title>Gmaps 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 {
height: 85%;
@iriberri
iriberri / index.html
Created September 9, 2015 15:23
Setting a different map zoom for small screens
<!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 {
height: 100%;
@iriberri
iriberri / index.html
Created September 8, 2015 12:58
Adding data to a layer from the map
<!DOCTYPE html>
<html>
<head>
<title>Change marker 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 {
height: 95%;
@iriberri
iriberri / index.html
Created September 8, 2015 10:13
Center map on clicked geometry and get its data
<!DOCTYPE html>
<html>
<head>
<title>Leaflet 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 {
height: 95%;
@iriberri
iriberri / index.html
Created September 7, 2015 09:16
Enable geolocation with CartoDB
<!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 {
height: 100%;
@iriberri
iriberri / index.html
Created September 4, 2015 09:42
Searchbox element with createLayer
<!DOCTYPE html>
<html>
<head>
<title>Searchbox| 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%;
@iriberri
iriberri / index.html
Created September 3, 2015 13:07
Creating a single layer with different datasets data
<!DOCTYPE html>
<html>
<head>
<title>Change marker 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 {
height: 100%;
@iriberri
iriberri / index.html
Created September 3, 2015 12:57
CartoCSS from SQL-retrieved data
<!DOCTYPE html>
<html>
<head>
<title>Change marker 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 {
height: 100%;
@iriberri
iriberri / import.py
Created September 3, 2015 11:11
Python script for uploading file to CartoDB
import requests
url='https://username.cartodb.com/api/v1/imports/?api_key=api_key'
files = {'file': ('report.zip', open('/Users/Iriberri/Downloads/report.zip', 'rb'), 'application/zip')}
r = requests.post(url, files=files)
@iriberri
iriberri / index.html
Created September 2, 2015 12:19
Filtering CartoDB data on Google Maps
<!DOCTYPE html>
<html>
<head>
<title>GMaps Satellite basemap | 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: 95%;