CartoDB / grainstore

Generate Mapnik MML & XML for single postgis tables with style persistance.
BSD 3-Clause "New" or "Revised" License
36 stars 27 forks source link

Layer ids and CartoCSS match suggestion #114

Open BHare1985 opened 8 years ago

BHare1985 commented 8 years ago

The test Uses correct layer name for interactivity layer defines two styles:

 var style0 = "#layer0 { marker-width:3; }";
 var style1 = "#layer1 { line-color:red; }";

which seem as if they are suppose to be the style for each layer, but instead after concatenatation layer0 gets both styles and layer1 gets nothing.

I understand that testing styles wasn't the intent of the test, but when layer name in the cartocss is only a placeholder you are forcing people to provide n style strings for n layers into grainstore, whereas most people typically write cartoCSS with one large file with multiple layers in it.

If that is the intent, then OK. It is just a bit confusing when I am use to the layer name in the cartoCSS refer to the layer id/name in my definition of layers. It would be nice to provide the functionality to filter a block of style to a layer if the layer id exists in cartoCSS, for example in the above if a layer in the ids array was layer0 it would then use only that section as its style.

jaakla commented 7 years ago

Related to https://github.com/CartoDB/Windshaft/pull/485 and https://github.com/CartoDB/Windshaft/issues/409 ?