Share via


PinOptions interface

The pin options for default/none image style..

Properties

labelAnchor

The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below). To override the label anchor, using the labelAnchor option and provide X and Y pixel coordinates for the anchor. These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down. For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use {labelAnchor: [10, -4]}

labelColor

Color of the label. Range from 000000 to FFFFFF

labelSizeInPixels

Size of the label in pixels.

opacity

The opacity of the pin. Range from 0 to 1

pinAnchor

By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight. To override the anchor location of the pin image, use the pinAnchor option. This uses the same format as the labelAnchor options. For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using {pinAnchor: [0, 0]}

pinColor

Color of the pin. Range from 000000 to FFFFFF

rotationInDegree

The ration of the pin. Range from -360 to 360

scale

The scale of the pin. Should be greater than 0.

Property Details

labelAnchor

The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below). To override the label anchor, using the labelAnchor option and provide X and Y pixel coordinates for the anchor. These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down. For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use {labelAnchor: [10, -4]}

labelAnchor?: [number, number]

Property Value

[number, number]

labelColor

Color of the label. Range from 000000 to FFFFFF

labelColor?: string

Property Value

string

labelSizeInPixels

Size of the label in pixels.

labelSizeInPixels?: number

Property Value

number

opacity

The opacity of the pin. Range from 0 to 1

opacity?: number

Property Value

number

pinAnchor

By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight. To override the anchor location of the pin image, use the pinAnchor option. This uses the same format as the labelAnchor options. For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using {pinAnchor: [0, 0]}

pinAnchor?: [number, number]

Property Value

[number, number]

pinColor

Color of the pin. Range from 000000 to FFFFFF

pinColor?: string

Property Value

string

rotationInDegree

The ration of the pin. Range from -360 to 360

rotationInDegree?: number

Property Value

number

scale

The scale of the pin. Should be greater than 0.

scale?: number

Property Value

number