#Carto-MapboxGL-Demo
##About
This is a simple example of consuming Mapnik Vector Tiles (MVT) from a Carto account in Mapbox GL.
Carto raster tiles follow a {z}/{x}/{y}.png
template, and the equivalent vector tile is available at the same template URL by using the file extension .mvt
The mvt template can be used to create a new vector tile source for your mapboxGL map.
The easiest way to get at them is to create a map in your Carto account and build a tile template URL based on the map's id. (This will only work for named maps, or maps that are public but based on private data. The process is slightly more complicated for anonymous maps , as you must first initialize the map before you can build the tile template URL)
So, the raster tile URL https://cwhong.carto.com/api/v1/map/named/tpl_36dba776_9746_11e6_9d0c_0e05a8b3e3d7/mapnik/0/0/0.png
has an equivalent vector tile url of https://cwhong.carto.com/api/v1/map/named/tpl_36dba776_9746_11e6_9d0c_0e05a8b3e3d7/mapnik/0/0/0.mvt
##Some Notes
It can help keep the size down if you only include attribute data that you plan on using for rendering or infowindows. At a bare minimum you need the_geom_webmercator
in the query for your map.
Carto MVT tiles appear to only work if the map has one layer.