gi-nx / getMapStyle
ts
function getMapStyle(): StyleSpecification;Get the current Mapbox style object.
Returns
StyleSpecification
The Mapbox style object
See
https://docs.mapbox.com/mapbox-gl-js/api/map/#map#getstyle
Example
typescript
const style = await rpc.invoke("getMapStyle", []);
console.log("Sources:", Object.keys(style.sources));
console.log("Layers:", style.layers.map(l => l.id));