注册 登录
编程论坛 J2EE论坛

新手,求大神给代码实现多边形内的白色半透明层给去掉。

maseo123 发布于 2014-10-11 09:34, 2449 次点击
//创建经纬度数组  冼村街道
var xiancunCenter = new BMap.Point(113.340128,23.128283);
var xiancun = [new BMap.Point(113.327839,23.133434),new BMap.Point(113.327696,23.118844),new BMap.Point(113.349722,23.116584),new BMap.Point
(113.350153,23.131939)];
//创建多边形
var xiancunPolygon = new BMap.Polygon(xiancun, {strokeColor:"blue", strokeWeight:5, strokeOpacity:0.5});
//添加多边形到地图上     
map.addOverlay(xiancunPolygon);
xiancunPolygon.addEventListener("mouseover",function(){    xiancunPolygon.setStrokeColor("red");});
xiancunPolygon.addEventListener("mouseout",function(){    xiancunPolygon.setStrokeColor("blue");});
xiancunPolygon.addEventListener("click",function(){    map.zoomIn();    xiancunPolygon.setStrokeColor("red");    map.setCenter(xiancunCenter);});
var xiancunLabel2 = new BMap.Label("冼村",{offset: new BMap.Size(10,-20), position: xiancunCenter});xiancunLabel2.setStyle({"padding":  
"2px"});map.addOverlay(xiancunLabel2);

2 回复
#2
hhwz2014-10-13 15:41
百度地图 ? 这个看下 百度地图的API就好了
#3
wangzijiushi2015-05-16 21:50
1