{"version":"0.1.0","code":"0000","result":true,"message":"处理成功","errdetail":"","timestamp":1671516363553,"data":{"id":71712578,"title":"6.3.3.9 3D精品大图图元","slug":"ecsmga","format":"lake","bookId":26046811,"body":null,"body_draft":null,"body_html":"
3D精品大图图元(RctRouteLayerItem)是将精品三维效果绘制到屏幕上的一种LayerItem,目前应用场景为精品三维。
字段 | 含义 |
com.autonavi.gbl.map.layer.RctRouteLayerItem | 3D精品大图图元 |
com.autonavi.gbl.map.layer.model.LayerItemType.LayerItemRealCityCrossType | 3D精品大图 |
/* 回调获取3D精品大图json串 */\nString com.autonavi.gbl.map.layer.observer.IPrepareLayerStyle.getLayerStyle(BaseLayer pLayer, LayerItem pItem, boolean forJava)\n\n/* 回调获取纹理id */\nint com.autonavi.gbl.map.layer.observer.IPrepareLayerStyle.getMarkerId(BaseLayer pLayer, LayerItem pItem, String strMarkerId, String strMarkerInfo)\n\n/* 加载纹理 */\nboolean com.autonavi.gbl.map.MapView.addLayerTexture(LayerTexture texture)\n\n/* 更新样式 */\nvoid com.autonavi.gbl.map.layer.RctRouteLayerItem.updateStyle()\n\n/* 设置3D精品大图飞线数据 */\nboolean com.autonavi.gbl.map.layer.RctRouteLayerItem.setFlyRoute(byte[] pBuffer)\n\n/* 设置3D精品大图飞线的路况信息 */\nboolean com.autonavi.gbl.map.layer.RctRouteLayerItem.setFlyTmc(byte[] pBuffer, ArrayList<RealCityTmcParam> pParamArray)\n\n/* 设置3D精品大图gps信息,主要是影响车标位置 */\nboolean com.autonavi.gbl.map.layer.RctRouteLayerItem.setGpsPos(Vector3i pGpsPos, float mapAngle)\n\n/* 更新TBT信息给3D精品大图 */\nvoid com.autonavi.gbl.map.layer.RctRouteLayerItem.updataNaviInfo(RealCityNaviInfo pNaviInfo)\n\n/* 设置3D精品大图地图导航模式 */\nboolean com.autonavi.gbl.map.layer.RctRouteLayerItem.setRctNaviMode(int naviMode)\n\n/* 3D精品大图,开始导航 */\nvoid com.autonavi.gbl.map.layer.RctRouteLayerItem.startNavi()\n\n/* 3D精品大图,暂停导航 */\nvoid com.autonavi.gbl.map.layer.RctRouteLayerItem.pauseNavi()\n\n/* 3D精品大图,恢复导航 */\nvoid com.autonavi.gbl.map.layer.RctRouteLayerItem.resumeNavi()\n\n/* 3D精品大图,停止导航 */\nvoid com.autonavi.gbl.map.layer.RctRouteLayerItem.stopNavi()
说明:函数详情,请复制函数名称到在线API搜索
...\n/*< 创建RctRouteLayerItem并添加到图层 */\nRctRouteLayerItem pItem = new RctRouteLayerItem(mapView); // 创建RctRouteLayerItem\npItem.setStyle(prepareLayerStyle); // 设置样式回调\npItem.setBusinessType(BizRoadCrossType.BizRoadCrossTypeRealCity); // 设置业务类型\npItem.setFlyRoute(buffer); // 添加3D精品大图数据\n\n/* 回调获取3D精品大图json,回调获取markerID */\npublic class MapPrepareLayerStyle implements IPrepareLayerStyle {\n\t...\n\t@Override\n public String getLayerStyle(final BaseLayer pLayer, LayerItem layerItem, boolean b) {\n\t\tString strStyleJson = "";\n\t\tint itemType = layerItem.getItemType();\n int businessType = layerItem.getBusinessType();\n\t\tswitch (itemType) {\n\t\t\tcase LayerItemType.LayerItemRealCityCrossType:\n ... // 按需对businessType进行判断,获取指定的json串\n\t\t\t\tstrStyleJson = getStyleBeanJson("rct_layer_style");\n\t\t\t\tbreak;\n\t\t\tcase LayerItemType.xxx:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn strStyleJson;\n\t}\t\n\t...\t\n\t@Override\n public int getMarkerId(BaseLayer pLayer, LayerItem pItem, String strMarkerId, String strMarkerInfo) {\n int markerId = -1;\n strMarkerId = strMarkerId.trim();\n if (strMarkerId.isEmpty()) {\n return markerId;\n } \n ...\n int itemType = layerItem.getItemType();\n int businessType = layerItem.getBusinessType();\n\t\t\n\t\tswitch (itemType) {\n\t\t\tcase LayerItemType.LayerItemRealCityCrossType:\n ... // 按需对businessType进行判断\n //判断纹理信息,若未加载则通过addLayerTexture加载纹理\n\t\t\t\tmarkerId = addLayerTexture(texture);\n\t\t\t\tbreak;\n\t\t\tcase LayerItemType.xxx:\n\t\t\t\tmarkerId = -1;\n break;\n\t\t}\n\t\treturn markerId;\n\t}\t\n}
{\n "rct_route_layer_style":{\n "rct_navi_marker":{ //精品三维路口大图中的车标信息\n "car_marker_id":"car", //车标资源\n "car_marker_info":"", //车标资源属性描述,一般用于描述纹理加载要用的信息(如锚点相关)\n "car_scale":1, //车标资源缩放系数\n "compass_marker_id":"compass", //罗盘资源\n "compass_marker_info":"", //罗盘资源属性描述,一般用于描述纹理加载要用的信息(如锚点相关)\n "compass_scale":1, //罗盘资源缩放系数\n "shine_marker_id":"shine", //呼吸效果资源\n "shine_marker_info":"", //呼吸效果资源属性描述,一般用于描述纹理加载要用的信息(如锚点相关)\n "shine_scale":1 //呼吸效果资源缩放系数\n },\n "rct_fly_line_param":{\t //精品三维路口大图中的路径线信息\n "fill_marker_id":"fill", //路径线填充纹理\n "fill_marker_info":"", //路径线填充资源属性描述,一般用于描述纹理加载要用的信息(如锚点相关)\n "arrow_marker_id":"arrow", //路径线鱼骨线纹理\n "arrow_marker_info":"", //路径线鱼骨线资源属性描述,一般用于描述纹理加载要用的信息(如锚点相关)\n\t\t\t\t\t\t"route_arrow_marker_id":“big_arrow”, //路径线上大箭头纹理,-1则使用内置纹理\n\t\t\t\t\t\t"route_arrow_marker_info":"", //路径线上大箭头资源属性描述,一般用于描述纹理加载要用的信息(如锚点相关\n \t"width":18, //路径线宽度\n "side_width":18, //路径线描边宽度\n "fly_line_texture":{ //路径线纹理参数\n "x1":0.23, //纹理信息左上角x值,屏幕坐标系\n "x2":0.77, //纹理信息左上角y值,屏幕坐标系\n "y1":0.77, //纹理信息右下角x值,屏幕坐标系\n "y2":1, //纹理信息右下角y值,屏幕坐标系\n "texture_len":0.001 //纹理长度,仅在绘制虚线线型时设置\n },\n "fly_line_arrow_texture":{ //路径线鱼骨线纹理参数\n "x1":0.23, //纹理信息左上角x值,屏幕坐标系\n "x2":0.77, //纹理信息左上角y值,屏幕坐标系\n "y1":0.77, //纹理信息右下角x值,屏幕坐标系\n "y2":1, //纹理信息右下角y值,屏幕坐标系\n "texture_len":0.001 //纹理长度,仅在绘制虚线线型时设置\n }\n }\n }\n}
"rct_cross_style":{\n "rct_route_layer_style":{\n "rct_navi_marker":{\n "car_marker_id":"car",\n "car_scale":1.5,\n "compass_marker_id":"",\n "compass_scale":1.5,\n "shine_marker_id":"",\n "shine_scale":1.5\n },\n "rct_fly_line_param":{\n "fill_marker_id":"map_lr_road_white_front",\n "arrow_marker_id":"",\n "width":7,\n "side_width":2,\n "fly_line_texture":{\n "x1":0,\n "x2":1,\n "y1":0.25,\n "y2":0.25,\n "texture_len":256\n },\n "fly_line_arrow_texture":{\n "x1":1,\n "x2":0,\n "y1":1,\n "y2":0,\n "texture_len":256\n }\n }\n }\n }
1、RctRouteLayerItem的ItemType为LayerItemRealCityCrossType
2、需要有本地离线数据才能显示
3、setFlyRoute用于绘制3D精品大图中的路径线,与UpdateStyle联动
4、setFlyTmc用于绘制3D精品大图中的路径线的路况信息
5、setGpsPos用于车标位置更新,车标位置信息可来自定位信号回调
6、updataNaviInfo需要接收TBT的naviInfo回调,并设置给3D精品大图
7、json中的"route_arrow_marker_id"对应新的箭头纹理,不设置则使用引擎默认纹理
","body_lake":null,"pub_level":null,"status":"0","updated_at":"2022-04-06 07:03:54","deleted_at":null,"nameSpace":"mnlcaa/v610","browseCount":78,"collectCount":0,"estimateDate":14,"docStatus":0,"permissions":true,"overView":false}}