MapChart.getScaleSettings

Syntax

getScaleSettings();

Description

The getScaleSettings method returns map scale settings.

Comments

The method returns a JSON object with the following fields: Scale - map scale, Point - scaling center, Type - map topobase type. If the scale has not changed the method returns null.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component), and map scale must be changed manually using the mouse wheel. Now get the scaling settings:

var scaleSettings = map.getScaleSettings();
if (scaleSettings != null) {
    console.log("Scale: " + scaleSettings.Scale);
    console.log("Scaling center: " + scaleSettings.Point);
};

After executing the example the browser console displays scaling settings:

Scale: 1.1353174603174605

Scaling center: 313,156

See also:

MapChart