开发者

Is it possible to add bounds for the OpenLayers.Layer.WMS

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 wher开发者_开发技巧e 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)
    }
);


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜