MiniMap.getViewArea

Syntax

getViewArea();

Description

The getViewArea method returns rectangle of the visible area.

Comments

Returned value - object of the PP.Rect class.

Example

To execute the example the HTML page must contain the component named map and the attached zoom control (see Example of Creating the MapChart ComponentMapChart component named map and the attached zoom control (see Example of Creating the MapChart Component).

Get coordinates of top left corner of rectangle of visible area and its height and width:

var rect = map.getMiniMap().getViewArea();
console.log("Coordinates of top left rectangle corner: " + rect.getLeft() + ", " + rect.getTop());
console.log("Rectangle height: " + rect.getHeight());
console.log("Rectangle width: " + rect.getWidth());

As a result, the console displayed coordinates of top left rectangle corner, its width and height:

Coordinates of top left rectangle corner: 0, 0

Rectangle height: 1

Rectangle width: 1

See also:

MiniMap