Gis 添加覆盖WMS时出错
我是地理信息系统新手,正在编写openLayer教程 以下是HTML代码:Gis 添加覆盖WMS时出错,gis,openlayers,Gis,Openlayers,我是地理信息系统新手,正在编写openLayer教程 以下是HTML代码: <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="msapplication-tap-highlight" content="no" />
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div class="app">
<div style="width:100%; height:100%" id="map"></div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</body>
</html>
})
在浏览器中查看:
我得到这个错误:
http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?LAYERS=bathymetry%2Cland_fn%2…EST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=-180,-90,0,90&WIDTH=256&HEIGHT=256 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
如果我从javascript中删除以下行:
var dm_wms = new OpenLayers.Layer.WMS(
"Canadian Data",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{
layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true",
format: "image/png"
},
{ isBaseLayer: false }
);
我在浏览器上看到这个视图:
你知道为什么我在覆盖一层时会出现上述错误吗?服务器“”似乎已关闭,请尝试使用其他WMS,如
var dm_wms = new OpenLayers.Layer.WMS(
"Canadian Data",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{
layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true",
format: "image/png"
},
{ isBaseLayer: false }
);
var dm_wms = new OpenLayers.Layer.WMS(
"OSM example",
"http://129.206.228.72/cached/osm?",
{
layers: "osm_auto:all"
transparent: "true",
format: "image/png"
},
{ isBaseLayer: false }
);