Reputation: 464
I'm using OpenLayers 3 since a short time. I've finished an application include of map with OpenLayers 3 ten days ago. But today I checked the application that, styles no longer work on KML
. Does anyone have any idea?
var layer1 = new ol.layer.Vector({
source: new ol.source.KML(({
url: '#',
projection: 'EPSG:900913'
}))
, style: [new ol.style.Style({
stroke: new ol.style.Stroke({ color: 'black', width: 10 })
})]
});
Upvotes: 1
Views: 1662
Reputation: 2376
Yes, there’s been a change in the library: [1] now feature styles has precedence over layer style. To make your code works, tell your format not to extract styles from the KML like in [2]:
source: new ol.source.KML(({
extractStyles: false,
url: '#',
projection: 'EPSG:900913'
}))
Upvotes: 2