-
Name Type Description anchorArray.<number> (defaults to [0.5, 0.5]) 锚点。默认值为图标中心。
anchorOriginIconOrigin (defaults to 'top-left') 锚点原点:bottom-left、bottom-right、top-left 或 top-right。 anchorXUnitsIconAnchorUnits (defaults to 'fraction') 锚点 x 值的指定单位。
'fraction'表示 x 值是图标的比例。'pixels'表示 x 值以像素为单位。anchorYUnitsIconAnchorUnits (defaults to 'fraction') 锚点 y 值的指定单位。
'fraction'表示 y 值是图标的比例。'pixels'表示 y 值以像素为单位。colorColor | string | undefined 图标的着色颜色。如果未指定,图标将保持原样。
crossOriginnull | string | undefined 已加载图像的 crossOrigin 属性。注意如果要使用 Canvas 渲染器访问像素数据,必须提供 crossOrigin 值。详见 https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image。 referrerPolicyReferrerPolicy | undefined 已加载图像的
referrerPolicy属性。imgHTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap | undefined 图标的图像对象。
偏移量Array.<number> (defaults to [0, 0]) 图标的偏移量(像素)。正值将使图标向右和向上偏移。
opacitynumber (defaults to 1) 图标的不透明度。
widthnumber | undefined 图标宽度(像素)。不能与
scale一起使用。heightnumber | undefined 图标高度(像素)。不能与
scale一起使用。scalenumber | Size (defaults to 1) 比例。
rotateWithViewboolean (defaults to false) 图标是否随视图旋转。
rotationnumber (defaults to 0) 旋转角度(弧度,正值为顺时针)。
offsetArray.<number> (defaults to [0, 0]) 偏移量,与
size和offsetOrigin一起定义要从原始(精灵)图像中使用的子矩形。offsetOriginIconOrigin (defaults to 'top-left') 偏移原点:bottom-left、bottom-right、top-left 或 top-right。 sizeSize | undefined 图标尺寸(像素)。与
offset一起使用,以定义要从原始(精灵)图像中使用的子矩形。srcstring | undefined 图像源 URI。
declutterModeDeclutterMode | undefined 去重模式。
Extends
Methods
-
克隆样式。 The underlying Image/HTMLCanvasElement is not cloned.
返回值:
The cloned style.
-
获取锚点(像素)。锚点决定符号化器的中心点。
返回值:
锚点。
-
获取icon color.
返回值:
颜色。
-
获取形状的去重叠模式
返回值:
Shape's declutter mode
-
获取偏移量 of the shape
返回值:
Shape's center 偏移量
-
获取图标高度(像素)。当图标图像尚未加载时返回 undefined。
返回值:
Icon height (in pixels).
-
getImage(pixelRatio){HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap}
-
获取image icon.
Name Type Description pixelRationumber 像素比。
返回值:
Image or Canvas element. If the Icon style was configured withsrcor with a not let loadedimg, anImageBitmapwill be returned.
-
获取symbolizer opacity.
返回值:
不透明度。
-
获取origin of the symbolizer.
返回值:
Origin.
-
获取pixel ratio.
Name Type Description pixelRationumber 像素比。
返回值:
The pixel ratio of the image.
-
判断符号化器是否随地图旋转。
返回值:
随地图旋转。
-
获取symoblizer rotation.
返回值:
旋转角度。
-
获取symbolizer scale.
返回值:
比例。
-
获取图标大小(像素)。
返回值:
Image size.
-
获取image URL.
返回值:
Image src.
-
获取图标宽度(像素)。当图标图像尚未加载时返回 undefined。
返回值:
Icon width (in pixels).
-
加载尚未加载的 URI。当使用图标样式渲染要素时,矢量渲染器将自动调用此方法。但是,您可能需要自行调用此方法进行预加载或其他目的。
-
设置anchor point. The anchor determines the center point for the symbolizer.
Name Type Description anchorArray.<number> 锚点。
-
设置偏移量.
Name Type Description 偏移量Array.<number> 偏移量。
-
设置不透明度。
Name Type Description opacitynumber 不透明度。
-
设置样式是否随视图旋转。
Name Type Description rotateWithViewboolean 随地图旋转。
-
设置旋转角度。
Name Type Description rotationnumber 旋转角度。
-
设置比例。
Name Type Description scalenumber | Size 比例。
-
设置image URI
Name Type Description srcstring 图像源 URI