API / geotoolkit / util / Helpers / Helpers
This class contains various helpers methods
Constructors
Methods
▸ getClassName(): string
string
▸ Static createFillStyleFromObject(object?): FillStyle
Create or get fill style from object
| Name | Type | Description |
|---|---|---|
Optional object | Type | object can be in format of constructor FillStyle |
▸ Static getClassName(): string
string
▸ Static mergeFillStyleFromObject(node, fillStyle, object, merge?, invalidateMethod?): FillStyle
Merge css fillstyle object with existing instance
Example
import {Shape} from '@int/geotoolkit/scene/shapes/Shape';
import {Helpers} from '@int/geotoolkit/util/Helpers';
import {FillStyle} from '@int/geotoolkit/attributes/FillStyle';
class CustomSymbol extends Shape {
...
setFillStyle(fillStyle, merge) {
fillStyle = Helpers.mergeFillStyleFromObject(this, this.getFillStyle(), fillStyle, merge);
return Shape.prototype.setLFillStyle.call(this, fillStyle);
}
...
}
const imgPattern = PatternFactory.getInstance().createPattern(imgurl);
const symbol = new CustomSymbol(new Rect(50, 50, 150, 150))
.setFillStyle({
'color': KnownColors.Orange
})
.setFillStyle({
'pattern': imgPattern
}, true);| Name | Type | Description |
|---|---|---|
node | IStyleListener | node |
fillStyle | FillStyle | instance of node property |
object | Type | contains fill style |
Optional merge | boolean | merge flag |
Optional invalidateMethod | AttributeCallback<EventDispatcher> | invalidate method |
fillStyle