Skip to content

Kml kml类 ​

创建 ​

typescript
const kml = await loadKml({url:'../custom.kml'})

类型 ​

typescript
type LoadKml = {
  (option: KmlOptions, globeID?: string): Promise<Kml>;
};

type KmlOptions = {
  url: string;
  sourceUri?: string; //当文件中包含模型图片的引用,配置基准url
  show?: boolean;
  isToken?: boolean; //是否需要发送验证信息 false
  questType?: 'headers' | 'params'; //发送方式 'headers'
  tokenKey?: string; // 信息key
  token?: string; //验证信息
};

判定 ​

isKml() ​

typescript
function isKml(tar: any): tar is Kml

属性 ​

readonly id: string 唯一标识 ​

readonly url: string url地址 ​

show: boolean 是否显示 ​

方法 ​

static fromUrl 创建加载czml ​

typescript
fromUrl(url: string, option: KmlOptions, globeID?: string): Promise<Kml>

focus 聚焦 ​

  • duration 过渡时间 单位秒
typescript
focus(duration?: number): void

destroy 销毁 ​

typescript
destroy(): boolean