Small geography game using CARTO.js v4
Author:
- Jorge Sanz
- Dani Carrión
Improved version (post Hackarto.js) here
This file contains 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>Custom search example | CartoDB.js</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> |
As the new carto.js library does not provide a SQL API client, this small example shows how to use a requests library like axios to provide the same functionality with a very similar approach as the old cartodb.SQL
client.
Using getTile
core method from CartoDB.js 3.15 and Leaflet Retina detection to retrieve retina tiles from CARTO Maps API.
You can find more details here on how to get your retina urls. Mind that this only works for anonymous maps since getTiles
does not support named maps.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Get data from OSM using Overpass API and render it on a Mapbox GL map.
Simple instantiation of an OpenLayers map loading tiles from CARTO Maps API.