hi, because of my ignorance in DOM, I started mixing jquery (one of the
simplest javascript libraries) and mapbuilder and found a very simple
solution to this problem, modifying WidgetBaseXSL.js [thanks Denton for you
tutorial ;.) ].
If the response of GetFeatureInfo widget goes to a tag with id="left", we
can count how many responses are appended there and restrict the number of
these. If the number of responses are greater than x, then delete the
content of "left" and append the new response there.
Very very simple but works. I think mixing jquery (or anyother js
library) inside of the mapbuilder code can give great oportunities for
"playing" with the DOM, css, etc. In the case of modifying WidgetBaseXSL,
You just must add mapbuilder.loadScript(baseDir+"/tool/jquery.js"); after
mapbuilder.loadScript(baseDir+"/widget/WidgetBase.js");
if (widgetNode.nodeName != 'FeatureInfo') {
objRef.node.appendChild(tempNode.firstChild);} else {
$("#title").html("<th>getFeatureInfo responses are:</th>");
new=document.getElementById('left');
var childs=new.childNodes;//alert("numero childs :"+childs.length);
if (childs.length > 1) {
$("#left").empty();
//$("<div><h2><p>Resultats amb major de
1</p></h2></div>").appendTo("#left");
objRef.node.appendChild(tempNode.firstChild);
}else {
objRef.node.appendChild(tempNode.firstChild);
objRef.postPaint(objRef);
joe GIS wrote:
>
> hello!
>
> just a simple question. I want to use GetfeatureInfo and I take the
> mapViewer demo a example, but
> there is the problem that the result of each Request is appended to the
> featureList (for 3 queries
> I get 3 results in the same page). How can I get to "delete" or refresh
> the previous result? (as WfsGetFeature does). I've deeply studied the
> demos and tutorials, but I think I'm missing something about listeners.
>
> And someone knows why there are 2 differents GetFeatureInfo (one in
> widgets and another one in mapviewer demo) and the difference between
> them?
>
> Thanks in advance,
>
> Joe
>
>
--
View this message in context:
http://www.nabble.com/simple-getFeatureInfo-question-tf3864423.html#a11443702
Sent from the MapBuilder Users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users