百度地图开发:多边形覆盖物的背景颜色等样式设置

//添加多边形**********************************************************************
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);   //增加多边形


 
   
   
   
   
  1. strokeColor:"red",      //边线颜色。  
  2.             fillColor:"red",        //填充颜色。当参数为空时,圆形将没有填充效果。  
  3.             strokeWeight: 3,        //边线的宽度,以像素为单位。  
  4.             strokeOpacity: 0.8,     //边线透明度,取值范围0 - 1。  
  5.             fillOpacity: 0.3,       //填充的透明度,取值范围0 - 1。  
  6.             strokeStyle: 'solid'    //边线的样式,solid或dashed。  
  7.         },

你可能感兴趣的:(百度地图开发)