【发布时间】:2019-10-11 07:51:21
【问题描述】:
更新
当我使用默认图层时,图层显示在地图中。但我正在尝试自定义层。那是工作。在创建工作空间时创建 postgis 连接、命名空间和所有内容时有什么需要注意的吗?
var points = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: 'http://localhost:8086/geoserver/test/wms',
params: {
'LAYERS': 'test:points_data',
'VERSION': '1.1.0'
},
serverType: 'geoserver'
})
});
在geoserver中我可以访问图层。
我正在使用 Tomcat 9.0_Tomcat9.1 OpenLayers-2.13.1 geoext2-2.1.0
编辑:
我更新了 openlayer 版本
<script src="https://openlayers.org/en/v4.6.5/build/ol.js"></script>
但还是有同样的错误
响应是空白图像 console inspected
【问题讨论】:
-
您显示的代码适用于 OpenLayers 3 或更高版本。如果您使用的是 OpenLayers 2.13.1,则不会
-
那没用,我更新了 openlayer 版本
-
返回空白图片
标签: gis openlayers geoserver