jQuery - Display SQL Results
✓ Published0🌍 Public
Aandrewxhill
Last edited Jan 21, 2014
Created on Jan 21, 2014
A jQuery-based page displays the lengths of New York City subway lines by querying a CartoDB SQL API. It shows a bulleted list titled "Line name: length" with each subway line’s name and its length in kilometers, sorted descending by geometric length. The code uses `cartodb.SQL` to execute a SQL query that calculates `ST_Length` on the `nyc_subway_routes` geometry, converting it to kilometers and limiting results to 20 lines. jQuery’s `$()` and `.append` build the list items dynamically from the returned data rows.
AI-generated description