我對此完全陌生,我正在嘗試更改地圖上標記的顏色。
export const addMarkerLayer = (olMap, coordinate) => {
const sourceMarker = new VectorSource({
features: [new Feature(new Point(coordinate))],
})
const vectorMarker = new VectorLayer({
source: sourceMarker
})
olMap.addLayer(vectorMarker)
return null
謝謝您的幫助
我嘗試了很多東西但沒有任何效果..
你能幫我嗎?謝謝
uj5u.com熱心網友回復:
const vectorMarker = new VectorLayer({
source: sourceMarker
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.5)'
}),
stroke: new ol.style.Stroke({
color: 'rgba(255,255,0,1)'
width: 5
})
})
olMap.addLayer(vectorMarker)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/527672.html
上一篇:如何將PySpark資料框轉換為字典:第一列作為主鍵,其他列及其內容鍵值對?
下一篇:在Tcl中將字串轉換為數學函式
