Skip to main content
Added a sample feature.
Source Link

I've imported a GeoJSON layer into TileMill and am having trouble styling based on the properties in the features. The features' properties objects have objects nested within them, and I haven't found any examples of using nested properties in selectors. I have tried something like the following:

#geojsonlayer[submissions#geojsonlayer[submission_sets.comments.count=0]length=1] {
  marker-width:1;2;
  marker-fill:#f45;
  marker-line-color:#f45;
  marker-allow-overlap:true;
  marker-ignore-placement:true;
}

But I get a "missing closing ] of filter" error. Is this construction valid? Is there some other valid construction that allows me to do something similar?

Edit:

For reference, here's a sample feature that I'm trying to style:

{
   "type":"Feature",
   "id":166995,
   "geometry":{
      "coordinates":[-75.1694440842,39.9707152354],
      "type":"Point"
   },
   "properties":{
      "description":"...",
      "updated_datetime":"2014-03-28T01:31:29.492896+00:00",
      "visible":true,
      "created_datetime":"2014-03-07T17:10:00+00:00",
      "attachments":[],
      "url":"http://data.shareabouts.org/api/v2/mjumbewu/datasets/philly-bike-share/places/166995",
      "_imported_id":1402,
      "id":166995,
      "submission_sets":{
         "comments":{
            "length":1
         }
      },
      "name":"20th and Ogden Street",
      "dataset":223
   }
}

(from http://data.shareabouts.org/api/v2/mjumbewu/datasets/philly-bike-share/places?format=json&page=5)

I've imported a GeoJSON layer into TileMill and am having trouble styling based on the properties in the features. The features' properties objects have objects nested within them, and I haven't found any examples of using nested properties in selectors. I have tried something like the following:

#geojsonlayer[submissions.comments.count=0] {
  marker-width:1;
  marker-fill:#f45;
  marker-line-color:#f45;
  marker-allow-overlap:true;
  marker-ignore-placement:true;
}

But I get a "missing closing ] of filter" error. Is this construction valid? Is there some other valid construction that allows me to do something similar?

I've imported a GeoJSON layer into TileMill and am having trouble styling based on the properties in the features. The features' properties objects have objects nested within them, and I haven't found any examples of using nested properties in selectors. I have tried something like the following:

#geojsonlayer[submission_sets.comments.length=1] {
  marker-width:2;
  marker-fill:#f45;
  marker-line-color:#f45;
  marker-allow-overlap:true;
  marker-ignore-placement:true;
}

But I get a "missing closing ] of filter" error. Is this construction valid? Is there some other valid construction that allows me to do something similar?

Edit:

For reference, here's a sample feature that I'm trying to style:

{
   "type":"Feature",
   "id":166995,
   "geometry":{
      "coordinates":[-75.1694440842,39.9707152354],
      "type":"Point"
   },
   "properties":{
      "description":"...",
      "updated_datetime":"2014-03-28T01:31:29.492896+00:00",
      "visible":true,
      "created_datetime":"2014-03-07T17:10:00+00:00",
      "attachments":[],
      "url":"http://data.shareabouts.org/api/v2/mjumbewu/datasets/philly-bike-share/places/166995",
      "_imported_id":1402,
      "id":166995,
      "submission_sets":{
         "comments":{
            "length":1
         }
      },
      "name":"20th and Ogden Street",
      "dataset":223
   }
}

(from http://data.shareabouts.org/api/v2/mjumbewu/datasets/philly-bike-share/places?format=json&page=5)

Source Link

Can you use nested properties to style features in CartoCSS

I've imported a GeoJSON layer into TileMill and am having trouble styling based on the properties in the features. The features' properties objects have objects nested within them, and I haven't found any examples of using nested properties in selectors. I have tried something like the following:

#geojsonlayer[submissions.comments.count=0] {
  marker-width:1;
  marker-fill:#f45;
  marker-line-color:#f45;
  marker-allow-overlap:true;
  marker-ignore-placement:true;
}

But I get a "missing closing ] of filter" error. Is this construction valid? Is there some other valid construction that allows me to do something similar?