MapContext.updateComponents

Update the map API incrementally.

Parameters

PropertyTypeDescription
latitudeNumberThe latitude of the center location.
longitudeNumberThe longitude of the center location.
scaleNumberZoom level. The value ranges from 5 to 18. The default value is 16.
markersArrayPoint markers that overlay the map.
polylineArrayA set of consecutive points (a route) that overlays the map.
include-pointsArraySlightly zoom out the map to include these points.
include-paddingObjectShow the map inside the area that includes paddings.
settingsObjectThe settings. 
commandObjectThe command to update the marker animation.

Sample code

copy
this.mapCtx = my.createMapContext('map');
this.mapCtx.updateComponents({
scale: 14,
longitude: 103.863718,
latitude: 1.351628,
command:{
     // Marker animation
     markerAnim:[
       {
         type:0      // Jumping animation
         markerId:xxx,
       }
     ],
},
setting:{
     // Gesture
     gestureEnable:0/1,
     // Scale
     showScale:0/1,
     // Compass
     showCompass:0/1,
     // Tilt gestures with both hands
     tiltGesturesEnabled:0/1,
     // Show or hide traffic
     trafficEnabled:0/1,
     // Points of interest on the map
     showMapText:0/1,
     // Location of Amap logo
     logoPosition:{centerX:150, centerY:90},
},
markers:[{},{}],
polyline:[{},{}],
include-points:[{},{}],
include-padding:{left:0, right:0, top:0, bottom:0},
});