[Chameleon] Query widget to display only "selectedLayers"

Paul Spencer pspencer at dmsolutions.ca
Wed Aug 31 12:54:08 EDT 2005


Joanne,

I'm really not sure what the problem could be.  It seems to me that I've 
run into this kind of problem before but I cannot remember exactly what 
it was or how (or even if) it was solved.

Sorry not to be of more help

Paul

McGraw, Joanne wrote:
> Hello,
> 
> Me again; different problem.
> 
> My application is supposed to have functionality to Query all layers and
> to Query only the currently selected layers as well (set using the
> SelectLayers widget). The results of these queries are displayed in an
> IFrame, whose name is passed in through the iframename attribute. 
> 
> In order to do this, I altered the Query widget:
> 
> 1. To optionally accept another attribute indicating that only the
> selectedLayers' values should be displayed and set the NavCommand based
> on that: $this->SetNavCommand("QUERY_SELECTED"); // vs. "QUERY" for all
> layers
> 
> 2. In GetJavascriptInitFunctions, I am registering a new event id:
> $aResult['NLWISQuerySelectedRegisterEvent'] =
> "goEventManager.registerEventID( 'ON_QUERY_SELECTED' );\n";
> 
> 3. In GetJavascriptFunctions, I have essentially duplicated the two
> Javascript functions NLWISQueryWMouseClick and NLWISQueryWMouseMove to
> create two new Javascript functions NLWISQuerySelectedWMouseClick and
> NLWISQuerySelectedWMouseMove.
> 
> a. The NLWISQuerySelectedWMouseMove function checks that the NAV_CMD
> equals "QUERY_SELECTED" and then sets the mouseup event to the new
> function: "document.onmouseup = NLWISQuerySelectedWMouseClick;" 
> 
> b. The NLWISQuerySelectedWMouseClick appends the selected layers to the
> URLs provided: "&selectedLayers=" +
> {$this->mszHTMLForm}.SELECTED_LAYERS.value (so those values are
> available to the Query's PHTML) and triggers the "ON_QUERY_SELECTED"
> event: goEventManager.triggerEvent( 'ON_QUERY_SELECTED', nX, nY );
> 
> 
> Now, to my problem.
> 
> I click on the NavButton to indicate that I would like to Query Selected
> Layers only and click on the map. More often than not, the mouseup event
> does not trigger the running of the NLWISQuerySelectedWMouseClick
> function. It will occasionally; and, when it does, the results displayed
> in the iframe are correct. It's just that there doesn't seem to be any
> rhyme or reason to when it decides to run the function and when not.
> 
> I've tried clicking a specific numbers of times, on specific parts of
> the map, using single and double-clicks, clicking once and waiting a
> minute (in case there's some weird lag time happening). There does not
> appear to be any pattern to when the function runs and when it doesn't.
> It seems as though the mouseup event is somehow erroneous 90% of the
> time and is being consumed before it actually calls the
> NLWISQuerySelectedWMouseClick function.
> 
> The same Query widget works exactly as expected, on every click, when I
> am not trying to limit the query to only those selected. 
> 
> Is there a piece to this puzzle that I am missing somewhere? Is there
> something else I need to add to my code or to Chameleon to get this to
> go?
> 
> Cheers,
> jtm
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list