[mapguide-users] Re: Tooltip - Display info from all (above) map layers

ddriver drunkdriv3r at gmail.com
Mon Oct 17 03:22:46 EDT 2011


I'm not sure how I would do that... but I found, in the file
ajaxmappane.templ that the tooltip gets displayed within the
function DisplayHyperlinkTip().

The actual tooltip info is stored in the hlData object: hlData.ttip,

which gets its value from xmlIn.getElementsByTagName("Tooltip")[0] , (the
value of the first element in the XML having the tag Tooltip ) in the
function ProcessFeatureInfo(),

which in turn gets called by the function QueryFeatureInfo(), where it all
comes down to.

In this function, QueryFeatureInfo(), there is a request sent which returns
an XML containing the tooltip info. Here's the code:

function QueryFeatureInfo(geom, append, maxfeatures, which)
{
if(GetVisSelLayers() == "") return;
    var reqParams ;
reqParams = "OPERATION=QUERYMAPFEATURES&VERSION=1.0.0&PERSIST=1&MAPNAME=" +
encodeURIComponent(mapName) + "&SESSION=" + sessionId + "&SEQ=" +
Math.random() + "&LAYERNAMES=" + encodeURIComponent(GetVisSelLayers()) +
"&GEOMETRY=" + geom + "&SELECTIONVARIANT=INTERSECTS" + "&CLIENTAGENT=" +
encodeURIComponent(clientAgent);
    if(maxfeatures != 0)
    {
        reqParams += "&MAXFEATURES=" + maxfeatures;
    }
    var selRequest = CreateRequestHandler();
    selRequest.open("POST", webAgent, false);
    selRequest.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
    selRequest.send(reqParams);
    if(selRequest.responseXML)
    {
        ProcessFeatureInfo(selRequest.responseXML.documentElement, append,
which);
    }
    else
        RequestFailed("No response");
}

I was wondering if I could change something here that would get the results
I need (display the tooltip info from all visible and selectable layers, not
just the current layer). Something like the parameters used to
call QUERYMAPFEATURES? So that in the returned XML, I would have more
Tooltip elements that I'd concatenate in ProcessFeatureInfo(). I also tried
to find the code for the QUERYMAPFEATURES code thinking I could find
something useful there, but had no luck... does anybody know where I could
find that code?

Thanks


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Tooltip-Display-info-from-all-above-map-layers-tp6891565p6899504.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20111017/9f4ffe93/attachment.html


More information about the mapguide-users mailing list