Skip to content

Instantly share code, notes, and snippets.

View ramiroaznar's full-sized avatar

Ramiro Aznar ramiroaznar

View GitHub Profile
@ramiroaznar
ramiroaznar / index.html
Created September 26, 2017 08:25
CARTO.js | createLayer + close popup
<!DOCTYPE html>
<html>
<head>
<title>CARTO.js | createLayer + close popup</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="https://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>
@ramiroaznar
ramiroaznar / index.html
Created September 24, 2017 18:28
Get User Geolocation with CARTO.js
<!DOCTYPE html>
<html>
<head>
<title>Get User Geolocation with CARTO.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>
@ramiroaznar
ramiroaznar / index.html
Created September 20, 2017 12:53
invalidate + setInterval + CARTO.js
<!DOCTYPE html>
<html>
<head>
<title>invalidate + setInterval + CARTO.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="https://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>
@ramiroaznar
ramiroaznar / index.html
Last active August 31, 2017 15:24
Searchbox + Dropdown menu + Zoom + CARTO.js
<!DOCTYPE html>
<html>
<head>
<title>Searchbox + Dropdown menu + Zoom + CARTO.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="https://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>
@ramiroaznar
ramiroaznar / index.html
Created August 25, 2017 15:02
this keyword in CARTO.js
<!DOCTYPE html>
<html>
<head>
<title>this keyword in CARTO.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%;
@ramiroaznar
ramiroaznar / style.css
Created August 15, 2017 09:20
Markers as beacons with Torque
Map {
-torque-frame-count: 2;
-torque-animation-duration: 2;
-torque-time-attribute: "t";
-torque-aggregation-function: "count(1)";
-torque-resolution: 4;
-torque-data-aggregation: linear;
}
@ramiroaznar
ramiroaznar / query.sql
Created August 14, 2017 12:43
How to create a proportional symbol map with sqrt
select
*,
sqrt(pop_max)*50/5972.93897507751 as sqrt_pop
from
populated_places
where
pop_max > 0
order by pop_max desc
@ramiroaznar
ramiroaznar / README.md
Created August 14, 2017 09:17
How to style markers as fireflies in CARTO with CartoCSS
@ramiroaznar
ramiroaznar / README.md
Last active August 14, 2017 08:56
How to style lines as lightsabers in CARTO with CartoCSS
@ramiroaznar
ramiroaznar / index.html
Created August 2, 2017 10:41
UK Reverse geocoding with CARTO.js
<!DOCTYPE html>
<html>
<head>
<title>UK Reverse geocoding with CARTO.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="https://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>