new Icon(opt_options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Extends
Methods
-
Clones the style. The underlying Image/HTMLCanvasElement is not cloned.
Returns:
The cloned style.
-
getAnchor(){Array.<number>}
style/Icon.js, line 231 -
Get the anchor point in pixels. The anchor determines the center point for the symbolizer.
Returns:
Anchor.
-
Get the icon color.
Returns:
Color.
-
getImage(pixelRatio){HTMLImageElement|HTMLCanvasElement}
style/Icon.js, line 299 -
Get the image icon.
Name Type Description pixelRatio
number Pixel ratio.
Returns:
Image or Canvas element.
-
Get the symbolizer opacity.
Returns:
Opacity.
-
getOrigin(){Array.<number>}
style/Icon.js, line 335 -
Get the origin of the symbolizer.
Returns:
Origin.
-
Determine whether the symbolizer rotates with the map.
Returns:
Rotate with map.
-
Get the symoblizer rotation.
Returns:
Rotation.
-
Get the symbolizer scale.
Returns:
Scale.
-
Get the size of the symbolizer (in pixels).
Returns:
Size.
-
This method is deprecated and always returns false.
- Deprecated
- Yes
Returns:
false.
-
getSrc(){string|undefined}
style/Icon.js, line 366 -
Get the image URL.
Returns:
Image src.
-
load()
style/Icon.js, line 394 -
Load not yet loaded URI. When rendering a feature with an icon style, the vector renderer will automatically call this method. However, you might want to call this method yourself for preloading or other purposes.
-
setAnchor(anchor)
style/Icon.js, line 278 -
Set the anchor point. The anchor determines the center point for the symbolizer.
Name Type Description anchor
Array.<number> Anchor.
-
Set the opacity.
Name Type Description opacity
number Opacity.
-
Set whether to rotate the style with the view.
Name Type Description rotateWithView
boolean Rotate with map.
-
Set the rotation.
Name Type Description rotation
number Rotation.
-
Set the scale.
Name Type Description scale
number Scale.
-
This method is deprecated and does nothing.
Name Type Description snapToPixel
boolean Snap to pixel?
- Deprecated
- Yes