Skip to content

Instantly share code, notes, and snippets.

@ramiroaznar
Last active July 21, 2017 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ramiroaznar/ed6ccacbaf52290a146c82747fd2336b to your computer and use it in GitHub Desktop.
Save ramiroaznar/ed6ccacbaf52290a146c82747fd2336b to your computer and use it in GitHub Desktop.
How to use CARTO cdb_route_with_waypoints function
WITH ap AS (
SELECT
array_agg(the_geom) as arr
FROM
etapas
)
SELECT
(cdb_route_with_waypoints(arr, 'walk')).*
FROM
ap
/* Camino */
#layer_line{
line-color: #3EBCAE;
line-width: 1.5;
line-opacity: 1;
}
/* Lugares */
Map {
buffer-size: 2000;
}
#layer{
marker-fill-opacity: 1;
marker-line-color: #B40903;
marker-line-width: 1;
marker-line-opacity: 0;
marker-placement: point;
marker-type: ellipse;
marker-width: 3;
marker-fill: #F11810;
marker-allow-overlap: true;
}
#layer::point{
marker-fill-opacity: 0.5;
marker-line-color: #B40903;
marker-line-width: 1;
marker-line-opacity: 1;
marker-placement: point;
marker-type: ellipse;
marker-width: 20;
marker-fill: #F11810;
marker-allow-overlap: true;
}
#layer::labels {
text-name: [lugar];
text-face-name: "Open Sans Bold";
text-size: 12;
text-fill: #FFFFFF;
text-halo-fill: fadeout(#000000, 30%);
text-halo-radius: 2;
text-allow-overlap: true;
text-placement: point;
text-placement-type: simple;
text-dy: 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment