buğra coşkun
buğra coşkun

Reputation: 73

How to do get value from custom geojson prop without properties for paint expression in Mapbox

I want to change features style according to in features style property. But style is not in properties. A sample feature is like that,

{
   type:"feature",
   style:{polygon:{"line-color":"#FF0000"}},
   properties:{...},
  geometry:{...}
}

So, according to documents 'get' expression does not work. Because, it looks for property section Document Mapbox Expressions.

I was wondering, are there any method to get information from style section in the features?

Upvotes: 0

Views: 524

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126747

No, in a style, there is no way to access any part of an object other than in the properties section. (The one exception to this is the id property).

You will need to process your data differently.

Upvotes: 1

Related Questions