# PinBuilder

#### new Cesium.PinBuilder()
engine/Source/Core/PinBuilder.js 21

A utility class for generating custom map pins as canvas elements.
Example pins generated using both the maki icon set, which ships with Cesium, and single character text.

##### Demo:

- Cesium Sandcastle PinBuilder Demo

### Methods

#### fromColor(color, size) → HTMLCanvasElement
engine/Source/Core/PinBuilder.js 32

Creates an empty pin of the specified color and size.

Name | Type | Description
--- | --- | ---
`color` | Color | The color of the pin.
`size` | number | The size of the pin, in pixels.

##### Returns:

The canvas element that represents the generated pin.

#### fromMakiIconId(id, color, size) → HTMLCanvasElement|Promise.<HTMLCanvasElement>
engine/Source/Core/PinBuilder.js 75

Creates a pin with the specified maki icon identifier, color, and size.

Name | Type | Description
--- | --- | ---
`id` | string | The id of the maki icon to be stamped onto the pin.
`color` | Color | The color of the pin.
`size` | number | The size of the pin, in pixels.

##### Returns:

The canvas element or a Promise to the canvas element that represents the generated pin.

#### fromText(text, color, size) → HTMLCanvasElement
engine/Source/Core/PinBuilder.js 105

Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible while still being contained completely within the pin.

Name | Type | Description
--- | --- | ---
`text` | string | The text to be stamped onto the pin.
`color` | Color | The color of the pin.
`size` | number | The size of the pin, in pixels.

##### Returns:

The canvas element that represents the generated pin.

#### fromUrl(url, color, size) → HTMLCanvasElement|Promise.<HTMLCanvasElement>
engine/Source/Core/PinBuilder.js 52

Creates a pin with the specified icon, color, and size.

Name | Type | Description
--- | --- | ---
`url` | Resource | string | The url of the image to be stamped onto the pin.
`color` | Color | The color of the pin.
`size` | number | The size of the pin, in pixels.

##### Returns:

The canvas element or a Promise to the canvas element that represents the generated pin.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.