[OpenLayers-Users] several getFeatureInfo requests
R. Ortner
reinhard.ortner at edu.fh-kaernten.ac.at
Tue Dec 11 04:11:41 EST 2007
Hi,
when I use the getFeatureInfo request i have a little problem:
When I query the fist layer the layer is queried korrekt, when I go to the
next layer and query the second, the request is send for the first and the
second layer. When I query the 3rd layer the query is send for the first,
second and third and so on...
How can I reset the amount of querys after the search?
function checkinfo(imgid,url,title){
if (infobox == 0) {infobox = 1;}
if (imgid == oldimgid) {infobox = 0;}
id = imgid.substring(3,imgid.length);
if(infobox == 1 && document.getElementById(id).checked==true) {
document.getElementById('map').style.cursor = 'crosshair';
document.getElementById(imgid).src = "img/treemenu/identify_2.gif";
if (oldimgid != null) document.getElementById(oldimgid).src =
"img/treemenu/identify_1.gif";
oldimgid = imgid;
document.getElementById('nodeList').style.visibility = 'visible';
map.events.register('click', map, function (e) {
if(infobox == 1 && document.getElementById(id).checked==true) {
document.getElementById('map').style.cursor = 'crosshair';
OpenLayers.Util.getElement('nodeList').innerHTML = "Loading...
please wait...";
var request = window[id].getFullRequestString({
REQUEST: "GetFeatureInfo",
EXCEPTIONS: "application/vnd.ogc.se_xml",
BBOX: window[id].map.getExtent().toBBOX(),
X: e.xy.x,
Y: e.xy.y,
INFO_FORMAT: 'text/html', //um ein Template
abzuarbeiten
QUERY_LAYERS: window[id].params.LAYERS,
WIDTH: window[id].map.size.w,
HEIGHT: window[id].map.size.h});
OpenLayers.loadURL(request, '', this, setHTML);
OpenLayers.Event.stop(e);
}
});
}
else {
document.getElementById('map').style.cursor = 'auto';
document.getElementById('nodeList').style.visibility = 'hidden';
if (imgid == oldimgid) { oldimgid = null; } else { oldimgid = imgid;
}
document.getElementById('nodeList').innerHTML = "";
infobox = 0;
document.getElementById(imgid).src = "img/treemenu/identify_1.gif";
}
}
function setHTML(response) {
OpenLayers.Util.getElement('nodeList').innerHTML = response.responseText;
//response.responseText kann nur UTF8 darstellen/ für ISO 8... ist
response.responseXML
}
--
View this message in context: http://www.nabble.com/several-getFeatureInfo-requests-tp14270237p14270237.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list