Skip to content

Instantly share code, notes, and snippets.

View jsanz's full-sized avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@jsanz
jsanz / mbtiles_delete_zoom_level.sql
Created April 22, 2021 15:04 — forked from zhm/mbtiles_delete_zoom_level.sql
Delete zoom levels from an MBTiles file (set max zoom)
-- change 18 to whatever the max zoom level you want in your MBTiles
DELETE FROM images WHERE
tile_id IN (SELECT tile_id FROM map WHERE zoom_level > 18) AND
tile_id NOT IN (SELECT tile_id FROM map WHERE zoom_level <= 18);
DELETE FROM map WHERE zoom_level > 18;
UPDATE metadata SET value = '18' WHERE name = 'maxzoom';
@jsanz
jsanz / index.html
Last active August 14, 2018 15:02 — forked from padawannn/index.html
HaCkARTO.js · Javier Aragón submission
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CARTO.js App</title>
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Include Leaflet 1.2.0 Library -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<!-- Include cartodb.js Library -->
@jsanz
jsanz / app.css
Created August 14, 2018 14:38 — forked from jorgesancha/app.css
This file has been truncated, but you can view the full file.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
text-decoration: none;
color: #4285F4;
}
.map {
@jsanz
jsanz / README.md
Last active March 9, 2017 17:18
Debugging CARTO.js

Doesn't throw errors, nor does it enable the intended functionality. Question is not what's specifically wrong with this script, but how do we debug these requests that ping the CARTO server but don't seem to return errors.

@jsanz
jsanz / app.js
Last active November 6, 2017 10:08 — forked from rochoa/app.js
Basic CARTO viewer
'use strict';
var DEFAULTS = {
endpoint: 'http://jsanz.cartodb.com/api/v1/map',
sql: 'select * from ne_10m_populated_places_simple',
cartocss: [
"#layer['mapnik::geometry_type'=1] {",
" marker-width: 7;",
" marker-fill: #EE4D5A;",
" marker-fill-opacity: 0.9;",
@jsanz
jsanz / index.html
Last active April 3, 2016 12:09 — forked from ernesmb/index.html
Training: changing SQL query and CartoCSS
<!DOCTYPE html>
<html>
<head>
<title>Training | change SQL and CartoCSS | 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>
@jsanz
jsanz / index.html
Last active April 3, 2016 10:26 — forked from ernesmb/index.html
Training: Actions on feature click
<!DOCTYPE html>
<html>
<head>
<title>Training | 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>
<style>
@jsanz
jsanz / index.html
Last active June 22, 2017 13:48 — forked from ernesmb/index.html
Training: createLayer single LayerSourceObject
<!DOCTYPE html>
<html>
<head>
<title>Training | 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" />
<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>
@jsanz
jsanz / index.html
Last active April 3, 2016 12:10 — forked from ernesmb/index.html
Training: createVis()
<!DOCTYPE html>
<html>
<head>
<title>Training | createVis | 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 {
@jsanz
jsanz / README.md
Last active November 24, 2015 19:27 — forked from andy-esch/README.md
Elections webinar