OpenLayers 3 描边样式

8
1个回答

14

诀窍在于你有两种样式。第一种样式是画白线,第二种样式是在其上方画一条较细的蓝线:

var width = 3;
var styles = [
  new ol.style.Style({
    stroke: new ol.style.Stroke({
      color: 'white',
      width: width + 2
    })
  }),
  new ol.style.Style({
    stroke: new ol.style.Stroke({
      color: 'blue',
      width: width
    })
  })
];

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接