关于OpenLayers.ProxyHost参数的使用说明
来源:互联网 发布:ipl5世界总决赛数据 编辑:程序博客网 时间:2024/05/18 02:18
查看OpenLayers代码时遇到了这个参数,参考官方文档说明之。引自:http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost
ProxyHost
Why do I need a ProxyHost?
Due to security restrictions in Javascript, it is not possible to retrieve information from remote domains via an XMLHttpRequest.
Classes like WFS and GeoRSS use XMLHTTPRequest to get their data. If they are querying a remote server (anything other than the machine hosting your page), you must install a proxy script somewhere web accessible on that machine. See below for how to set up your own ProxyHost.
If the OpenLayers.ProxyHost variable is not set to a valid proxy host, requests are sent directly to the remote servers. In most cases, the result will be a security exception, although this exception often occurs silently.
How do I set up a ProxyHost?
An example proxy host script is available here: trunk/openlayers/examples/proxy.cgi
For the standard Apache configuration, you would place proxy.cgi into your /usr/lib/cgi-bin/ directory.
Once a proxy host script has been installed, you must then edit the OpenLayers.ProxyHost variable to match that URL.
Given the above standard Apache configuration:
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
If you have done something like this, you should be able to visit:
http://YourDomain.example.com/cgi-bin/proxy.cgi
The resulting content at that page should be the openlayers.org website.
If you get a 404 error instead, either the proxy script is not in the right location, or your webserver is not configured correctly.
Back to Top
- 关于OpenLayers.ProxyHost参数的使用说明
- openlayers中的proxyhost实现
- 关于openlayers的参数及其他
- openlayers中的proxyhost实现之二
- 关于OpenLayers的地图可视化
- 关于#pragma +参数的使用说明y(转自百度百科)
- HIbernate的参数使用说明
- HIbernate的参数使用说明
- 关于OpenLayers的TMS的一些理解
- 关于openlayers中namespace的一点理解
- 一篇关于 openlayers 的基础应用
- 关于SO_REUSEADDR的使用说明
- 关于SO_REUSEADDR的使用说明
- 关于SO_REUSEADDR的使用说明
- 关于SO_REUSEADDR的使用说明~
- 关于COMBOBOXINFO的使用说明
- 关于SafeArray的使用说明
- 关于UITABLEVIEW的使用说明
- 欧洲核子研究中心称“上帝粒子”可能并不存在
- vector的reserve和resize的区别
- QML与现有Qt UI代码的整合
- java直接下载文件
- Eclipse中ADT升级JAR包所遇到的问题(java.lang.NoClassDefFoundError: 异常)
- 关于OpenLayers.ProxyHost参数的使用说明
- ArcGIS Viewer for Flex Application builder 如何扩展微件
- 一些好的C\C++基础 博客
- numerical optimization
- 欧洲核子研究中心颁发“碰撞在CERN”大奖
- java.lang.OutOfMemoryError: Java heap space 解决方法
- 关于socket阻塞与非阻塞情况下的recv、send、read、write返回值
- Linux手动导入导出mysql数据库
- jar文件安装到本地的maven仓库