Для вывода карты написал следующий код:
Код: Выделить всё
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Basic Single WMS Example</title>
<link rel="stylesheet" href="OpenLayers-2.7/theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="OpenLayers-2.7/examples/style.css" type="text/css" />
<script src="OpenLayers-2.7/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map( 'map' );
layer = new OpenLayers.Layer.WMS( "naspunkt",
"http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/naspunkt.map&service=WMS", {layers: 'naspunkt'} );
map.addLayer(layer);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title">Basic Single WMS Example</h1>
<div id="tags"></div>
<div id="shortdesc">Show a Simple Map</div>
<div id="map" class="smallmap"></div>
<div id="docs">
This example shows a very simple layout with minimal controls. This example uses a single WMS base layer.
</div>
</body>
</html>
Пподключал как WMS-сервис в программе Qgis, карта отображается без проблем.
Где я сделал ошибку? Проекция слоя EPSG 4326.