---
title: "StyleImageWebGLData | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Type Alias StyleImageWebGLData

What a [StyleImageInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/StyleImageInterface/) gives as its `data` when it renders itself with WebGL rather than handing over an array of pixels.

#### See[](#see)

[Animate an icon on the GPU.](https://maplibre.org/maplibre-gl-js/docs/examples/animate-an-icon-on-the-gpu/)

type StyleImageWebGLData \= {  
    [renderWithWebGL](#renderwithwebgl): (target: [StyleImageWebGLTarget](https://docs.maptiler.com/sdk-js/api-reference/types/StyleImageWebGLTarget/)) \=> void;  
}

##### Index

### Properties

[renderWithWebGL](#renderwithwebgl)

## Properties

### renderWithWebGL[](#renderwithwebgl)

renderWithWebGL: (target: [StyleImageWebGLTarget](https://docs.maptiler.com/sdk-js/api-reference/types/StyleImageWebGLTarget/)) \=> void

Render exactly `width` x `height` premultiplied-alpha pixels at (`x`, `y`) of `target.texture`. That rectangle is the only part of the shared atlas that belongs to this image; drawing outside it corrupts the others.

This is the image's counterpart to [CustomLayerInterface.render](https://docs.maptiler.com/sdk-js/api-reference/interfaces/CustomLayerInterface/#render), and the context arrives in the same state a custom layer's is given: cull face, active texture and the pixel store settings at their WebGL defaults, and no vertex array bound. Everything is yours to change, and MapLibre restores its own state afterwards. The scissor test is the one exception: MapLibre leaves it disabled rather than restoring it, so an image that enables it has to disable it again.

Called before the first frame the image is used in, again whenever [StyleImageInterface.render](https://docs.maptiler.com/sdk-js/api-reference/interfaces/StyleImageInterface/#render) returns `true`, and again for each atlas holding a slot this image has never rendered into, so one change may mean several calls with different targets.
