How to use the tangram.cartodb.getSupportedCartoCSSResult function in tangram

To help you get started, we’ve selected a few tangram examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CartoDB / carto.js / src / geo / leaflet / leaflet-layer-view-factory.js View on Github external
var canLayerBeRenderedClientSide = function (layerModel) {
  var cartoCSS = layerModel.get('meta').cartocss;
  var result = TC.getSupportedCartoCSSResult(cartoCSS);
  if (!result.supported) {
    if (result.reason.indexOf('Unsupported CartoCSS') === 0) {
      log.info('[Vector] Unable to render due "' + result.reason + '". Full CartoCSS:\n' + cartoCSS);
    } else {
      log.error(new Error('[Vector] Unable to render due "' + result.reason + '". Full CartoCSS:\n' + cartoCSS));
    }
  }
  return result.supported;
};