Get rid of extra style arrays in examples
This commit is contained in:
@@ -13,7 +13,7 @@ goog.require('ol.style.Style');
|
||||
var stroke = new ol.style.Stroke({color: 'black', width: 1});
|
||||
|
||||
var styles = {
|
||||
'square': [new ol.style.Style({
|
||||
'square': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
fill: new ol.style.Fill({color: 'blue'}),
|
||||
stroke: stroke,
|
||||
@@ -21,8 +21,8 @@ var styles = {
|
||||
radius: 80,
|
||||
angle: Math.PI / 4
|
||||
})
|
||||
})],
|
||||
'triangle': [new ol.style.Style({
|
||||
}),
|
||||
'triangle': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
fill: new ol.style.Fill({color: 'red'}),
|
||||
stroke: stroke,
|
||||
@@ -31,8 +31,8 @@ var styles = {
|
||||
rotation: Math.PI / 4,
|
||||
angle: 0
|
||||
})
|
||||
})],
|
||||
'star': [new ol.style.Style({
|
||||
}),
|
||||
'star': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
fill: new ol.style.Fill({color: 'green'}),
|
||||
stroke: stroke,
|
||||
@@ -41,13 +41,13 @@ var styles = {
|
||||
radius2: 4,
|
||||
angle: 0
|
||||
})
|
||||
})]
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
function createLayer(coordinates, styles, zIndex) {
|
||||
function createLayer(coordinates, style, zIndex) {
|
||||
var feature = new ol.Feature(new ol.geom.Point(coordinates));
|
||||
feature.setStyle(styles);
|
||||
feature.setStyle(style);
|
||||
|
||||
var source = new ol.source.Vector({
|
||||
features: [feature]
|
||||
|
||||
Reference in New Issue
Block a user