MapContext Overview

Call my.createMapContext to obtain a MapContext instance. A MapConext instance is bound with a map component through its ID. Manipulate the corresponding map component through MapContext.

Methods

Option

Description

MapContext.clearRoute

Clear the walking route on the map.

MapContext.gestureEnable

Enable or disable all gestures.

MapContext.getCenterLocation

Get the center location of the current map.

MapContext.moveToLocation

Display the pinned location at the center of the map and restore the default zoom level. Use this method together with the show-location method of the map component.

MapContext.showRoute

Show the default walking route planned. Only one route is displayed.

MapContext.showsCompass

Set the visibility of the compass.

MapContext.updateComponents

Update the map API incrementally.

MapContext.getScale

Get the zoom level of the current map.

MapContext.getSkew

Get the skew angle of the current map.

MapContext.getRegion

Get the coordinates (the latitude and longitude) of the northeast and southwest corners of the current map.

MapContext.includePoints

Adjust (move and zoom) the visible area of the map to display the specified coordinates in the map view area.

MapContext.changeMarkers

Add, delete, or update the specified location marker.

MapContext.translateMarker

Move the marker in the map.

MapContext.calculateDistance

Calculate the length of a path defined by a series of coordinate points, and calculate the coordinates of a target point on the path at a specified distance from the starting point.

MapContext.screenToMap

Convert screen coordinates to corresponding latitude and longitude on the map.

MapContext.mapToScreen

Convert map coordinates to corresponding latitude and longitude on the screen.