new ol.style.Icon(opt_options) experimental
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Extends
Methods
-
Clones the style.
Returns:
The cloned style.
-
getAnchor(){Array.<number>} experimental
src/ol/style/icon.js, line 221 -
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} experimental
src/ol/style/icon.js, line 278 -
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>} experimental
src/ol/style/icon.js, line 320 -
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} experimental
src/ol/style/icon.js, line 352 -
Get the image URL.
Returns:
Image src.
-
load() experimental
src/ol/style/icon.js, line 382 -
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.
Type Definitions
-
ol.style.Icon.AnchorUnits{string}
-
Icon anchor units. One of 'fraction', 'pixels'.
-
ol.style.Icon.Origin{string}
-
Icon origin. One of 'bottom-left', 'bottom-right', 'top-left', 'top-right'.