MapTimeline.updateSize

Syntax

updateSize ()

Description

The updateSize method sets timeline size according to the map size.

Comments

The method is fired automatically on map resize.

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 value editorwhere width of timeline and more precisely width of the base component will be set Sliderand the button which on clicking updates the width of timeline to the map width:

var numbers = new PP.Ui.NumberEdit(

{

    Width: 50,

    ParentNode: document.getElementById("div1"),

    AfterValueChange: function (sender, args)

    {

        var tl = map.getTimeline()

        tl.getMapSlider().getSlider().setWidth(numbers.getValue())

    }

});

var button = new PP.Ui.Button(

{

    ParentNode: document.getElementById("div2"),

    Content: "Update",

    Click: function (sender, args)

    {

        var tl = map.getTimeline()

        tl.updateSize();

    }

})

After executing the example a value editor and the Update button are added to the page. Set a desired value in the value editor, timeline width changes correspondingly. On clicking the Update button the timeline returns to the previous width.

See also:

MapTimeline