MapTimeline.applyAlignment

Syntax

applyAlignment ()

Description

The applyAlignment method applies vertical and horizontal alignment settings to the timeline.

Comments

Vertical and horizontal position of the timeline can be set in the file that contains JSON settings for the map. VerticalAlignment and HorizontalAlignment attributes of the MapTimeline item are used for this purpose. By default the timeline is displayed at the bottom center.

Example

To execute the example the page must contain the MapChart component named map (see Map Layout on HTML Page) for which a timeline is set up (see Example of Timeline Setup). Add the button clicking which applies new settings of vertical and horizontal positioning to the timeline:

var btn1 = new PP.Ui.Button(

{

    IsToggleButton: true,

    Content: "Change alignment",

    ParentNode: document.getElementById("div1"),

    Click: function (sender, args)

    {

        var tl = map.getTimeline()

        tl._HorizontalAlignment = "Left"

        tl._VerticalAlignment = "Top"

        tl.applyAlignment()

    }

});

After executing the example the Change Alignment button is located on the page. Clicking this button places the time scale at the top left corner:

See also:

MapTimeline