[Chameleon] Hide/show keymap

Jason Grimes jgrimes at gi.alaska.edu
Fri Nov 18 13:48:23 EST 2005


Hi Joan,

Did you want this to be like the keymap on ArcIMS?  My group wanted an 
IMS like keymap and I have the code that will do this.  Paul, would you 
like it as well?  I have a test site up and running that illustrates it 
here:

http://phobos.gina.alaska.edu/alaskamap/index.phtml

You will have to modify some Chameleon code to get it to work, and that 
means that you will have to update the code every time you upgrade 
Chameleon to a new version.  Hope this helps,

Jason
(yet another Jason :) )


joanvp wrote:

>Hi Paul,
> 
> Thanks for your advice, I have tried it and works until certain point.  It is able to hide the keymap but certain disfunciones take place.
> 
> 1- It hides fine the keymap, but when is shown, it appears all red (extent outline color) until you press in it. And in the following press operations it remains the previous extension and the actual until you press on it.
> 
> 2- Because my keymap is on the map, the functions of keymap (zoom) follows alive! When I zoom in on the main map it zoom to keymap :(
> 
> Do you know how can I deactivate keymap functions?
> 
> Thanks a lot in advanced!
>
>Paul Spencer <pspencer at dmsolutions.ca> wrote: Joan,
>
>the problem is not with your code but with the way Chameleon does  
>things.  The keymap is actually created outside of your div so hiding  
>the div won't do what you expect.  However, I think you can do this:
>
>function hideKeymapDHTML()
>{
>     CWCDHTML_HideLayer("KeyMapLayerBG");
>     CWCDHTML_HideLayer("KeyMapLayerDiv");
>     CWCDHTML_HideLayer("zKeyMapBoxTop");
>     CWCDHTML_HideLayer("zKeyMapBoxLeft");
>     CWCDHTML_HideLayer("zKeyMapBoxBottom");
>     CWCDHTML_HideLayer("zKeyMapBoxRight");
>     CWCDHTML_HideLayer("zKeyMapBox2Top");
>     CWCDHTML_HideLayer("zKeyMapBox2Left");
>     CWCDHTML_HideLayer("zKeyMapBox2Bottom");
>     CWCDHTML_HideLayer("zKeyMapBox2Right");
>}
>
>
>function showKeymapDHTML()
>{
>     CWCDHTML_ShowLayer("KeyMapLayerBG");
>     CWCDHTML_ShowLayer("KeyMapLayerDiv");
>     CWCDHTML_ShowLayer("zKeyMapBoxTop");
>     CWCDHTML_ShowLayer("zKeyMapBoxLeft");
>     CWCDHTML_ShowLayer("zKeyMapBoxBottom");
>     CWCDHTML_ShowLayer("zKeyMapBoxRight");
>     CWCDHTML_ShowLayer("zKeyMapBox2Top");
>     CWCDHTML_ShowLayer("zKeyMapBox2Left");
>     CWCDHTML_ShowLayer("zKeyMapBox2Bottom");
>     CWCDHTML_ShowLayer("zKeyMapBox2Right");
>}
>
>Cheers
>
>Paul
>
>On 16-Nov-05, at 12:18 PM, joanvp wrote:
>
>  
>
>>My code is:
>>
>>************html code************
>>click me
>>
>>
>>    
>>
>>    
>>
>
>  
>
>>*********css code**************
>>#mapaguia {
>>  padding:0px;
>>  margin:0px;
>>  position:absolute;
>>  left:39px;
>>  top:119px;
>>  visibility:hidden;
>>  border: 0px none #000000;
>>}
>>
>>***********javascript**********
>>
>>
>>var state = 'hidden';
>>
>>function showhide(layer_ref) {
>>
>>if (state == 'visible') {
>>state = 'hidden';
>>}
>>else {
>>state = 'visible';
>>}
>>if (document.all) { //IS IE 4 or 5 (or 6 beta)
>>eval( "document.all." + layer_ref + ".style.visibility = state");
>>}
>>if (document.layers) { //IS NET! SCAPE 4 or below
>>document.layers[layer_ref].visibility = state;
>>}
>>if (document.getElementById & !document.all) {
>>maxwell_smart = document.getElementById(layer_ref);
>>maxwell_smart.style.visibility = state;
>>}
>>}
>>
>>
>>
>>
>>chameleon-request at lists.maptools.org wrote: Send Chameleon mailing  
>>list submissions to
>>chameleon at lists.maptools.org
>>
>>To subscribe or unsubscribe via the World Wide Web, visit
>>http://lists.maptools.org/mailman/listinfo/chameleon
>>or, via email, send a message with subject or body 'help' to
>>chameleon-request at lists.maptools.org
>>
>>You can reach the person managing the list at
>>chameleon-owner at lists.maptools.org
>>
>>When replying, please edit your Subject line so it is more specific
>>than "Re: Contents of Chameleon digest..."
>>
>>
>>Today's Topics! :
>>
>>1. Show/Hide KeyMapDHTML (joanvp)
>>2. Re: Show/Hide KeyMapDHTML (Jason Fournier)
>>
>>
>>----------------------------------------------------------------------
>>
>>Message: 1
>>Date: Wed, 16 Nov 2005 08:33:35 -0800 (PST)
>>From: joanvp
>>Subject: [Chameleon] Show/Hide KeyMapDHTML
>>To: chameleon at lists.maptools.org
>>Message-ID: <20051116163335.14228.qmail at web50101.mail.yahoo.com>
>>Content-Type: text/plain; charset="iso-8859-1"
>>
>>Hi list,
>>
>>I'm trying to run a javascript function for show and hide  
>>KeyMapDHTML with a button. My keymap is positioned throw div tags  
>>and css.The function works fine with the div, but keymap is allways  
>>on top. Why? how can I hide it without submit the whole page?
>>
>>Thanks a lot in advanced
>>
>>
>>
>>---------------------------------
>>Yahoo! FareChase - Search multiple travel sites in one click.
>>-------------- next part --------------
>>An HTML attachment was scrubbed...
>>URL: http://lists.maptools.org/pipermail/chameleon/attachments/ 
>>20051116/33266870/attachment-0001.html
>>
>>------------------------------
>>
>>Message: 2
>>Date: Wed, 16 Nov 2005 11:50:38 -0500
>>From: Jason Fournier
>>Subject: Re: [Chameleon] Show/Hide KeyMapDHTML
>>To: chameleon at lists.maptools.org
>>Message-ID: <437B635E.1010509 at dmsolutions.ca>
>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>>Joan,
>>
>>Can you give us your CSS and the snippet of HTML that contains the
>>KeyMapDHTML tag?
>>
>>Thanks,
>>Jason
>>
>>
>>
>>joanvp wrote:
>>    
>>
>>>Hi list,
>>>
>>>I'm trying to run a javascript function for show and hide  
>>>      
>>>
>>KeyMapDHTML
>>    
>>
>>>with a button. My keymap is positioned throw div tags and css.The
>>>function works fine with the div, but keymap is allways on top.  
>>>      
>>>
>>Why? how
>>    
>>
>>>can I hide it without submit the whole page?
>>>
>>>Thanks a lot in advanced
>>>
>>> 
>>>      
>>>
>>---------------------------------------------------------------------- 
>>--
>>    
>>
>>>Yahoo! FareChase - Search multiple travel sites in one click.
>>>
>>>
>>>
>>>
>>> 
>>>      
>>>
>>---------------------------------------------------------------------- 
>>--
>>    
>>
>>>_______________________________________________
>>>Chameleon mailing list
>>>Chameleon at lists.maptools.org
>>>http://lists.maptools.org/mailman/listinfo/chameleon
>>>      
>>>
>>-- 
>>________________________
>>Jason Fournier
>>
>>DM Solutions Group Inc.
>>jfournier at dmsolutions.ca
>>www.dmsolutions.ca
>>613.565.5056 x18
>>
>>
>>------------------------------
>>
>>_______________________________________________
>>Chameleon mailing list
>>Chameleon at lists.maptools.org
>>http://lists.maptools.org/mailman/listinfo/chameleon
>>
>>
>>End of Chameleon Digest, Vol 20, Issue 14
>>*****************************************
>>
>>
>>Yahoo! FareChase - Search multiple travel sites in one click.
>>_______________________________________________
>>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/|
>+-----------------------------------------------------------------+
>
>
>
>
>
>
>
>		
>---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.  
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Chameleon mailing list
>Chameleon at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/chameleon
>  
>



More information about the Chameleon mailing list