更新时间:2023-07-03 14:59:29评论 收藏我的文档设置mapcontext 概览主体: 企业支付宝小程序 、 个人支付宝小程序相关文档: map 组件my.createmapcontext 返回的对象,可用于操作对应的地图组件。方法名称类型功能说明mapcontext.updatecomponentsfunction设置地图属性及覆盖物。mapcontext.setcenteroffsetfunction设置地图中心偏移。mapcontext.setmaptypefunction设置地图类型。mapcontext.gestureenablefunction设置所有手势是否可用。mapcontext.showscompassfunction设置指南针是否可见。mapcontext.showsscalefunction设置比例尺控件是否可见。mapcontext.getcenterlocationfunction获取当前地图中心位置。mapcontext.getmappropertiesfunction获取地图的属性信息。mapcontext.getscalefunction获取当前地图的缩放级别。mapcontext.getrotatefunction获取当前地图的旋转角。mapcontext.getskewfunction获取当前地图的倾斜角。mapcontext.getregionfunction获取地图东北角、西南角的经纬度。mapcontext.movetolocationfunction移动地图中心位置。mapcontext.includepointsfunction调整(移动和缩放)地图可视区域以包含指定的坐标点。mapcontext.changemarkersfunction添加、删除、更新指定的标记(marker)。mapcontext.translatemarkerfunction平移点标记(marker)。mapcontext.smoothmovemarkerfunction沿指定路径平滑移动标记(marker)。mapcontext.smoothmovepolylinefunction绘制折线,产生轨迹动画。mapcontext.showroutefunction规划两点之间的路径并在地图上展示。mapcontext.clearroutefunction清除地图上的导航路线。mapcontext.calculatedistancefunction计算由一系列坐标点所定义的路径的长度,并可计算出该路径上距起始点指定距离的点的坐标。mapcontext.polygoncontainspointfunction判断多边形区域是否包含指定的坐标点。mapcontext.screentomapfunction将屏幕上坐标点转换成对应地图上经纬度。mapcontext.maptoscreenfunction将地图上的经纬度转换成对应屏幕坐标点。