文档管理中心

Interface (FlowFieldOverlay)

Phone6.0.0(20)+PC/2in16.0.0(20)+Tablet6.0.0(20)+

导入模块

import { map, mapCommon } from '@kit.MapKit';

FlowFieldOverlay

Phone6.0.0(20)+PC/2in16.0.0(20)+Tablet6.0.0(20)+

流场图层管理对象。在调用map.MapComponentController类的addFlowFieldOverlay方法时会返回该类型的实例,继承BaseOverlay

模型约束: 此接口仅可在Stage模型下使用。

元服务API: 从版本6.0.0(20)开始,该接口支持在元服务中使用。

系统能力: SystemCapability.Map.Core.EnhancedOverlay

起始版本: 6.0.0(20)

示例:

let params: mapCommon.FlowFieldOverlayParams = {
  // data为GRIB2规范的json数据,需开发者自行传输,可参考流场数据格式参考
  data: 'xxx'
};
let fieldOverlay = await mapController.addFlowFieldOverlay(params);

setStyle

Phone6.0.0(20)+PC/2in16.0.0(20)+Tablet6.0.0(20)+

setStyle(style: mapCommon.ParticleStyle): void

设置粒子样式。

模型约束: 此接口仅可在Stage模型下使用。

元服务API: 从版本6.0.0(20)开始,该接口支持在元服务中使用。

系统能力: SystemCapability.Map.Core.EnhancedOverlay

起始版本: 6.0.0(20)

参数:

展开
参数名 类型 必填 说明
style mapCommon.ParticleStyle 粒子样式。

示例:

let style: mapCommon.ParticleStyle = {
  count: 200,
  color: 0xff009575,
  maxSpeed: 60,
  speedFactor: 0.3
};
fieldOverlay.setStyle(style);

getStyle

Phone6.0.0(20)+PC/2in16.0.0(20)+Tablet6.0.0(20)+

getStyle(): mapCommon.ParticleStyle

获取粒子样式。

模型约束: 此接口仅可在Stage模型下使用。

元服务API: 从版本6.0.0(20)开始,该接口支持在元服务中使用。

系统能力: SystemCapability.Map.Core.EnhancedOverlay

起始版本: 6.0.0(20)

返回值:

展开
类型 说明
mapCommon.ParticleStyle 粒子样式。

示例:

let style: mapCommon.ParticleStyle = fieldOverlay.getStyle();
请输入您想要搜索的关键词