# Modules.Map.Polyline

Represents a bounded area on the map.

Availability
4.1.0
4.1.0
9.2.0

# Overview

The Polyline object gives you low-level control over polylines that can be added to a Modules.Map.View. A polyline must have its points property set to appear on a map.

Use the Modules.Map.createPolyline method to create a polyline.

# Example

var polyline = Map.createPolyline({
    points: [{
            latitude: -33.891614,
            longitude: 151.276417
        },
        [-33.87365, 151.20689]
    ],
    strokeWidth: 3,
    strokeColor: '#f00',
    zIndex: 1
});
mapView.addPolyline(polyline);

# Properties

# jointType CREATION ONLY

Availability
5.1.0
jointType :Number

Defines the shape of corner points.

Defines the shape of corner points. Can be one of the following shapes: POLYLINE_JOINT_DEFAULT, POLYLINE_JOINT_ROUND or POLYLINE_JOINT_BEVEL

Default: Modules.Map.POLYLINE_JOINT_DEFAULT


# pattern

Availability
6.2.0
6.2.0
9.2.0
pattern :Object

Pattern used to draw the polylines.

As per default polylines are drawn with a solid line. You can specify to draw them with a dashed line using POLYLINE_PATTERN_DASHED or with a dotted line using POLYLINE_PATTERN_DOTTED.

You can also specify the dimensions to use when you create a dashed or dotted polyline.

For a dashed polyline, you can do something like this:

polyline.setPattern({
    type: TiMap.POLYLINE_PATTERN_DASHED,
    gapLength: 25,
    dashLength: 50
});

or for a dotted polyline, you can do:

polyline.setPattern({
    type: TiMap.POLYLINE_PATTERN_DOTTED,
    gapLength: 25
});

# points CREATION ONLY

Availability
4.1.0
4.1.0
9.2.0
points :Array<MapPointType> | String

Array of map points making up the polyline. Can also be an array of longitude (index 0), latitude (index 1) touples. On Android platform you can use an encoded polyline as string.


# strokeColor

Availability
4.1.0
4.1.0
9.2.0
strokeColor :String

Color to use for the the polyline, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

Default: black


# strokeWidth

Availability
4.1.0
4.1.0
9.2.0
strokeWidth :Number

Line width in pixels to use when drawing the polyline.

Default: 10


# touchEnabled

Availability
6.2.0
6.2.0
9.2.0
touchEnabled :Boolean

Determines whether view should receive touch events.

Default: true


# zIndex CREATION ONLY

Availability
4.1.0
zIndex :Number

The order (depth) in which to display the polylines.

For iOS, the polylines are drawn in the order in which they are added.