v1.9.0
Add Functionality
Optional simplified style definition
- No need to separate styles into
paint
andlayout
properties - Properties names can be in camelCase instead of dash-case (eg.: fill-translate-anchor --> fillTranslateAnchor)
- Prefix type in style properties can be omitted (eg.: fill-color --> color)
- For symbols you still need the icon and text prefix
Normal style
style={{
type: 'circle',
paint: {
'circle-radius': ['*', ['get', 'mag'], 2],
'circle-color': [
'match',
['get', 'tsunami'],
0,
'#F00',
1,
'#03A',
'#CCC',
],
'circle-opacity': 0.5,
'circle-stroke-width': 0.25,
'circle-pitch-alignment': 'map',
},
layout: {
visibility: true
}
}}
Simplified Style
style={{
type: 'circle',
radius: ['*', ['get', 'mag'], 2],
color: ['match', ['get', 'tsunami'], 0, '#F00', 1, '#03A', '#CCC'],
opacity: 0.5,
strokeWidth: 0.25,
pitchAlignment: 'map',
visibility: true
}}
This should make it easier to save styles as JSON.