style.setNodeImage
setNodeImage(nodeId: string, url: string): Promise<void>Assign or clear a texture image URL for a single node.
Pass null to remove the image. Recorded in history as "SetNodeImage".
Does not emit "style:changed".
nodeId | string | Id of the node to modify. |
url | string | Absolute or relative URL of the image texture, or null to clear. |
Returns: Promise<void>
Example
await api.style.setNodeImage("s1", "https://example.com/avatar.png");
await api.style.setNodeImage("s1", null); // remove image