OpenLayers、地图服务器和瓷砖缓存

发布于 2024-08-17 21:53:17 字数 1180 浏览 6 评论 0原文

我想提高使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凯凯我们等你回来 2024-08-24 21:53:17

如果您对上述问题有疑问且无法在此处得到解答,请订阅 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文