Skip to content

Instantly share code, notes, and snippets.

Javier de la Torre jatorre

Block or report user

Report or block jatorre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>OpenLayers – Vector tiles – Points aggregation | CARTO</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>
<script src="https://openlayers.org/en/v4.6.4/examples/resources/mapbox-streets-v6-style.js"></script>
<style>
@jatorre
jatorre / README.md
Last active Jan 11, 2018
Example Mapbox + CARTO map using Vector Tiles
View README.md

Example Usage of CARTO Vector Tiles with MapboxGL

This example showcase how to simply use the new capabilities of CARTO for producing Mapbox Vector Tiles from its Maps API.

@jatorre
jatorre / carto-basemap.json
Last active Jun 8, 2017
Testing CARTO Vector Tiles
View carto-basemap.json
{
"tiles": ["https://cartobase-a.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef",
"https://cartobase-b.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef",
"https://cartobase-c.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef",
"https://cartobase-d.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef"],
"name": "CARTO Map Tiles",
"format": "pbf",
"basename": "v3.5.mbtiles",
"id": "openmaptiles",
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.css">
<link rel="stylesheet" href="https://erasermap.com/css/main.css">
</head>
<body>
View gist:ffc8dbae34d91f589ee6
/** torque visualization */
Map {
-torque-frame-count:107;
-torque-animation-duration:7;
-torque-time-attribute:"time";
-torque-aggregation-function:"avg(value)";
-torque-resolution:2;
-torque-data-aggregation:linear;
}
View url.txt
SELECT *, 'http://maps.googleapis.com/maps/api/streetview?size=300x190&location='||urlencode (address)||'&sensor=false&fov=110' as image_with_address
FROM example_addresses
@jatorre
jatorre / gist:1377437b4b80e0ab11f8
Created Dec 28, 2014
Embed this interactive visualization
View gist:1377437b4b80e0ab11f8
<iframe width='100%' height='520' frameborder='0' src='http://osm2.cartodb.com/viz/9f8764fa-8eaf-11e4-ae69-0e9d821ea90d/embed_map' allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--Edit the title of the page-->
<title>CartoDB Point Clustering</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />
View gist:ff39d8e195fb286992ef
http://osmbuildings.cartodb.com/api/v2/sql?format=geojson&dp=6&q=SELECT%20cartodb_id%2CST_Intersection(CASE%20WHEN%20ST_Dimension(ST_Snap(ST_CollectionExtract(ST_SnapToGrid(ST_CollectionExtract(ST_Simplify(%22the_geom%22%2C%200.03055572509765625)%2C%20ST_Dimension(%22the_geom%22)%20%2B%201)%2C%200.0611114501953125)%2C%20ST_Dimension(%22the_geom%22)%20%2B%201)%2C%20ST_SnapToGrid(ST_Expand(ST_MakeEnvelope(-35.947265625%2C19.89072302399691%2C-20.302734375%2C33.797408767572485%2C%204326)%2C%207.3333740234375)%2C0.0611114501953125)%2C%200.0611114501953125))%20%3D%200%20OR%20GeometryType(ST_Snap(ST_CollectionExtract(ST_SnapToGrid(ST_CollectionExtract(ST_Simplify(%22the_geom%22%2C%200.03055572509765625)%2C%20ST_Dimension(%22the_geom%22)%20%2B%201)%2C%200.0611114501953125)%2C%20ST_Dimension(%22the_geom%22)%20%2B%201)%2C%20ST_SnapToGrid(ST_Expand(ST_MakeEnvelope(-35.947265625%2C19.89072302399691%2C-20.302734375%2C33.797408767572485%2C%204326)%2C%207.3333740234375)%2C0.0611114501953125)%2C%200.0611114501953125))%20%3D%
View gist:f2d5801a7365dc4ab364
https://stagingfonmaps.cartodb.com/api/v2/sql?q=SELECT%20external_id,%20ST_Y(the_geom)%20AS%20lat,%20ST_X(the_geom)%20AS%20lon,%20network_id,%20category_NAME,%20status,%20hotspots,%20metadata%20FROM%20pois%20WHERE%20the_geom%20%26%26%20ST_MakeEnvelope(0,%200,%20180,%2090,%204326)
You can’t perform that action at this time.