Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Openlayers:this.addOptions不是函数_Openlayers_Wms - Fatal编程技术网

Openlayers:this.addOptions不是函数

Openlayers:this.addOptions不是函数,openlayers,wms,Openlayers,Wms,我目前正在尝试让OpenLayers显示WMS层。 这样做我会遇到一个我无法解决的问题。这甚至可能是OpenLayers中的一个错误,但在他们的跟踪系统中填写适当的错误报告之前,我想让舒尔知道错误不是我的 这是产生错误的最小示例: <html> <head> <script src="../javascript/openlayers/lib/OpenLayers.js"></script> </head> <body>

我目前正在尝试让OpenLayers显示WMS层。 这样做我会遇到一个我无法解决的问题。这甚至可能是OpenLayers中的一个错误,但在他们的跟踪系统中填写适当的错误报告之前,我想让舒尔知道错误不是我的

这是产生错误的最小示例:

<html>
<head>
    <script src="../javascript/openlayers/lib/OpenLayers.js"></script>
</head>
<body>
    <div style="width:100%; height:100%" id="map"></div>
    <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map( 'map' );

        var layer = OpenLayers.Layer.WMS( "mymap", 
                                          "http://192.168.1.1/cgi-bin/mapserv",
                                          {layers: 'buildings', map: 'map=/var/public/maps/mapfile.map'}
                    );
        map.addLayer(layer);
        map.zoomToMaxExtent();
    </script>
</body>
</html>
使用Firefox5.0和Ubuntu Natty

我也可以提供相应的映射文件,但是这个错误在我看来像是JavaScript问题,因此只要没有人请求,我就不告诉你细节


感谢您的支持和想法。

好吧,OpenLayers用户邮件列表,或者更好的是Bart van den Eijnden,提供了答案——我有点不好意思发布这个答案。。。 无论如何:

OpenLayers.Layer.WMS前面缺少新关键字

this.addOptions is not a function