簡體   English   中英

OpenLayers 3中風風格

[英]OpenLayers 3 Stroke style

我想修改方法select的樣式。 我能夠改變這種方法的風格,但我無法復制藍色筆划的白色邊框。

有人能夠用筆划設置矢量樣式並為筆划設置邊框嗎?

請參閱此示例,了解我在說什么: http//openlayers.org/en/v3.4.0/examples/select-features.html

訣竅是你有兩種風格。 第一種風格是繪制白色線條,第二種風格是頂部更細的藍線:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM