[Chameleon] Chameleon 2.6 RC1 Broken Update Map in JSAPI

Nolte, Tim Tim.Nolte at ipcswirelessinc.com
Wed Sep 12 15:37:57 EDT 2007


I tried this code before, I just double checked everything and put in
your suggested changes and still nothing. Also, I might mention that the
Chameleon JSAPI sample Update Map button no longer works in 2.6 either.
I really think this is a 2.6 bug.

----
Timothy J Nolte - tnolte at ilpcs.com
Associate Network Planning Engineer

iPCS Wireless, Inc.
4717 Broadmoor Ave, Suite G
Kentwood, MI 49512

Office: 616-656-5163
PCS:    616-706-2438
Fax:    616-554-6484
Web: www.ipcswirelessinc.com


-----Original Message-----
From: Normand Savard [mailto:nsavard at mapgears.com] 
Sent: Wednesday, September 12, 2007 3:14 PM
To: Nolte, Tim
Cc: Chameleon Users
Subject: Re: [Chameleon] Chameleon 2.6 RC1 Broken Update Map in JSAPI

Nolte, Tim wrote:

>Due to a problem with the Go Back/Forward buttons in JSAPI mode under
>v2.4 I tried v2.6b. Now the Update Map button doesn't work in JSAPI
>mode. It had worked fine in v2.4. I'm using the custom expander tree
>legend that is found on the Wiki. Here's my code and perhaps someone
can
>help me from here.
>
>  
>
Tim,

If you change the following line of code (see line location above):

<input type="checkbox" id="cbl_[leg_layer_name]"
name="legendlayername[]" value="[leg_layer_name]" [if name=layer_status
oper=eq value=1]CHECKED[/if][if name=layer_status oper=eq
value=2]CHECKED[/if]>

to be:

	  	<input type="checkbox" id="cbl_[leg_layer_name]"
name="legendlayername[]" value="[leg_layer_name]" [if name=layer_status
oper=eq value=1]CHECKED[/if][if name=layer_status oper=eq
value=2]CHECKED[/if] onclick="ChangeLayerStatus('[leg_layer_name]')">
<<<<<<<++++++++


And add the following JavaScript function:

function ChangeLayerStatus(szLayerName)
{

    if(typeof goCWCJSAPI == "undefined")
    {
        return false;
    }

    szStatus = goCWCJSAPI.oMap.GetLayerByName(szLayerName).GetStatus();
    //alert('status='+szStatus)

    if(szStatus == "ON")
    {
        szNewStatus = "OFF";
    }
    else
    {
        szNewStatus = "ON";
    }

    goCWCJSAPI.oMap.GetLayerByName(szLayerName).SetStatus(szNewStatus);


    szStatus = goCWCJSAPI.oMap.GetLayerByName(szLayerName).GetStatus();
    //alert('status='+szStatus)

}

Does it work?  Check the page source to be sure that the line was 
modified correctly.


Norm




More information about the Chameleon mailing list