实际上,我只需要地图的全部功能,但没有瓷砖,没有他们的服务器请求。我可以在初始加载时跳过它们吗?有没有可以设置的默认参数?如果没有,我将自己制作补丁,但我不确定它是否还没有完成。
发布于 2009-07-23 08:34:23
我粘贴在这里的代码为您提供了一个具有无法加载的虚拟层的openlayer接口。虽然我不明白您为什么要这样做,但它确实显示了一个空的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>
发布于 2010-04-05 17:02:12
发布于 2012-05-07 19:08:35
layer = new OpenLayers.Layer.OSM("Transparent","/img/1x1_transparent.png", {numZoomLevels: 19}, {isBaseLayer:true});
只需使用一个本地单一的,微小的,透明的png磁贴。
https://stackoverflow.com/questions/1153472
复制