MapContext.getRegion
Get the coordinates of the northeast and southwest corners 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 |
northeast | Object | The coordinates (including longitude and latitude) of the northeas corner of the map. Example: copy
|
southwest | Object | The coordinates (including longitude and latitude) of the southwest corner of the map. Example: copy
|
Sample code
copy
this.mapCtx = my.createMapContext('map');
this.mapCtx.getRegion({
success: res => {
console.log(res);
},
fail: error => {
console.log(error)
},
complete: res => {
console.log(res)
}
});