Чтение цвета из фичи
This commit is contained in:
parent
b4ab491074
commit
a979dd357a
@ -305,7 +305,7 @@
|
||||
function polygonBrownStyleFunction(feature, resolution) {
|
||||
return new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgb(199,136,10)',
|
||||
color: feature.get("color") ? feature.get("color") :'rgb(199,136,10)',
|
||||
width: 2,
|
||||
}),
|
||||
fill: new ol.style.Fill({
|
||||
@ -472,7 +472,7 @@
|
||||
|
||||
function createLayer(layer) {
|
||||
let newLayer;
|
||||
|
||||
console.log(layer)
|
||||
if (layer.layer_type === 'Tile') {
|
||||
newLayer = new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
@ -487,7 +487,7 @@
|
||||
format: new ol.format.GeoJSON(),
|
||||
}),
|
||||
visible: layer.is_visible,
|
||||
style: polygonBrownStyleFunction,
|
||||
style: polygonBrownStyleFunction
|
||||
});
|
||||
}
|
||||
newLayer.set('title', layer.name)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user