OpenLayers、地图服务器和瓷砖缓存
我想提高使用 OpenLayers、Google 地图和 Google Maps 显示专题地图的应用程序的性能。带有 TileCache 的 MapServer (http://tilecache.org)。因此,我按照安装说明成功安装了TileCache。
在我的应用程序中,我使用以下代码在底图顶部嵌入一个新图层,到目前为止效果良好:
var wms_layer = new OpenLayers.Layer.WMS("WMS layer","localhost/cgi-bin/mapserv"
{
map: [path_to_my_mapfile],
layers: [list of layers],
transparent:true
});
my_map.addLayer(wms_layer);
文档 基本上说传递给 OpenLayers.Layer.WMS 构造函数的 URL 必须指向 TileCache 脚本,即tilecache.cgi 或tilecache.py。
var wms_layer = new OpenLayers.Layer.WMS("WMS layer","localhost/cgi-bin/tilecache/tilecache.cgi"
{
map: [path_to_my_mapfile],
layers: [list of layers],
transparent:true
});
my_map.addLayer(wms_layer);
不幸的是它不起作用,这意味着当我切换网址时我看不到地图。知道可能出什么问题吗?也许这是我在tilecache.cfg中错过的配置设置,但我无法弄清楚正确的设置是什么。
有人对这个问题有一些经验吗?
I would like to improve the performance of my application that displays thematic maps using OpenLayers, Google Maps & MapServer with TileCache (http://tilecache.org). Therefore I followed the installation instructions and installed TileCache successfully.
Within my application I have the following code to embed a new layer on top of my basemap that works fine so far:
var wms_layer = new OpenLayers.Layer.WMS("WMS layer","localhost/cgi-bin/mapserv"
{
map: [path_to_my_mapfile],
layers: [list of layers],
transparent:true
});
my_map.addLayer(wms_layer);
The documentation basically says that the URL passed to the OpenLayers.Layer.WMS constructor must point to the TileCache script, i.e. tilecache.cgi or tilecache.py.
var wms_layer = new OpenLayers.Layer.WMS("WMS layer","localhost/cgi-bin/tilecache/tilecache.cgi"
{
map: [path_to_my_mapfile],
layers: [list of layers],
transparent:true
});
my_map.addLayer(wms_layer);
Unfortunately it does not work, meaning that I can see no maps when I switch the url. Any idea what could be wrong? Maybe it is a configuration setting I missed in tilecache.cfg but I could not figure out what the right settings are.
Does anybody have some experiences with this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您对上述问题有疑问且无法在此处得到解答,请订阅 OpenLayers 邮件列表。到目前为止,我得到了订阅该列表的人们的大力支持。
访问:http://openlayers.org/mailman/listinfo
If you have questions about the above mentioned issues that can´t be answered here, subscribe to the OpenLayers mailing lists. I got great support from the people subscribed to that list so far.
Visit: http://openlayers.org/mailman/listinfo