Function diff
- diff(
before?: StyleSpecification,
after: StyleSpecification,
): DiffCommand<keyof DiffOperationsMap>[]Parameters
Optionalbefore: StyleSpecificationstylesheet to compare from
- after: StyleSpecification
stylesheet to compare to
Returns DiffCommand<keyof DiffOperationsMap>[]
Array list of changes
Was this helpful?
Diff two stylesheet
Creates semanticly aware diffs that can easily be applied at runtime. Operations produced by the diff closely resemble the maplibre-gl-js API. Any error creating the diff will fall back to the 'setStyle' operation.
Example diff: [ { command: 'setConstant', args: ['@water', '#0000FF'] }, { command: 'setPaintProperty', args: ['background', 'background-color', 'black'] } ]