百度地圖開發:多邊形覆蓋物的背景顏色等樣式設定
阿新 • • 發佈:2019-01-10
//新增多邊形********************************************************************** var polygon_nc = new BMap.Polygon([ new BMap.Point(120.333027, 31.532335), new BMap.Point(120.311899, 31.550431), new BMap.Point(120.326991, 31.5652), new BMap.Point(120.355018, 31.557324), new BMap.Point(120.354586, 31.537013) //第五個座標點 //new BMap.Point(120.351424, 31.541199), //6 //new BMap.Point(120.346538, 31.556831), //7 //new BMap.Point(120.331302, 31.568154), //8 //new BMap.Point(120.286746, 31.557077), //new BMap.Point(120.274386, 31.538244) //new BMap.Point(120.331302, 31.568154) ], {strokeColor:"green",fillColor:"red",fillColorOpacity:"0.4", strokeWeight:2, strokeOpacity:0.3}); //建立多邊形 map.addOverlay(polygon_nc); //增加多邊形
- strokeColor:"red", //邊線顏色。
- fillColor:"red", //填充顏色。當引數為空時,圓形將沒有填充效果。
- strokeWeight: 3, //邊線的寬度,以畫素為單位。
- strokeOpacity: 0.8, //邊線透明度,取值範圍0 - 1。
- fillOpacity: 0.3, //填充的透明度,取值範圍0 - 1。
- strokeStyle: 'solid' //邊線的樣式,solid或dashed。
- },