Small geography game using CARTO.js v4
Author:
- Jorge Sanz
- Dani Carrión
Improved version (post Hackarto.js) here
Small geography game using CARTO.js v4
Author:
Improved version (post Hackarto.js) here
with | |
-- dump the geometries | |
dumps as ( | |
select cartodb_id, | |
st_dumppoints(the_geom) as dp | |
from ne_50m_rivers_lake_centerlines | |
), | |
-- get the points | |
points as ( | |
select cartodb_id, |
Steps to create a synchronized table in CARTO that queries OSM for specific data.
[out:xml][timeout:25];
(
node["amenity"="school"]({{bbox}});
);
Text by Álvaro Arredondo
You can do it in the URL, but it's a little bit tricky. When you move the view in an embed, you'll see the URL changes. The thing is, that URL is encoded, but is actually showing a bounding box (NE and SW coordinates). This is the structure:
https://{{map_url}}/embed?state={"map":{"ne":[x, y],"sw":[x, y]}}
Let's take your URL:
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.
When you need to load a Torque layer along with other CARTO normal layers (Mapnik type) you need to call createLayer
twice and load them into the map in the correct order.
Example on how to aggregate data using spatial SQL and then show the also attributes on CARTO BUILDER infowindow.
Based on a sample dataset with images I will first reduce the geographical precission so they collide into a grid. After that using the json_agg
function we join the urls into a single field along with the counts.
WITH data as (
On this simple carto.js example we add a custom infowindow using Mustache and bind to its model an event when the change:visibility
property changes.
Open the console for the Hi!
and Bye!
messages when showing and closing an infowindow.