new ol.style.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>}
src/ol/style/icon.js, line 208 -
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){Image|HTMLCanvasElement}
src/ol/style/icon.js, line 266 -
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>}
src/ol/style/icon.js, line 307 -
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.
-
Determine whether the symbolizer should be snapped to a pixel.
Returns:
The symbolizer should snap to a pixel.
-
getSrc(){string|undefined}
src/ol/style/icon.js, line 339 -
Get the image URL.
Returns:
Image src.
-
load()
src/ol/style/icon.js, line 370 -
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.
-
Set the opacity.
Name Type Description opacity
number Opacity.
-
Set the rotation.
Name Type Description rotation
number Rotation.
-
Set the scale.
Name Type Description scale
number Scale.