// 创建室内导航对象 var indoorRoute = new BMap.IndoorRoute(map, { renderOptions: { map: map, autoViewport: true }, onMarkersSet: function(data) { // 设置起点和终点图标 var iconStart = new BMap.Icon("起点图标URL", new BMap.Size(32, 32)); var iconEnd = new BMap.Icon("终点图标URL", new BMap.Size(32, 32)); var startMarker = new BMap.Marker(data.start.point, {icon: iconStart}); var endMarker = new BMap.Marker(data.end.point, {icon: iconEnd}); map.addOverlay(startMarker); map.addOverlay(endMarker); } }); // 定义起点和终点 var startPoint = new BMap.Point(116.404, 39.915); var endPoint = new BMap.Point(116.409, 39.916); // 开始室内导航 indoorRoute.route(startPoint, endPoint);