[Chameleon] N- LegendTemplates and cwcjsapi events
Brent Lund
Brent.Lund at state.mn.us
Thu Jan 18 10:41:53 EST 2007
Sorry - the version I'm using is
Chameleon 2.4 (April 27, 2006)
-----Original Message-----
From: Brent Lund
Sent: Thursday, January 18, 2007 9:39 AM
To: 'Julien-Samuel Lacroix'
Cc: chameleon at lists.maptools.org
Subject: RE: [Chameleon] N- LegendTemplates and cwcjsapi events
Ok, I'm now using only one LegendTemplate widget. All is well -
almost...
I've been testing with firefox. When I checked the application in
Internet Explorer I found that the LegendTemplate widget does not update
in JSAPI mode.
I'm using Chameleon 2.2.1
Brent
-----Original Message-----
From: Julien-Samuel Lacroix [mailto:jlacroix at mapgears.com]
Sent: Wednesday, January 03, 2007 2:27 PM
To: Brent Lund
Cc: chameleon at lists.maptools.org
Subject: Re: [Chameleon] N- LegendTemplates and cwcjsapi events
Hi,
The LegendTemplate widget is designed to support only one Legend in the
page in JSAPI mode. You may be able to hack it to support multiple, but
you need to be comfortable with JS code. Is there a reason why you
display the legend twice in the same page?
Julien
PS: 34 is the widget ID. It's set in the widget code around line 316.
Brent Lund wrote:
>
>
> I have an application using 2 LegendTemplates.
>
>
>
>
>
> <cwc2 type="LegendTemplate" styleresource="TextButtons"
embedded="true"
> template="legend.html" PopupWidth="500" PopupHeight="500"
> Toolbar="false" Status="false" Menubar="false" Visible="true"
> Image="icons/icon_legend.png" ImageTip="Display Legend" LABEL="Legend"
> controlvisibility="false"/>
>
>
>
> <cwc2 type="LegendTemplate" styleresource="TextButtons"
embedded="true"
> template="rel_link_template.html" PopupWidth="500" PopupHeight="500"
> Visible="true" ImageTip="Related Links" LABEL="RelatedLinks"
> controlvisibility="false"/>
>
>
>
>
>
> When I change layers, the first LegendTemplate is updated but the
second
> is not updated.
>
> Is it possible to trigger events to update more than one
> LegendTemplate? Looking at the script generated I'm not sure
>
>
>
> function LegendTemplateWRegisterForEvent()
>
> {
>
> goCWCJSAPI.RegisterEvent(LAYER_STATUS_CHANGED,
"LegendTemplateWLayersChanged");
>
> goCWCJSAPI.RegisterEvent(LAYER_ORDER_CHANGED,
"LegendTemplateWLayersChanged");
>
> goCWCJSAPI.RegisterEvent(MAP_NEW_LAYER_ADDED,
"LegendTemplateWLayersChanged");
>
> }
>
> /**
>
> * LegendTemplateWLayersChanged
>
> * called when the layers are changed(JSAPI)
>
> */
>
> function LegendTemplateWLayersChanged()
>
> {
>
> goCWCJSAPI.ProcessLegendTemplate(34);
>
> }
>
>
>
>
>
> (where does 34 come from?)
>
>
>
>
>
> thanks
>
> Brent
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
--
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/
More information about the Chameleon
mailing list