Class: Locator

wol. Locator


new Locator(mapViewer)

要素定位器

Parameters:
Name Type Description
mapViewer wol.MapViewer

wol地图实例

Source:
Requires:
  • module:wol-util.js

Requires

  • module:wol-util.js

Methods


createAreaFlashStyle(elapsedRatio) → {ol.style.Style}

创建面定位闪动样式

Parameters:
Name Type Description
elapsedRatio number

动画已执行时间所占比率

Source:
Returns:
  • 面定位闪动样式
Type
ol.style.Style

createLineFlashStyle(elapsedRatio) → {ol.style.Style}

创建线定位闪动样式

Parameters:
Name Type Description
elapsedRatio number

动画已执行时间所占比率

Source:
Returns:
  • 线定位闪动样式
Type
ol.style.Style

createPointFlashStyle(elapsedRatio, startRadius, endRadius) → {ol.style.Style}

创建点定位闪动样式

Parameters:
Name Type Description
elapsedRatio number

动画已执行时间所占比率

startRadius number

起始圆半径

endRadius number

结束圆半径

Source:
Returns:
  • 点定位闪动样式
Type
ol.style.Style

getFlashStyle() → {ol.style.Style}

获取定位层动画样式

Source:
Returns:
Type
ol.style.Style

getLocateLayer() → {ol.layer.Base}

获取定位图层

Source:
Returns:
Type
ol.layer.Base

getLocateSource() → {ol.source.Source}

获取定位图层数据源

Source:
Returns:
Type
ol.source.Source

getLsStrokeColor() → {string}

获取线定位颜色值

Source:
Returns:
Type
string

getMapViewer() → {wol.MapViewer}

获取wol地图实例

Source:
Returns:
Type
wol.MapViewer

getPiFillColor() → {string}

获取点定位填充颜色值

Source:
Returns:
Type
string

getPiRadius() → {string}

获取点定位半径

Source:
Returns:
Type
string

getPiStrokeColor() → {string}

获取点定位描边颜色值

Source:
Returns:
Type
string

getPlFillColor() → {string}

获取面定位填充颜色值

Source:
Returns:
Type
string

getPlStrokeColor() → {string}

获取面定位描边颜色值

Source:
Returns:
Type
string

getStaticStyle() → {ol.style.Style}

获取定位层静态样式

Source:
Returns:
Type
ol.style.Style

locate(feature, option)

定位要素

Parameters:
Name Type Description
feature ol.Feature

待定位要素

option object

参数项

Properties
Name Type Description
duration number

动画持续时间,可选参数,默认为0

times number

动画循环次数,可选参数,默认为3

autoView boolean

执行定位动画的同时是否自适应视图,默认为true

Source:

locateLineString(feature, duration)

定位线要素

Parameters:
Name Type Description
feature ol.Feature

待定位要素

duration number

动画持续时间,可选参数,默认为0

Source:

locatePoint(feature, duration)

定位点要素

Parameters:
Name Type Description
feature ol.Feature

待定位要素

duration number

动画持续时间,可选参数,默认为0

Source:

locatePolygon(feature, duration)

定位面要素

Parameters:
Name Type Description
feature ol.Feature

待定位要素

duration number

动画持续时间,可选参数,默认为0

Source:

locateProxy(feature, duration, times, autoView)

定位要素的代理方法,根据要素类型执行不同的定位动画:Point、LineString、Polygon

Parameters:
Name Type Description
feature ol.Feature

待定位要素

duration number

动画持续时间,可选参数,默认为0

times number

动画次数,可选参数,默认为3

autoView boolean

是否移动视图至要素,默认为true

Source:

setFlashStyle(style)

设置定位层动画样式

Parameters:
Name Type Description
style ol.style.Style
Source:

setStaticStyle(style)

设置定位层静态样式

Parameters:
Name Type Description
style ol.style.Style
Source: