OpenLayers 添加网格信息

OpenLayers 官网提供了自带的属性添加网格信息,当地图作为底图时,如果添加了过多的图层,各图层之间由于冲突不会显示出来,下面的方法能很好的解决。

代码如下:

var graticuleLayer = new ol.Graticule({
strokeStyle: new ol.style.Stroke({
color: 'rgba(12, 12, 12, 0.8)',
width: 0.6
}),
targetSize: 100
});
graticuleLayer.setMap(map);

猜你喜欢

转载自www.cnblogs.com/04180821liu/p/9477448.html