是否可以为 OpenLayers.Layer.WMS 添加边界
我创建了一个 OpenLayers.Layer.WMS,我可以查看我期望叠加的图片。但它遍布整个地图。请检查下面的代码并让我知道我在哪里犯了错误。
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
"http://4.bp.blogspot.com/_lxtIPm_77I0/TJgxuFj5VqI/AAAAAAAAAW0/5QgltGCSviU/s1600/yellowrose.jpg",
{
layers: "basic",
transparent: "true",
format: "image/png"
}, {
opacity: 0.3,
singleTile: true,
maxExtent: new OpenLayers.Bounds(-74.047185, 40.679648, -50.907005, 30.882078)
}
);
I have created a OpenLayers.Layer.WMS and i can able to view the picture which i expected to be on overlay. But its spreads allover the map. Please check my code below and let me know where i did the mistake.
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
"http://4.bp.blogspot.com/_lxtIPm_77I0/TJgxuFj5VqI/AAAAAAAAAW0/5QgltGCSviU/s1600/yellowrose.jpg",
{
layers: "basic",
transparent: "true",
format: "image/png"
}, {
opacity: 0.3,
singleTile: true,
maxExtent: new OpenLayers.Bounds(-74.047185, 40.679648, -50.907005, 30.882078)
}
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想使用图像作为图层 - 请使用 图层。改为 Image 对象。 WMS 层用于使用动态地图服务,而不是静态图像。
If you want to use an image as a layer - use the Layer.Image object instead. The WMS layer is for using a dynamic map service, not a static image.