function PolilinhaOpcoes() {
    this.clickable = true; // boolean Indicates whether this Polyline handles mouse events. Defaults to true.
    this.editable = false; // boolean If set to true, the user can edit this shape by dragging the control points
    //                                shown at the vertices and on each segment. Defaults to false.
    this.geodesic = false; // boolean When true, render each edge as a geodesic (a segment of a "great circle").
    //                                A geodesic is the shortest path between two points along the surface of the Earth.
    //                                When false, render each edge as a straight line on screen. Defaults to false.
    this.icons = [];        // Array.<IconSequence> The icons to be rendered along the polyline.
    this.map = {};          // Map Map on which to display Polyline.
    this.path = [];         // MVCArray.<LatLng>|Array.<LatLng> The ordered sequence of coordinates of the Polyline.
    //                                This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs.
    //                                Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing
    //                                LatLngs in the MVCArray will automatically update the polyline on the map.
    this.strokeColor = "";  // string The stroke color. All CSS3 colors are supported except for extended named colors.
    this.strokeOpacity = 0; // number The stroke opacity between 0.0 and 1.0.
    this.strokeWeight = 0;  // number The stroke width in pixels.
    this.visible = true;    // boolean Whether this polyline is visible on the map. Defaults to true.
    this.zIndex = 0;     // number The zIndex compared to other polys.
}

function PolilinhaHistorico(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#FF0000";
    this.strokeOpacity = 0.75;
    this.strokeWeight = 2;
    this.zIndex = 5;
}
PolilinhaHistorico.prototype = PolilinhaOpcoes;

function PolilinhaHistoricoAlarme(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#FF0000";
    this.strokeOpacity = 0.8;
    this.strokeWeight = 2;
    this.zIndex = 5;
}
PolilinhaHistoricoAlarme.prototype = PolilinhaOpcoes;

function PolilinhaHighlightAlarmeAnterior(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#00FF00";
    this.strokeOpacity = 0.4;
    this.strokeWeight = 10;
    this.zIndex = 4;
}
PolilinhaHighlightAlarmeAnterior.prototype = PolilinhaOpcoes;


function PolilinhaHighlightInicioContexto(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#33AD33";
    this.strokeOpacity = 0.8;
    this.strokeWeight = 10;
    this.zIndex = 4;
}
PolilinhaHighlightInicioContexto.prototype = PolilinhaOpcoes;

function PolilinhaHighlightFimContexto(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#FF00FF";
    this.strokeOpacity = 0.4;
    this.strokeWeight = 10;
    this.zIndex = 4;
}
PolilinhaHighlightFimContexto.prototype = PolilinhaOpcoes;

function PolilinhaHighlightAlarmePosterior(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#FF00FF";
    this.strokeOpacity = 0.4;
    this.strokeWeight = 10;
    this.zIndex = 3;
}
PolilinhaHighlightAlarmePosterior.prototype = PolilinhaOpcoes;

function PolilinhaPlanejamento(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = o.color;
    this.strokeOpacity = 0.5;
    this.strokeWeight = 7;
    this.icons = o.icons;
    this.zIndex = 0;
}
PolilinhaPlanejamento.prototype = PolilinhaOpcoes;

function PolilinhaPlanejamentoVeiculo(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = o.cor;
    this.strokeOpacity = 0;
    this.strokeWeight = 10;
    this.icons = [{
        icon: o.lineSymbol,
        offset: '100%',
        repeat: '10px'
    }]; 
    this.zIndex = 0;
}
PolilinhaPlanejamentoVeiculo.prototype = PolilinhaOpcoes;

function PolilinhaPlanejamentoDesvio(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = o.color;
    this.strokeOpacity = 0.0;
    this.strokeWeight = 10;
    this.icons = [{
        icon: {
            path: 'M 0,-0.5 0,0.5',
            strokeWeight: 6,
            strokeOpacity: 1,
            scale: 4
        },
        offset: '100%',
        repeat: '10px'
    }]; 
    this.zIndex = 0;
}
PolilinhaPlanejamentoDesvio.prototype = PolilinhaOpcoes;

function PolilinhaPlanejamentoRotograma(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#1E90FF";
    this.strokeOpacity = 0.75;
    this.strokeWeight = 11;
    this.zIndex = 4;
}
PolilinhaPlanejamentoRotograma.prototype = PolilinhaOpcoes;

function PolilinhaHighlight(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#000000";
    this.zIndex = 5;
    this.clickable = false;
    try {
        if (_isMobile) {
            this.strokeOpacity = 0.6;
            this.strokeWeight = 14;
        }
        else {
            this.strokeOpacity = 1;
            this.strokeWeight = 6;
        }
    }
    catch (Exception) {
        this.strokeOpacity = 1;
        this.strokeWeight = 6;
    }
}
PolilinhaHighlight.prototype = PolilinhaOpcoes;

function PolilinhaHistoricoAlarmeComboio(o) {
    this.map = o.mapa;
    this.path = o.pontos;
    this.strokeColor = "#FF0000";
    this.strokeOpacity = 1;
    this.strokeWeight = 2;
    this.zIndex = 5;
    this.clickable = true;
}
PolilinhaHistoricoAlarmeComboio.prototype = PolilinhaOpcoes;


function CriarPolilinha(options) {
    return new google.maps.Polyline(options);
}