在 openlayers 代码中添加visibility: false 的位置?
我想知道在下面的代码中哪里可以添加 visibility: false : 就像第二个代码一样?
var line_10 = new OpenLayers.Layer.GML("Line nr-10",
"lines/line_10.kml",
{
format: OpenLayers.Format.KML,
style: {strokeWidth: 4, strokeColor: "#f08080", fillOpacity: 1 },
projection: map.displayProjection
}
);
第二个代码:
var linja4_2 = new OpenLayers.Layer.Vector("Line nr-4 stations", {
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "/data/linja-nr4.kml",
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true
})
}),
visibility: false
});
I wanted to know where can I add visibility: false in the code below:
Just like in second code ?
var line_10 = new OpenLayers.Layer.GML("Line nr-10",
"lines/line_10.kml",
{
format: OpenLayers.Format.KML,
style: {strokeWidth: 4, strokeColor: "#f08080", fillOpacity: 1 },
projection: map.displayProjection
}
);
Second Code:
var linja4_2 = new OpenLayers.Layer.Vector("Line nr-4 stations", {
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "/data/linja-nr4.kml",
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true
})
}),
visibility: false
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,我会将
visibility
放在这里:或者按照评论中的建议:
If I remember correctly I would put the
visibility
here:Or as suggested in the comments: