MapChart.setViewArea

Syntax

setViewArea(area: PP.Rect, fireEvent: Boolean);

Parameters

area. Rectangle bounding map view area.

fireEvent. Indicates whether to fire the ViewAreaChanged event on changing map view area. If this parameter is True the event is fired, otherwise it is not.

Description

The setViewArea method sets map view area.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Set a new map view area:

// Set view area
var area = new PP.Rect({
    Left: 50,
    Top: 100,
    Width: 300,
    Height: 200
});
// Set new view area for the map
map.setViewArea(area);

After executing the example a view area is set for the map. This area has new size (300 pixels wide and 200 pixels high) and new offset relative to top left corner of the container (left offset equal to 50 pixels, top offset equal to 100 pixels):

See also:

MapChart