可以参考下面的示例代码:private mapPolyline?: map.MapPolyline; /** * 添加Polyline */ private async addPolyline() { let polylineOption: mapCommon.MapPolylineOptions = { points: [ { latitude: 22.70106128558265, longitude: 114.20485559375003 }, { latitude: 22.527566971297336, longitude: 113.90822473437503 }, { latitude: 22.54025141339333, longitude: 114.19936242968748 }, { latitude: 22.32373190546129, longitude: 113.99650772823661 } ], clickable: true, visible: true, width: 10, zIndex: 0, gradient: false }; this.mapPolyline = await this.mapController?.addPolyline(polylineOption); }移除 Polygon可以调用:this.mapPolygon?.remove();
可以参考下面的示例代码:
移除 Polygon可以调用: