Core API Functionality
In case you are not using Leaflet, or you want to implement your own layer object, CARTO provides a way to get the tiles url for a layer definition.
If you want to use this functionality, you only need to load cartodb.core.js from our cdn. No CSS is needed:
Fetch the tile template for the layer definition.
|layerOptions||the data that defines the layer. It should contain at least
|callback(tilesUrl, error)||a function that recieves the tiles templates. In case of an error, the first param is null and the second one will be an object with an errors attribute that contains the list of errors.|
In this example, a layer with one sublayer is created. The sublayer renders all the content from a table.
tilesUrl object contains url template for tiles and interactivity grids: