命名空间
- Source:
Members
-
<static> styles
-
通用样式库
- Source:
Properties:
Name Type Description DEFAULT_STYLEol.style.Style 默认样式
TEXT_STYLEol.style.Style 文本样式
MASK_BLACKol.style.Style 黑色遮罩样式
Methods
-
<static> createClusterLayer(option) → {ol.layer.Vector}
-
创建聚合图层
Parameters:
Name Type Description optionobject 配置项
Properties
Name Type Description namestring | undefined 图层名称,默认为 undefined
labelstring 图层说明,默认为 ''
styleFunctionol.StyleFunction 图层样式函数, 携带feature和resolution两个参数,此函数应返回一个ol.style.Style对象或其数组,由此为单个要素及聚合要素显示不同的样式
featuresArray 图层默认要素,默认为 []
updateWhileAnimatingboolean 动画执行过程是否实时渲染要素,默认为 true
updateWhileInteractingboolean 交互过程是否实时渲染要素,默认为 false
opacitynumber 图层透明度,默认为 1
visibleboolean 图层可见性,默认为 true
zIndexnumber | undefined 图层序号,默认为 undefined
groupstring | undefined 图层所属图层组,默认为 undefined 即不属于任何组
- Source:
Returns:
- 矢量聚合图层
- Type
- ol.layer.Vector
-
<static> createFeatureFromWKT(wkt) → {ol.Feature}
-
从WKT字符串中解析要素
Parameters:
Name Type Description wktstring 要素的wkt描述(关于wkt请参见:http://www.cnblogs.com/tiandi/archive/2012/07/18/2598093.html)
- Source:
Returns:
- 要素对象
- Type
- ol.Feature
-
<static> createHeatMap(option) → {ol.layer.Heatmap}
-
创建热力图层
Parameters:
Name Type Description optionobject 配置项
Properties
Name Type Description namestring | undefined 图层名称,默认为 undefined
labelstring 图层说明,默认为 ''
featureArray 图层默认要素,默认为 []
gradientArray 热力图层的色彩渐层颜色,默认为 ['#0ff', '#00f', '#0f0', '#ff0', '#ff5d3e']
blurnumber 模糊值,默认为 24
radiusnumber 非聚合状态下最小半径,默认为 10
shadownumber 阴影值,默认为 300
opacitynumber 图层透明度,默认为 1
visibleboolean 图层可见性,默认为 true
zIndexnumber | undefined 图层序号,默认为 undefined
groupstring | undefined 图层所属图层组,默认为 undefined 即不属于任何组
- Source:
Returns:
- 热力图层
- Type
- ol.layer.Heatmap
-
<static> createMaskLayer(option) → {ol.layer.Vector}
-
创建遮罩图层
Parameters:
Name Type Description optionobject 配置项
Properties
Name Type Description namestring 图层名称,默认为 undefined
labelstring 图层说明,默认为 ''
styleol.style.Style 图层样式,默认为 wol.util.styles.MASK_BLACK
updateWhileAnimatingboolean 动画执行过程是否实时渲染要素,默认为 true
updateWhileInteractingboolean 交互过程是否实时渲染要素,默认为 true
opacitynumber 图层透明度,默认为 1
visibleboolean 图层可见性,默认为 false
zIndexnumber 图层序号,默认为 1
groupstring | undefined 图层所属图层组,默认为 undefined 即不属于任何组
- Source:
Returns:
- 矢量图层
- Type
- ol.layer.Vector
-
<static> createVectorLayer(option) → {ol.layer.Vector}
-
创建矢量图层
Parameters:
Name Type Description optionobject 配置项
Properties
Name Type Description namestring | undefined 图层名称,默认为 undefined
labelstring 图层说明,默认为 ''
styleol.style.Style 图层样式,默认为 wol.util.styles.DEFAULT_STYLE
featuresArray 图层默认要素,默认为 []
updateWhileAnimatingboolean 动画执行过程是否实时渲染要素,默认为 true
updateWhileInteractingboolean 交互过程是否实时渲染要素,默认为 false
useSpatialIndexboolean 是否开启空间索引,默认为 false
opacitynumber 图层透明度,默认为 1
visibleboolean 图层可见性,默认为 true
zIndexnumber | undefined 图层序号,默认为 undefined
groupstring | undefined 图层所属图层组,默认为 undefined 即不属于任何组
- Source:
Returns:
- 矢量图层
- Type
- ol.layer.Vector
-
<static> createWKTFromFeature(feature) → {string}
-
导出要素为WKT字符串
Parameters:
Name Type Description featureol.Feature 要素对象
- Source:
Returns:
- 要素的wkt描述
- Type
- string
-
<static> createWMSLayer(option) → {ol.layer.Tile}
-
创建网络地图图层
Parameters:
Name Type Description optionobject 配置项
Properties
Name Type Description namestring 图层名称,默认为 undefined
labelstring 图层说明,默认为 ''
urlstring 网络地图服务地址
paramsobject WMS必须参数,其中必须包含 LAYERS
serverTypestring | undefined 远程网络地图服务类型,可选值为'carmentaserver', 'geoserver', 'mapserver', 'qgis',默认为 undefined
maxZoomnumber 图层的最大缩放等级
opacitynumber 图层透明度,默认为 1
visibleboolean 图层可见性,默认为 true
zIndexnumber 图层序号,默认为 undefined
groupstring | undefined 图层所属图层组,默认为 undefined 即不属于任何组
- Source:
Returns:
- WMS图层
- Type
- ol.layer.Tile
-
<static> createXYZLayer(option) → {ol.layer.Tile}
-
创建XYZ图层
Parameters:
Name Type Description optionobject 配置项
Properties
Name Type Description namestring 图层名称,默认为 undefined
labelstring 图层说明,默认为 ''
urlstring 切片服务地址
crossOriginstring | undefined 请求类型,'anonymous' 或 undefined,默认为 undefined;设置为'anonymous'时请求类型变为跨域请求,但切片服务器必须进行跨域设置
minZoomnumber | undefined 图层的最小缩放等级,默认为 undefined
maxZoomnumber | undefined 图层的最大缩放等级,超过该等级不再请求新的瓦片,默认为 undefined
opacitynumber 图层透明度,默认为 1
visibleboolean 图层可见性,默认为 true
zIndexnumber 图层序号,默认为 undefined
groupstring | undefined 图层所属图层组,默认为 undefined 即不属于任何组
- Source:
Returns:
- 切片图层
- Type
- ol.layer.Tile
-
<static> extend(arg) → {object}
-
对象扩展(jQuery extend机制)
Parameters:
Name Type Description argboolean | object 可变参数,你可以传入任意个参数将它们合并为一个对象;当不传入任何参数或者只有一个参数且类型不是对象,或者该参数为布尔值时将返回空对象;当参数个数大于等于两个时,
若第一个参数类型不是布尔值或为 false ,将返回后续参数的浅拷贝合并,否则返回第一个参数后续参数的深拷贝合并- Source:
Returns:
- 扩展后的对象
- Type
- object
-
<static> getColorArray(color) → {Array}
-
获取颜色值数组
Parameters:
Name Type Description colorstring 颜色字符串表示
- Source:
Returns:
- 颜色RGB数组
- Type
- Array
-
<static> getColorType(colorStr) → {string}
-
获取颜色表示类型
Parameters:
Name Type Description colorStrstring 颜色字符串表示
- Source:
Returns:
- RGB/十六进制
- Type
- string
-
<static> splitCoordinates(sourceCoords, step) → {Array.<ol.Coordinate>}
-
拆分坐标点数组,在两两坐标点之间按均匀步长生成密集的坐标点
Parameters:
Name Type Description sourceCoordsArray.<ol.Coordinate> 原始坐标点数组
stepnumber 步长(沿线方向)
- Source:
Returns:
- Type
- Array.<ol.Coordinate>
-
<static> toHexColor(rgbStr) → {string}
-
将rgb颜色值转换为16进制形式
Parameters:
Name Type Description rgbStrstring 颜色RGB字符串表示
- Source:
Returns:
- 颜色16进制字符串表示
- Type
- string
-
<static> toRGBColor(hexStr) → {string}
-
将16进制颜色值转换为rgb形式
Parameters:
Name Type Description hexStrstring 颜色16进制字符串表示
- Source:
Returns:
- 颜色RGB字符串表示
- Type
- string
-
<static> transform(feature, from, to)
-
对要素进行坐标转化
Parameters:
Name Type Description featureol.Feature 待转换要素
fromol.proj.ProjectionLike 转换前投影坐标系
tool.proj.ProjectionLike 转换后投影坐标系
- Source:
WolMap