Openlayers 3 Openlayer 3矢量KML样式不再有效?
我很快就开始使用OpenLayers 3了。十天前,我已经完成了一个包含OpenLayers 3的地图应用程序。但今天我检查了一个应用程序,发现样式不再适用于Openlayers 3 Openlayer 3矢量KML样式不再有效?,openlayers-3,Openlayers 3,我很快就开始使用OpenLayers 3了。十天前,我已经完成了一个包含OpenLayers 3的地图应用程序。但今天我检查了一个应用程序,发现样式不再适用于KML。有人知道吗 var layer1 = new ol.layer.Vector({ source: new ol.source.KML(({ url: '#', projection: 'EPSG:900913' })) , style:
KML
。有人知道吗
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 })
})]
});
是的,库中发生了更改:[1]现在要素样式优先于图层样式。 要使代码正常工作,请告诉格式不要像[2]中那样从KML中提取样式:
source: new ol.source.KML(({
extractStyles: false,
url: '#',
projection: 'EPSG:900913'
}))
- 1:
- 2: