class
SimpleRenderer
implements IRenderer
Applies the same symbol to every feature. Use when all features should look identical.
Constructor
new SimpleRenderer(symbol: Symbol) | Parameter | Type | Description | |
|---|---|---|---|
symbol | Symbol | required | PointSymbol | LineSymbol | PolygonSymbol | ModelSymbol |
Properties
| Name | Type | Access | Description |
|---|---|---|---|
type | 'simple' | readonly | Renderer type discriminant |
symbol | Symbol | readonly | The uniform symbol applied to all features |
Methods
getSymbol()
getSymbol(feature: Feature, context?: SymbolRenderContext): Symbol Always returns the constructor symbol.
Returns
Symbol Example
const renderer = new SimpleRenderer({
type: 'simple-marker',
color: [255, 0, 0, 255],
size: 8,
});
const layer = new GeoJSONLayer({
url: '/data/cities.geojson',
});
layer.renderer = renderer;