new FeatureRenderer()
A component that renders a `ol.style.Style` with an optional `ol.Feature`.
- Source:
Example
preview
var poly = Ext.create('GeoExt.component.FeatureRenderer', {
symbolizers: new ol.style.Style({
fill: new ol.style.Fill({color: 'red'})
})
});
var line = Ext.create('GeoExt.component.FeatureRenderer', {
symbolizers: new ol.style.Style({
stroke: new ol.style.Stroke({color: 'orange', width: 3}),
}),
symbolType: 'Line'
});
var point = Ext.create('GeoExt.component.FeatureRenderer', {
symbolizers: new ol.style.Style({
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({color: 'gray'}),
stroke: new ol.style.Stroke({color: 'black', width: 3}),
})
}),
symbolType: 'Point'
});
var star = Ext.create('GeoExt.component.FeatureRenderer', {
symbolizers: new ol.style.Style({
image: new ol.style.RegularShape({
fill: new ol.style.Fill({color: 'blue'}),
stroke: new ol.style.Stroke({color: 'green', width: 3}),
points: 7,
radius: 15,
radius2: 7,
angle: 0
})
}),
minWidth: 40,
minHeight: 40,
symbolType: 'Point'
});
Ext.create('Ext.panel.Panel', {
title: 'Rendering of ol.Features in a panel',
items: [poly, line, point, star],
border: false,
renderTo: Ext.getBody()
});
Methods
(static) initComponent()
Initialize the GeoExt.component.FeatureRenderer.
- Source:
(static) update(options)
Update the `feature` or `symbolizers` and redraw the feature.
Valid options:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Object with properties to be updated.
Properties
|
- Source: