OpenLayers.loadURL()里面的url里应该填什么?
我的是google地图引入
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg"></script>
加载google地图
var googleLayer = new OpenLayers.Layer.Google("google", {
type : G_NORMAL_MAP,
maxZoomLevel : 18,
Layers : 'basic'
});
map.addLayers([ googleLayer ]);
当我点击地图的时候
map.events.register('click', map, function(e) {
var params = {
REQUEST : "GetFeatureInfo",
EXCEPTIONS : "application/vnd.ogc.se_xml",
BBOX : map.getExtent().toBBOX(),
X : e.xy.x,
Y : e.xy.y,
INFO_FORMAT : 'application/vnd.ogc.gml',
QUERY_LAYERS : layers,
FEATURE_COUNT : 50,
Srs : 'EPSG:4326',
Styles : '',
WIDTH : map.size.w,
HEIGHT : map.size.h,
format : 'image/png'
};
OpenLayers.loadURL(url,params,this,setHTML, setHTML);
里面的那个layers和url应该写什么啊?求解 --------------------编程问答-------------------- layers 应该写你加载的图层名称
OpenLayers.loadURL("http://localhost:8080/geoserver/wangwei/wms", params, this, onComplete, onFailure)
//定义请求成功响应函数
function onComplete (response){
document.getElementById('click_response').innerHTML = response.responseText;
alert(response.responseText);
};
// 事件失败响应函数
function onFailure (response){
document.getElementById('click_response').innerHTML = response.responseText;
} --------------------编程问答-------------------- url 是的你数据源
补充:企业软件 , 地理信息系统