### Batch Operations Source: https://github.com/netsyms/fixphrase.com/blob/master/js/maplibre-gl/CHANGELOG.md Example demonstrating how to perform multiple style operations at once for improved performance. ```javascript style.batch(function(s) { s.addLayer({ id: 'first', type: 'symbol', source: 'streets' }); s.addLayer({ id: 'second', type: 'symbol', source: 'streets' }); s.addLayer({ id: 'third', type: 'symbol', source: 'terrain' }); s.setPaintProperty('first', 'text-color', 'black'); s.setPaintProperty('first', 'text-halo-color', 'white'); }); ``` -------------------------------- ### In Expression Example Source: https://github.com/netsyms/fixphrase.com/blob/master/js/maplibre-gl/CHANGELOG.md Demonstrates the usage of the 'in' expression for checking value presence in an array or substring in a string. ```javascript ["in", value, array] ``` ```javascript ["in", substring, string] ``` -------------------------------- ### Example of 'within' expression Source: https://github.com/netsyms/fixphrase.com/blob/master/js/maplibre-gl/CHANGELOG.md Demonstrates how to use the 'within' expression to conditionally set icon opacity based on whether a feature is within a GeoJSON object. ```json "icon-opacity": ["case", ["==", ["within", "some-polygon"], true], 1, ["==", ["within", "some-polygon"], false], 0] ``` -------------------------------- ### Image Expression in Text Labels Source: https://github.com/netsyms/fixphrase.com/blob/master/js/maplibre-gl/CHANGELOG.md Example of using an 'image' expression within a 'format' expression to insert images into text labels. ```javascript "text-field": ["format", "Some text", ["image", "my-image"], "some more text"] ``` -------------------------------- ### Stop functions for data-driven styling Source: https://github.com/netsyms/fixphrase.com/blob/master/js/maplibre-gl/CHANGELOG.md An example of how stop functions were previously used for data-driven styling, setting circle colors based on a 'population' property. ```json "circle-color": { "property": "population", "stops": [ [0, "green"], [1000000, "red"] ] } ```