我是使用 HTML 创建地图的新手,我一直在尝试将两个矢量图层(地点、点)添加到基本地图(道路)中,但是我看不到地图上的矢量图层。图层应显示为基本地图的矢量叠加层。图层在那里,因为它们在图层切换器中显示,但没有显示在屏幕上。我认为问题与调用向量层的方式有关。什么是要显示矢量图层的解决方案。谢谢
var map = new OpenLayers.Map("map-id");
var roads= new OpenLayers.Layer.WMS(
"roads",
"http://localhost:8080/geoserver/wms",
{layers: "roads"});
var points= new OpenLayers.Layer.Vector(
"points",
"http://localhost:8080/geoserver/wms",
{layers: "points"});
var places= new OpenLayers.Layer.Vector(
"places",
"http://localhost:8080/geoserver/wms",
{layers: "places"});
map.addLayer(roads);
map.addLayer(points);
map.addLayer(places);
map.addControl(new OpenLayers.Control.LayerSwitcher());