[Chameleon] clear NAV_CMD

Jesse Cleary jcleary at email.unc.edu
Thu May 10 17:02:17 EDT 2007

Thanks again Julien

My customization is limited to additions to the maptip.js file (onclick 
addition) and not a new widget per se (I should have been more clear).  
I do see the submit function in the MapTips.widget.php and actually a 
exisiting clearing of NAV_CMD as well.   However, I think that the 
MapTips widget is only called upon the first loading of the app, thus it 
clears the NAV_CMD only upon initial load and is not called again?  The 
imagemap must be created for the entire MapTips input layer and thus 
does not need to be recreated even if the map extents change.  So I'm 
still stuck as to where to begin tinkering?


Julien-Samuel Lacroix wrote:
> Hi,
> In the widget you are developping, at some point you probably submit 
> the form in a JavaScript function. If not, search for the word 
> "submit()" in your custom widget. Just before the submit function, put:
> {$this->mszHTMLForm}.NAV_CMD.value = "";
> This should take care of the issue. If you have difficulty finding 
> where to include this line of code, send us your custom widget and 
> we'll check.
> Thanks
> Julien
> Jesse Cleary wrote:
>> Thanks Julien
>> I've experimented with this code block already some.  I guess I'm not 
>> sure where to insert it.  I tried adding it into the zoom widget code 
>> at each point where a zoom function seems to be called, but this 
>> snippet breaks that code:
>>        PHP Parse error:  syntax error, unexpected '}'
>> Removing the curly braces kicks this error:
>>        PHP Parse error:  syntax error, unexpected '='
>> Not wanting to go much further before asking for advice I also tried 
>> adding:
>>        $this->SetNavCommand("");
>> which did not seem to have any effect.
>> Maybe I'm tinkering with the wrong file?  Even if it did work, 
>> wouldn't this change the zoom functionality over all of my Chameleon 
>> apps?
>> Sorry to bug you about this - I appreciate any further advice you 
>> might have...
>> Jesse
>> Julien-Samuel Lacroix wrote:
>>> Hi,
>>> Other widgets had this problem at a point. It was resolve by 
>>> clearing the NAV_CMD like you did. Widgets that submit the page, but 
>>> don't use the NAV_CMD parameter have to clear it before submitting. 
>>> If you look in the WMSBrowser widget for example, it clears the 
>>> NAV_CMD on every page submit like this:
>>>         {$this->mszHTMLForm}.NAV_CMD.value = "";
>>>         {$this->mszHTMLForm}.submit();
>>> This should be enough to deactivate the other Navigation tools. Let 
>>> us know if you have any problem with this.
>>> Best regards,
>>> Julien
>>> Jesse Cleary wrote:
>>>> Hi folks
>>>> I'm working on a very simple Chameleon based map with onmouseover 
>>>> and onclick functionality using a customization of the MapTips 
>>>> widget.  Because of the onClick bit, my ZoomIn and ZoomOut widgets 
>>>> are presenting a problem.  Because they remain active after the map 
>>>> refreshes, a user's onClick action to get a MapTip also activates 
>>>> the selected widget asugin another refresh and not the desired 
>>>> onclick event.  I've tried to clear the NAV_CMD variable in my 
>>>> custom MapTips JS but I can't get that code fired ahead of the Zoom 
>>>> actions.  I'm using the scale zoom in the interim which provides a 
>>>> less desirable zoom function.
>>>> Any ideas on how to clear the NAV_CMD variable and/or de-select the 
>>>> Zoom widgets after refresh without tinkering with the base Zoom 
>>>> widget code?  The base code powers several other Chameleon apps 
>>>> that I don't want this fix applied to.  Thanks for any ideas you 
>>>> can suggest...
>>>> Jesse
>>>> Chameleon 2.4 (non JSAPI)
>>>> with MS 4.8.1
>>>> on Fedora Core 4

Jesse Cleary				
Department of Marine Sciences	
UNC Chapel Hill

334 Chapman Hall
(919) 962-4987 

jcleary at email.unc.edu

More information about the Chameleon mailing list