CartoDB / cartodb

Location Intelligence & Data Visualization tool
http://carto.com
BSD 3-Clause "New" or "Revised" License
2.75k stars 652 forks source link

TurboCarto style with conditional styling fails #10652

Closed saleiva closed 7 years ago

saleiva commented 7 years ago

Context

When applying zoom conditionals to cartocss together with TurboCarto ramps it fails.

Steps to Reproduce

  1. Go to a map
  2. Style by value > any category column
  3. Go to the CartoCSS panel
  4. Change a property (it should work correctly).
  5. Now apply a zoom conditional such as
    
    marker-width: 0;
    marker-fill: #222;
    marker-fill-opacity: 1;
    marker-allow-overlap: true;
    marker-line-width: 0;
    marker-line-color: #FFF;
    marker-line-opacity: 1;
    }

layer[zoom>=13]{

marker-width: 1;

}

layer[zoom>=14]{

marker-width: 2.5;

}

layer[zoom>=15]{

marker-width: 5;

marker-fill: ramp([primary_type], (#5B3F95, #1D6996, #129C63, #73AF48, #EDAD08, #E17C05, #C94034, #BA0040, #8E1966, #6F3072, #DC1721), category(10)); }


### Current Result
It fails giving the following error 

crimes_2015: style0:3:2 Invalid code: marker-fill: ramp([primary_type], (#5B3F95 , #1D6996 , #129C63 , #73AF48 , #EDAD08 , #E17C05 , #C94034 , #BA0040 , #8E1966 , #6F3072 , #DC1721 ), category(10));


But without the conditional the same line works like a charm.

### Expected result
The style should work/

### Browser and version
Chrome

### .carto file
*Don't forget to rename .carto file to .zip file to be able to upload to github*

### Additional info
*Please add any information of interest here below*
saleiva commented 7 years ago

cc @javisantana @xavijam @rochoa

xavijam commented 7 years ago

Tested in production and for me it is working:

screen shot 2016-11-08 at 19 38 53
saleiva commented 7 years ago

try with a style with hex colors

xavijam commented 7 years ago
screen shot 2016-11-09 at 10 43 52
saleiva commented 7 years ago

but hey, the style on the map doesnt correspond to the one on the Cartocss panel, right? It´s not working

rochoa commented 7 years ago

Can you share a .carto?

screen shot 2016-11-10 at 13 01 57

screen shot 2016-11-10 at 13 02 00

screen shot 2016-11-10 at 13 02 03

saleiva commented 7 years ago

will send yo in slack. Its too heavy