marker-fill: ramp([column_name], colorbrewer(Greens));
| |
v |
column to calculate ramp |
v
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var DEFAULTS = { | |
| endpoint: 'https://rochoa.carto.com', | |
| sql: 'select * from airbnb_madrid_oct_2015_listings', | |
| cartocss: `#layer['mapnik::geometry_type'=1] { | |
| marker-width: 7; | |
| marker-fill: #EE4D5A; | |
| marker-fill-opacity: 0.9; | |
| marker-line-color: #FFFFFF; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION public.CDB_Delayed_TableMetadata_Trigger() | |
| RETURNS trigger AS $$ | |
| DECLARE upd timestamp; | |
| BEGIN | |
| IF TG_RELID = 'cartodb.CDB_TableMetadata'::regclass::oid THEN | |
| RETURN NULL; | |
| END IF; | |
| SELECT updated_at INTO upd | |
| FROM cartodb.CDB_TableMetadata WHERE tabname = TG_RELID::regclass; | |
| IF upd IS NOT NULL AND (now() - upd) > '20m'::interval THEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Following code was extracted from almost-equal | |
| // (c) 2013 Mikola Lysenko. MIT License | |
| // MIT License (MIT) | |
| // See https://github.com/scijs/almost-equal/blob/93af191fe4075ee2dea94d29a26c796c26bb9cb6/almost_equal.js | |
| var PRECISION_FLOAT_EPSILON = 1.19209290e-7; | |
| var PRECISION_DOUBLE_EPSILON = 2.2204460492503131e-16; | |
| function almostEqual(a, b, absoluteError, relativeError) { | |
| absoluteError = absoluteError || PRECISION_DOUBLE_EPSILON; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>CartoDB: CartoCSS example – line-simplify</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%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>CartoDB: CartoCSS example – polygon-simplify</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%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>CartoDB: CartoCSS example – polygon-pattern-comp-op</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%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>CartoDB: CartoCSS example – background-color</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%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>CartoDB: CartoCSS example – background-image</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%; |
Check index.html for some examples. These use a beta feature of CartoDB's Maps API: fixed URLs. So there is no need to use cartodb.js and tiles can be consumed using a named map name.
Check cartodb.js.html to see the integration with cartodb.js and in particular with cartodb.core.js.