实际上,我只需要地图的全部功能,但没有瓷砖,也不需要向服务器发出请求。我可以在初始加载时以某种方式跳过它们吗?我可以设置任何默认参数吗?如果没有,我会自己制作补丁,但我不确定它还没有完成。
问问题
1462 次
3 回答
1
layer = new OpenLayers.Layer.OSM("Transparent","/img/1x1_transparent.png", {numZoomLevels: 19}, {isBaseLayer:true});
只需使用本地单个、微小、透明的 png 瓷砖。
于 2012-05-07T19:08:34.520 回答
1
我在此处粘贴的代码为您提供了带有无法加载的虚拟层的 openlayers 接口。虽然我不明白你为什么想要这个,但这确实显示了一个空的 OpenLayers 地图窗口。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Standalone</title>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map( 'map' );
layer = new OpenLayers.Layer.WMS( "dummy",
"",
{layers: 'basic'} );
map.addLayer(layer);
//map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<h1 id="title">Basic Single WMS Example</h1>
<div id="map" style="width:250px;height:250px"></div>
<div id="docs">
</div>
</body>
</html>
于 2009-07-23T16:34:23.207 回答
1
于 2010-04-05T17:02:11.637 回答