addTexturedPolygon

addTexturedPolygon

Adds a textured polygon to the sphere using specified latitude and longitude point for center. This polygon does not face camera and can be placed with any rotation.

Parameter

  • A single un-named object with the following attributes. Several are optional:

    • id (number | string, optional): Unique id for the textured polygon. If none are provided it is auto generated by the viewer.

    • name (string, optional): Name for the textured polygon, similar to id but does not have to be unique. To be used in later features.

    • center({ lat: number, lng: number}): Latitude and longitude of the center of the polygon

    • opacity(number, optional): The opaque level value to use. 100 is fully opaque, 0 being invisible. Default: 100

    • hoverText(string, optional): Text displayed on hover if passed.

    • dimensions({ height: number, width: number}): Height and width to use for the polygon that will display the texture.

    • rotation({x: number, y: number, z: number}): rotation values of the textured polygon. 0,0,0 leaves it in its default rotation. Rotation degrees are applied around the axis specified. (EG: rotation on x axis while looking at 0,0 would rotate forward/backward.)

    • texture(string): url of the texture to be applied, is subject to cors for loading. Accepts jpeg, png, jpg svg

    • layer(string, optional): When passed, the textured polygon will be added to the named layer. Default: "default"

    • objectDisplayOrder(number, optional: Render order used to apply to all objects in the viewer. Only applied when AerialSphere class value viewerDisplayOrder is set to ‘objectDisplayOrder’. Larger numbers render on top.

Returns: Nothing

Throws: Errors in the console related to creation of texture polygon.

Code Sample