【问题标题】:OpenLayers 3 Stroke styleOpenLayers 3 Stroke 风格
【发布时间】:2015-04-30 05:02:31
【问题描述】:

我想修改方法 select 的样式。我可以更改此方法的样式,但无法复制蓝色笔划的白色边框。

有人能够用笔画设置矢量样式并为笔画添加边框吗?

请参阅此示例,以了解我在说什么: http://openlayers.org/en/v3.4.0/examples/select-features.html

【问题讨论】:

    标签: styles openlayers-3 stroke


    【解决方案1】:

    诀窍是你有两种风格。使用第一种样式绘制一条白线,使用第二种样式在顶部绘制一条较细的蓝线:

    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
        })
      })
    ];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多