MapContext.getScale

Get the zoom level of the current map.

Parameters

Property

Type

Required

Description

success

Function

No

The callback function that is called upon successful call.

fail

Function

No

The callback function that is called upon failed call.

complete

Function

No

The callback function that is called upon call completion (to be executed upon either call success or failure).

Success callback function

The parameters are in object type and have the following properties:

Property

Type

Description

scale

Number

The zoom level.

Sample code

copy
this.mapCtx = my.createMapContext('map');
this.mapCtx.getScale({
    success: res => {
        console.log(res);
    },
    fail: error => {
        console.log(error)
    },
    complete: res => {
        console.log(res)
    }
});