Skip to content

Both copy text to your clipboard — Build with AI copies a setup prompt to paste into Claude Code, Cursor, Codex or Copilot; Copy page as Markdown copies this page to paste into a chat. How it works

setWorkerCount()

setWorkerCount(count: number): void

Defined in: src/index.ts:112

Sets the number of web workers instantiated on a page with GL JS maps. By default, workerCount is 1 except for Safari browser where it is set to half the number of CPU cores (capped at 3). Make sure to set this property before creating any map instances for it to have effect.

Parameters

ParameterType
countnumber

Returns

void

Example

ts
setWorkerCount(2);