geovisearth / Exports / PlottingBehavior

# Class: PlottingBehavior

@类别 无需创建,引擎初始化时自动创建
@描述 标绘行为类,手动绘制

示例代码(1)
let engine = new GVOL.GvolEngine('GvolContainer');
engine.plot.createPlot({},'基本元素', '点', '图标点');
示例代码(2)
let engine = new GVOL.GvolEngine('GvolContainer');
engine.plot.createPlot({
        gvolType:'Ellipsoid',
        properties: {
            color: '#FF0000', //颜色
        },
        geometry:{
            coordinates: [86,30]
        }
    });

See

标绘点

# Hierarchy

  • Event

    PlottingBehavior

# Table of contents

# Methods

# Methods

# close

close(): void

关闭编辑模式

# Returns

void

# Defined in

PlottingTool/PlottingBehavior.ts:158


# createPlot

createPlot(params, firstCategory?, secondCategory?, thirdCategory?): any

绘制方法

# Parameters

Name Type Description
params any 自定义参数
firstCategory? any 一级分类
secondCategory? any 二级分类
thirdCategory? any 三级分类

# Returns

any

gvolObject对象

一级分类:基本元素 二级分类: 点、线、面、文字、箭头、其它、粒子 三级分类: 点:图标点 = 0, 线:直线 = 1, 曲线 = 2, 流动线 = 3, 箭头线 = 4, 航线 = 5 面:多边形= 6, 矩形= 7, 圆形= 8 文字:标签文字= 9, 路径文字= 10, 贴地文字= 11, 富文本= 12, 箭头:双箭头= 13, 集结地= 14, 进攻方向= 15, 进攻方向尾= 16, 分队战斗行动= 17, 分队战斗行动尾= 18, 粗单直箭头= 19, 粗单尖头箭头= 20, 细直箭头= 21 其它:立方体= 22, 动态波= 23, 雷达= 24 粒子:烟特效= 25, 爆炸= 26, 喷泉

# Defined in

PlottingTool/PlottingBehavior.ts:80


# fire

fire(type, data): PlottingBehavior

激活对象的某个监听事件,可以附件数据,并可以传递给父对象(事件对象基础方法)

Method

fire

# Parameters

Name Type Description
type string 事件名称
data any 监听时(on)收到的数据

# Returns

PlottingBehavior

示例代码:
const info = {} //监听时(on)收到的数据
event.fire('add',info);

# Inherited from

Event.fire

# Defined in

Core/Event.ts:145


# listens

listens(type): boolean

查询是否有指定类型的监听器(事件对象基础方法)

# Parameters

Name Type Description
type string 事件类型

# Returns

boolean

示例代码:
const hasListens = event.listens('add');

# Inherited from

Event.listens

# Defined in

Core/Event.ts:172


# loaded

loaded(): void

加载完成后调用

# Returns

void

# Defined in

PlottingTool/PlottingBehavior.ts:134


# off

off(type, fn, context?): void

移除对象的事件监听方法(事件对象基础方法)

# Parameters

Name Type Description
type string 要删除的监听事件类型
fn Function 要删除的监听回调函数,为空时清空所有回调函数
context? any 上下文

# Returns

void

代码示例:
event.off('add',fun);

# Inherited from

Event.off

# Defined in

Core/Event.ts:73


# on

on(type, fn, context?): PlottingBehavior

添加对象的事件监听方法(事件对象基础方法)

# Parameters

Name Type Description
type string 监听事件类型
fn Function 监听回调函数
context? any 上下文 示例代码: const fun = function(info) { console.log('监听事件'); console.log(info); } event.on('add', fun); //监听添加事件

# Returns

PlottingBehavior

# Inherited from

Event.on

# Defined in

Core/Event.ts:23


# onPick

onPick(callback): void

注册拾取对象

# Parameters

Name Type Description
callback any 回调方法

# Returns

void

# Defined in

PlottingTool/PlottingBehavior.ts:143


# open

open(): void

开启编辑模式

# Returns

void

# Defined in

PlottingTool/PlottingBehavior.ts:151