{"version":"0.1.0","code":"0000","result":true,"message":"处理成功","errdetail":"","timestamp":1671508867095,"data":{"id":71712993,"title":"6.4.13自定义业务图层控制器","slug":"rhudo7","format":"lake","bookId":26046811,"body":null,"body_draft":null,"body_html":"
图层服务提供的图层绘制能力都是根据现有业务封装定制的,由各个业务图层控制器提供业务图层接口触发绘制。而自定义图层控制BizCustomControl提供一种能力,由上层根据自身需要,提供可自定义展示较为简单的点、线、面图层,用于展示一些简单点、线、面等图元元素。另外也拥有图层的基本能力(优先级配置,是否可点击设置,图层元素间碰撞,样式配置等),但不包括复杂的业务逻辑及图层间的碰撞。客户端可根据需要构建任意个图层,绘制任意图元。
相对于基础图层,自定义业务图层控制器的好处是,无需自己创建图层、图元,设置图层、图元数据等。但是,如果需要自定义复杂的业务图层,可以参考自定义复杂业务图层。
案例:XXX项目中,系统发过来一个信息,需要在图面上显示,那就可以借助这种自定义的能力很方便就能实现,否则就需要走需求流程开发新的图层等等。因为业务简单,只是展示一个或多个元素,有了这种自定能力,就可以0成本实现需求。
参考概述
com.autonavi.gbl.layer.model.BizCustomTypePoint Biz自定义图层业务类型定义,可根据业务需要使用定义在范围内的类型值,用于指定自定义图层的BizType,但不能超过最大类型值。
其它自定义图层类似。
一级分类 | 二级分类 | 业务图层 | 枚举类型 | 图元类型 | 对应图元Item | 图层配置名 |
自定义 自定义 | 点图元 | 自定义点图层1 | BizCustomTypePoint1 | 点图元 | CustomPointLayerItem | point_custom_layer_1 |
自定义点图层2 | BizCustomTypePoint2 | 点图元 | CustomPointLayerItem | point_custom_layer_2 | ||
自定义点图层3 | BizCustomTypePoint3 | 点图元 | CustomPointLayerItem | point_custom_layer_3 | ||
... | point_custom_layer_<数字> | |||||
线图层 | 自定义线图层1 | BizCustomTypeLine1 | 线图元 | CustomLineLayerItem | line_custom_layer_1 | |
自定义线图层2 | BizCustomTypeLine2 | 线图元 | CustomLineLayerItem | line_custom_layer_2 | ||
自定义线图层3 | BizCustomTypeLine3 | 线图元 | CustomLineLayerItem | line_custom_layer_3 | ||
... | line_custom_layer_<数字> | |||||
多边形图层 | 自定义多边形图层1 | BizCustomTypePolygon1 | 多边形图元 | CustomPolygonLayerItem | polygon_custom_layer_1 | |
自定义多边形图层2 | BizCustomTypePolygon2 | 多边形图元 | CustomPolygonLayerItem | polygon_custom_layer_2 | ||
自定义多边形图层3 | BizCustomTypePolygon3 | 多边形图元 | CustomPolygonLayerItem | polygon_custom_layer_3 | ||
... | polygon_custom_layer_<数字> | |||||
扇形/圆形图层 | 自定义扇形/圆形图层1 | BizCustomTypeCircle1 | 扇形图元 | CustomCircleLayerItem | circle_custom_layer_1 | |
自定义扇形/圆形图层2 | BizCustomTypeCircle2 | 扇形图元 | CustomCircleLayerItem | circle_custom_layer_2 | ||
自定义扇形/圆形图层3 | BizCustomTypeCircle3 | 扇形图元 | CustomCircleLayerItem | circle_custom_layer_3 | ||
... | circle_custom_layer_<数字> | |||||
箭头图层 | 自定义箭头图层1 | BizCustomTypeArrow1 | 箭头图元 | CustomArrowLayerItem | arrow_custom_layer_1 | |
自定义箭头图层2 | BizCustomTypeArrow2 | 箭头图元 | CustomArrowLayerItem | arrow_custom_layer_2 | ||
自定义箭头图层3 | BizCustomTypeArrow3 | 箭头图元 | CustomArrowLayerItem | arrow_custom_layer_3 | ||
... | arrow_custom_layer_<数字> | |||||
面板图层 | 自定义面板图层1 | BizCustomTypePlane1 | 面板图元 | CustomPlaneLayerItem | plane_custom_layer_1 | |
自定义面板图层2 | BizCustomTypePlane2 | 面板图元 | CustomPlaneLayerItem | plane_custom_layer_2 | ||
自定义面板图层3 | BizCustomTypePlane3 | 面板图元 | CustomPlaneLayerItem | plane_custom_layer_3 | ||
... | plane_custom_layer_<数字> |
//获取自定义类图层业务接口\nBizCustomControl com.autonavi.gbl.layer.BizControlService.getBizCustomControl(MapView pMapView)\n\n//新增绘制自定义箭头。不清除已有图元,清除需要自行调用ClearAllItems\nvoid com.autonavi.gbl.layer.BizCustomControl.addCustomArrow(ArrayList<BizCustomArrowInfo> customArrows,\n@BizCustomTypeArrow.BizCustomTypeArrow1 int bizArrowType \n)\n//更新绘制自定义箭头。内部会清除已有图元,然后再绘制新的图元\nvoid com.autonavi.gbl.layer.BizCustomControl.updateCustomArrow(ArrayList<BizCustomArrowInfo> customArrows,\n@BizCustomTypeArrow.BizCustomTypeArrow1 int bizArrowType \n)\n\n//新增绘制自定义扇形/圆形。不清除已有图元,清除需要自行调用ClearAllItems\nvoid com.autonavi.gbl.layer.BizCustomControl.addCustomCircle(ArrayList<BizCustomCircleInfo> customCircles,\n@BizCustomTypeCircle.BizCustomTypeCircle1 int bizCircleType \n)\n//更新绘制自定义扇形/圆形。内部会清除已有图元,然后再绘制新的图元\nvoid com.autonavi.gbl.layer.BizCustomControl.updateCustomCircle(ArrayList< BizCustomCircleInfo > customCircles,\n@BizCustomTypeCircle.BizCustomTypeCircle1 int bizCircleType \n)\n\n//新增绘制自定义线图层。不清除已有图元,清除需要自行调用ClearAllItems\nvoid com.autonavi.gbl.layer.BizCustomControl.addCustomLine(ArrayList< BizCustomLineInfo > customLines,\n@BizCustomTypeLine.BizCustomTypeLine1 int bizLineType \n)\n//更新绘制自定义线。内部会清除已有图元,然后再绘制新的图元\nvoid com.autonavi.gbl.layer.BizCustomControl.updateCustomLine(ArrayList< BizCustomLineInfo > customLines,\n@BizCustomTypeLine.BizCustomTypeLine1 int bizLineType \n)\n\n//新增绘制自定义面板图层。不清除已有图元,清除需要自行调用ClearAllItems\nvoid com.autonavi.gbl.layer.BizCustomControl.addCustomPlane(ArrayList<BizCustomPlaneInfo> customPlanes,\n@BizCustomTypePlane.BizCustomTypePlane1 int bizPlaneType \n)\n//绘制自定义面板图层\nvoid com.autonavi.gbl.layer.BizCustomControl.updateCustomPlane(ArrayList<BizCustomPlaneInfo> customPlanes,\n@BizCustomTypePlane.BizCustomTypePlane1 int bizPlaneType \n)\n\n//新增绘制自定义点。不清除已有图元,清除需要自行调用ClearAllItems\nvoid com.autonavi.gbl.layer.BizCustomControl.addCustomPoint(ArrayList<BizCustomPointInfo> customPoints,\n@BizCustomTypePoint.BizCustomTypePoint1 int bizPointType \n)\n//更新绘制自定义点。内部会清除已有图元,然后再绘制新的图元\nvoid com.autonavi.gbl.layer.BizCustomControl.updateCustomPoint(ArrayList<BizCustomPointInfo> customPoints,\n@BizCustomTypePoint.BizCustomTypePoint1 int bizPointType \n)\n\n//新增绘制自定义多边形。不清除已有图元,清除需要自行调用ClearAllItems\nvoid com.autonavi.gbl.layer.BizCustomControl.addCustomPolygon(ArrayList< BizCustomPolygonInfo > customPolygons,\n@BizCustomTypePolygon.BizCustomTypePolygon1 int bizPolygonType \n)\n//更新绘制自定义多边形。内部会清除已有图元,然后再绘制新的图元\nvoid com.autonavi.gbl.layer.BizCustomControl.updateCustomPolygon(ArrayList<BizCustomPolygonInfo> customPolygons,\n@BizCustomTypePolygon.BizCustomTypePolygon1 int bizPolygonType \n)
共提供五类接口,包括点(update/addCustomPoint),线(update/addCustomLine),多边形(update、addCustomPolygon),圆(update/addCustomCircle),箭头(update/addCustomArrow)。
其中:
第一个参数是数据列表,可以包含多个数据,绘制多个图元,数据内容根据定义和实际业务需求设置。
第二个参数指定当前图层的BizType,用于IPrepareLayerStyle中设置样式JSON信息的business type判断。
BizType也可以定义自己的类型,只要值和现有的不重复,建议只要在各个类型的范围值内都可以。
说明:函数详情,请复制函数名称到在线API搜索
private BizCustomControl mBizCustomControl;\n // 自定义类图层业务接口\n mBizCustomControl = mBizControlService.getBizCustomControl(mMapView);
/*** 自定义图层控制器demo ***/\n //显示自定义点图层\n public void showCustomPointLayer() {\n if (mBizCustomControl != null) {\n ArrayList<BizCustomPointInfo> customPoints = new ArrayList<>();\n BizCustomPointInfo point1 = new BizCustomPointInfo();\n Coord3DDouble position = new Coord3DDouble(116.470735, 39.992745, 0.0);\n point1.mPos3D = position;\n point1.priorityMode = CustomPriorityModeAscend;\n customPoints.add(point1);\n\n BizCustomPointInfo point2 = new BizCustomPointInfo();\n Coord3DDouble position2 = new Coord3DDouble(116.472575,39.992096, 0.0);\n point2.mPos3D = position2;\n point2.priorityMode = CustomPriorityModeAscend;\n customPoints.add(point2);\n\n mBizCustomControl.updateCustomPoint(customPoints, BizCustomTypePoint.BizCustomTypePoint1);\n }\n }\n\n //显示自定义线图层\n public void showCustomLineLayer() {\n if (mBizCustomControl != null) {\n ArrayList<BizCustomLineInfo> customLines = new ArrayList<>();\n BizCustomLineInfo line1 = new BizCustomLineInfo();\n ArrayList<Coord3DDouble> points = new ArrayList<Coord3DDouble>();\n Coord3DDouble start = new Coord3DDouble(116.470735, 39.992745, 0.0);\n Coord3DDouble end = new Coord3DDouble(116.472575,39.992096, 0.0);\n points.add(start);\n points.add(end);\n line1.mVecPoints = points;\n customLines.add(line1);\n mBizCustomControl.updateCustomLine(customLines, BizCustomTypeLine.BizCustomTypeLine1);\n }\n }\n\n //显示自定义多边形图层\n public void showCustomPolygonLayer() {\n if (mBizCustomControl != null) {\n ArrayList<BizCustomPolygonInfo> customPolygons = new ArrayList<>();\n BizCustomPolygonInfo customPolygon = new BizCustomPolygonInfo();\n ArrayList<Coord3DDouble> points = new ArrayList<Coord3DDouble>();\n Coord3DDouble start = new Coord3DDouble(116.475536, 39.992828, 0.0);\n Coord3DDouble mid = new Coord3DDouble(116.478883,39.994776, 0.0);\n Coord3DDouble end = new Coord3DDouble(116.47884,39.992737, 0.0);\n points.add(start);\n points.add(mid);\n points.add(end);\n customPolygon.vecPoints = points;\n customPolygons.add(customPolygon);\n mBizCustomControl.updateCustomPolygon(customPolygons, BizCustomTypePolygon.BizCustomTypePolygon1);\n }\n }\n\n //显示自定义圆图层\n public void showCustomCircleLayer() {\n if (mBizCustomControl != null) {\n ArrayList<BizCustomCircleInfo> customCircles = new ArrayList<>();\n BizCustomCircleInfo customCircle = new BizCustomCircleInfo();\n Coord3DDouble center = new Coord3DDouble(116.475064,39.995137, 0.0);\n customCircle.radius = 500.0;\n customCircle.center = center;\n SectorAngles angles = new SectorAngles();\n angles.startAngle = 0.0;\n angles.endAngle = 360.0;\n angles.stepAngle = 1.0;\n customCircle.sectorAngles = angles;\n customCircles.add(customCircle);\n mBizCustomControl.updateCustomCircle(customCircles, BizCustomTypeCircle.BizCustomTypeCircle1);\n }\n }\n\n //显示自定义箭头图层\n public void showCustomArrowLayer() {\n if (mBizCustomControl != null) {\n ArrayList<BizCustomArrowInfo> customArrows = new ArrayList<>();\n BizCustomArrowInfo customArrow = new BizCustomArrowInfo();\n ArrayList<Coord3DDouble> points = new ArrayList<Coord3DDouble>();\n Coord3DDouble start = new Coord3DDouble(116.470735, 39.992745, 0.0);\n Coord3DDouble mid = new Coord3DDouble(116.47236, 39.993411, 0.0);\n points.add(start);\n points.add(mid);\n customArrow.mVecPoints = points;\n customArrows.add(customArrow);\n mBizCustomControl.updateCustomArrow(customArrows, BizCustomTypeArrow.BizCustomTypeArrow1);\n }\n }\n\n public void removeAllLayerItems() {\n if (mBizCustomControl != null) {\n mBizCustomControl.clearAllItems();\n }\n }
\n /**\n * @brief 对于不存在的纹理通过添加并生成id\n * @param[in] pLayer 图元所在图层\n * @param[in] pItem 需要更新样式的具体图元,通过GetBusinessType返回值判断具体图层\n * @param[in] imageName\n * @param[in] strMarkerInfo marker对应纹理的数据参数配置名\n * @return markerID\n * @note\n */\n public synchronized int AddStaticMarker(BaseLayer pLayer, LayerItem pItem, String imageName, String strMarkerInfo) {\n if (strMarkerInfo.isEmpty()) {\n strMarkerInfo = imageName;\n }\n MarkerInfoBean markerInfoBean = CommonUtil.getMarkerInfoFromJson(strMarkerInfo);\n LayerTexture layerTexture = new LayerTexture();\n if (markerInfoBean != null) {\n layerTexture.anchorType = markerInfoBean.getAnchor();\n layerTexture.xRatio = markerInfoBean.getX_ratio();\n layerTexture.yRatio = markerInfoBean.getY_ratio();\n layerTexture.isRepeat = markerInfoBean.getRepeat() == 1;\n layerTexture.isGenMipmaps = markerInfoBean.getGen_mipmaps() == 1;\n layerTexture.isPreMulAlpha = markerInfoBean.getPre_mul_alpha() == 1;\n } else {\n layerTexture.anchorType = LayerIconAnchor.LayerIconAnchorCenter;\n layerTexture.isRepeat = false;\n layerTexture.xRatio = 0;\n layerTexture.yRatio = 0;\n layerTexture.isGenMipmaps = false;\n layerTexture.isPreMulAlpha = true;\n }\n\n int resID = CC.getApplication().getResources().getIdentifier(imageName, "drawable"\n , CC.getApplication().getApplicationInfo().packageName);\n Bitmap bitmap = BitmapFactory.decodeResource(CC.getApplication().getResources(), resID);\n if (bitmap == null) {\n if (pLayer == null) {\n CommonUtil.showShortToast("创建新图片纹理" + imageName + "失败");\n } else {\n CommonUtil.showShortToast(pLayer.getName() + ",创建新图片纹理" + imageName + "失败");\n }\n return -1;\n }\n\n ByteBuffer dataBuffer = ByteBuffer.allocate(bitmap.getByteCount());\n bitmap.copyPixelsToBuffer(dataBuffer);\n layerTexture.dataBuff = new BinaryStream(dataBuffer.array());\n layerTexture.width = bitmap.getWidth();\n layerTexture.height = bitmap.getHeight();\n layerTexture.iconType = LayerIconTypeBMP;\n int markerId = getStaticMarkerId(mImageNameList.size());\n layerTexture.resID = markerId;\n boolean isAddSuccess = mMapView.addLayerTexture(layerTexture);\n mImageNameList.add(imageName);\n\n return markerId;\n }\n\n /**\n * @brief 图元样式中通过marker 图片文件名获取对应的marker id回调接口\n * @param[in] pLayer 图元所在图层\n * @param[in] pItem 需要更新样式的具体图元,通过GetBusinessType返回值判断具体图层\n * @param[in] strMarkerInfo marker对应纹理的数据参数配置名\n * @return int32_t 返回图片的marker id\n * @note thread:main HMI根据图片文件名添加纹理并且返回相应的marker id,如果是marker id,则转换成int32_t后返回\n */\n @Override\n public synchronized int getMarkerId(BaseLayer pLayer, LayerItem pItem, String strMarkerId, String strMarkerInfo) {\n int markerId = -1;\n strMarkerId = strMarkerId.trim();\n if (TextUtils.isEmpty(strMarkerId)) {\n return markerId;\n }\n\n if (CommonUtil.isInteger(strMarkerId)) {\n markerId = NumberUtil.str2Int(strMarkerId, 10, AutoConstant.DEFAULT_ERR_CODE);\n } else {\n int dynamicMarderId = isDynamicMarker(pLayer, pItem, strMarkerId, strMarkerInfo);\n if (dynamicMarderId > 0) {\n return dynamicMarderId;\n }\n\n int index = mImageNameList.indexOf(strMarkerId);\n if (index >= 0) {\n markerId = getStaticMarkerId(index);\n return markerId;\n }\n\n markerId = AddStaticMarker(pLayer, pItem, strMarkerId, strMarkerInfo);\n }\n\n return markerId;\n }\n\n /**\n * @brief 图元样式JSON串回调接口\n * @param[in] pLayer 图元所在图层\n * @param[in] layerItem 需要更新样式的具体图元,通过GetBusinessType返回值判断具体图层\n * @param[in] forJava 参数暂时无用,只是标示当前接口用于支持Java端,传递Stirng而非cJSON*\n * @return String 返回的样式JSON内容字符串,由客户端构造\n * @note thread:main\n */\n @Override\n public String getLayerStyle(final BaseLayer pLayer, LayerItem layerItem, boolean forJava) {\n String strStyleJson = "EMPTY";\n if (pLayer == null || layerItem == null) {\n return strStyleJson;\n }\n \n int itemType = layerItem.getItemType();\n int businessType = layerItem.getBusinessType();\n\n switch (itemType) {\n case LayerItemType.LayerItemPointType:\n switch (businessType) {\n case BizCustomTypePoint.BizCustomTypePoint1:\n strStyleJson = CommonUtil.getStyleBeanJsonWithNightMode("point_custom_style", mIsNightMode);\n break;\n }\n break;\n case LayerItemType.LayerItemLineType:\n switch (businessType) {\n case BizCustomTypeLine.BizCustomTypeLine1:\n strStyleJson = CommonUtil.getStyleBeanJsonWithNightMode("line_custom_style", mIsNightMode);\n break;\n }\n break;\n case LayerItemType.LayerItemPolygonType:\n switch (businessType) {\n case BizCustomTypePolygon.BizCustomTypePolygon1:\n strStyleJson = CommonUtil.getStyleBeanJsonWithNightMode("polygon_custom_style", mIsNightMode);\n break;\n }\n break;\n case LayerItemType.LayerItemArrowType:\n switch (businessType) {\n case BizCustomTypeArrow.BizCustomTypeArrow1:\n strStyleJson = CommonUtil.getStyleBeanJsonWithNightMode("arrow_custom_style", mIsNightMode);\n break;\n }\n break;\n case LayerItemType.LayerItemSectorType:\n switch (businessType) {\n case BizCustomTypeCircle.BizCustomTypeCircle1:\n strStyleJson = CommonUtil.getStyleBeanJsonWithNightMode("circle_custom_style", mIsNightMode);\n break;\n }\n break;\n }\n }
{\n "marker_info": {\n\t\t"road_facilities_x_y":\n\t\t{\n\t\t\t"anchor":9,\n\t\t\t"x_ratio":0.5,\n\t\t\t"y_ratio":0.935\n\t\t}\n\t},\n "layer_item_info": {\n\t\t"point_custom_style": {\n\t\t\t"point_layer_item_style": {\n\t\t\t\t"normal_style": {\n\t\t\t\t\t"poi_marker_id": "global_image_auto_ic_road_facilities_village",\n\t\t\t\t\t"poi_marker_info": "road_facilities_x_y"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t"point_custom_style_night": {\n\t\t\t"point_layer_item_style": {\n\t\t\t\t"normal_style": {\n\t\t\t\t\t"poi_marker_id": "auto_navi_ns_share_new_night"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t"line_custom_style": {\n\t\t\t"line_layer_item_style": {\n\t\t\t\t"priority":0,\n\t\t\t\t"use_cap":1,\n\t\t\t\t"use_color":1,\n\t\t\t\t"draw_cover":1,\n\t\t\t\t"can_be_coveredbylabel":1,\n\t\t\t\t"fill_texture": {\n\t\t\t\t\t"marker_id":"map_frontlr",\n\t\t\t\t\t"marker_info":"",\n\t\t\t\t\t"color":"0xff00baff",\n\t\t\t\t\t"width":32\n\t\t\t\t},\n\t\t\t\t"border_texture": {\n\t\t\t\t\t"marker_id":"map_frontlr",\n\t\t\t\t\t"marker_info":"",\n\t\t\t\t\t"color":"0xff0066ff",\n\t\t\t\t\t"width":40\n\t\t\t\t},\n\t\t\t\t"texture_info": {\n\t\t\t\t\t"x1":0.0,\n\t\t\t\t\t"y1":0.5,\n\t\t\t\t\t"x2":1.0,\n\t\t\t\t\t"y2":0.5,\n\t\t\t\t\t"texture_len":32\n\t\t\t\t},\n\t\t\t\t"cap_texture_info": {\n\t\t\t\t\t"x1":0.0,\n\t\t\t\t\t"y1":0.5,\n\t\t\t\t\t"x2":1.0,\n\t\t\t\t\t"y2":0.75\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t"polygon_custom_style": {\n\t\t\t"polygon_layer_item_style": {\n\t\t\t\t"color": "0x5990b8f5"\n\t\t\t}\n\t\t},\n\t\t"circle_custom_style": {\n\t\t\t"sector_layer_item_style": {\n\t\t\t\t"color": "0x770f0b01"\n\t\t\t}\n\t\t},\n\t\t"arrow_custom_style": {\n\t\t\t"arrow_layer_item_style": {\n\t\t\t\t"arrow_2d_texture_info": {\n\t\t\t\t\t"use_cap": 1,\n\t\t\t\t\t"use_color": 1,\n\t\t\t\t\t"draw_cover": 1,\n\t\t\t\t\t"can_be_coveredbylabel": 0,\n\t\t\t\t\t"solid_arrow_in2dmap": 1,\n\t\t\t\t\t"fill_texture": {\n\t\t\t\t\t\t"marker_id": "arrow_line_inner",\n\t\t\t\t\t\t"color": "0xffffffff",\n\t\t\t\t\t\t"width": 48\n\t\t\t\t\t},\n\t\t\t\t\t"border_texture": {\n\t\t\t\t\t\t"marker_id": "arrow_line_outer",\n\t\t\t\t\t\t"color": "0xff0b6fc4",\n\t\t\t\t\t\t"width": 40\n\t\t\t\t\t},\n\t\t\t\t\t"texture_info": {\n\t\t\t\t\t\t"x1": 0.12,\n\t\t\t\t\t\t"y1": 0.77,\n\t\t\t\t\t\t"x2": 0.88,\n\t\t\t\t\t\t"y2": 0.77,\n\t\t\t\t\t\t"texture_len": 0\n\t\t\t\t\t},\n\t\t\t\t\t"cap_texture_info": {\n\t\t\t\t\t\t"x1": 0.12,\n\t\t\t\t\t\t"y1": 0.85,\n\t\t\t\t\t\t"x2": 0.88,\n\t\t\t\t\t\t"y2": 1\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t"arrow_3d_texture_info": {\n\t\t\t\t\t"draw_3d_arrow": 1,\n\t\t\t\t\t"bias_width": 0,\n\t\t\t\t\t"auto_zoomer_width": 0,\n\t\t\t\t\t"solid_res_marker_id": "threed_arrow_line_shadow",\n\t\t\t\t\t"solid_top_face_color": "0xfff0f9ff",\n\t\t\t\t\t"solid_side_face_color": "0xff2c428a",\n\t\t\t\t\t"solid_shadow_color": "0x4d000000",\n\t\t\t\t\t"solid_height": 5,\n\t\t\t\t\t"solid_thickness": 10,\n\t\t\t\t\t"solid_border_line_top_line_width": 3,\n\t\t\t\t\t"solid_border_line_side_line_width": 0,\n\t\t\t\t\t"solid_border_line_bottom_line_width": 0,\n\t\t\t\t\t"solid_border_line_top_line_color": "0xff506cc9",\n\t\t\t\t\t"solid_border_line_side_line_color": "0xff1c3575",\n\t\t\t\t\t"solid_border_line_bottom_line_color": "0xff1c3575",\n\t\t\t\t\t"solid_arrow_header_param": {\n\t\t\t\t\t\t"header_angle": 55,\n\t\t\t\t\t\t"header_width_rate": 2.8\n\t\t\t\t\t},\n\t\t\t\t\t"solid_texture_info": {\n\t\t\t\t\t\t"x1": 0.3,\n\t\t\t\t\t\t"y1": 0.77,\n\t\t\t\t\t\t"x2": 0.7,\n\t\t\t\t\t\t"y2": 0.77,\n\t\t\t\t\t\t"texture_len": 0.01\n\t\t\t\t\t},\n\t\t\t\t\t"solid_cap_texture_info": {\n\t\t\t\t\t\t"x1": 0.3,\n\t\t\t\t\t\t"y1": 0.8,\n\t\t\t\t\t\t"x2": 0.7,\n\t\t\t\t\t\t"y2": 1.0\n\t\t\t\t\t},\n\t\t\t\t\t"solid_header_texture_info": {\n\t\t\t\t\t\t"x1": 0.12,\n\t\t\t\t\t\t"y1": 0.75,\n\t\t\t\t\t\t"x2": 0.88,\n\t\t\t\t\t\t"y2": 0.0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}
自定义业务图层和其它业务图层不一样的一点是,各已有的业务图层的优先级在业务图层优先级中配置,已基本符合业务的优先级要求,但是自定义业务图层因为是未知的、不确定的,所以需要客户端根据使用情况配置自定义业务图层优先级,如果没有配置,则会使用默认的优先级,后面添加的图层图元优先级高于前面添加的。
以自定义点图层为例(假设该自定义点图元的type为BizCustomTypePoint3):
自定义业务图层控制器的图层默认是不可点击的,如果需要改为可点击,需要通过getCustomLayer获取到BaseLayer再设置为可点击。
自定义图层的图层配置名用于style_bl.json中图层优先级和图层碰撞的配置。比如配置碰撞:
"guide_label_collision": {\n "area_collision": [\n ],\n "collision_layer": [\n "point_custom_layer_2",\n "point_custom_layer_3"\n ]\n},
注:自定义点图层2和自定义点图层3相互根据优先级高低碰撞。
","body_lake":null,"pub_level":null,"status":"0","updated_at":"2022-04-06 07:04:29","deleted_at":null,"nameSpace":"mnlcaa/v610","browseCount":118,"collectCount":0,"estimateDate":40,"docStatus":0,"permissions":true,"overView":false}}