我有一个具有这种配置的 TileCache 服务器:
[cache]
type=Disk
base=/var/maps/cache
[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
bbox=-180.0,-90,180.0,90
srs=EPSG:4326
[oge]
type=MapServerLayer
mapfile=/var/maps/defs/OGE.map
layers=OGETransLines
我正在使用 OpenLayers 来显示数据,目前我正在请求带有 OpenLayers.Layer.TMS 对象的“osm”层和带有 OpenLayers.Layer.WMS 对象的“oge”层。有没有办法将两者合并在一起并同时请求它们?到目前为止,我只能使用 TMS 获得“osm”层。
编辑:我的 Javascript 使事情更清楚:
map = new OpenLayers.Map("mapDiv",
{
projection: epsg4326,
maxResolution: 360 / 512
});
baseLayer = new OpenLayers.Layer.TMS("TarigmaOSM",
"http://1.1.1.1/cgi-bin/tilecache/tilecache.cgi/",
{
serviceVersion: "1.0.0",
layername: "osm",
type: "png",
attribution: "Data CC-by-SA OpenStreetMap"
});
map.addLayer(baseLayer);
overlay = new OpenLayers.Layer.WMS("Overlay",
"http://1.1.1.1/cgi-bin/tilecache/tilecache.cgi?",
{
layers: "oge",
transparent: "true",
attribution: ""
});
map.addLayer(overlay);