[Chameleon] LayerManager widget doesnt always work

Doug H dougholm at gmail.com
Mon Jul 17 13:39:01 EDT 2006


Hi Julien,

Looks like I am still getting the same error. I switched over to the
legendtemplate widget but now I cant seem to have a layer 'selected'.
the legendtemplate widget also doesnt seem to like annotation layers.
Any idea what that is all about? here are some annotation layer
exampes from my mapfile:

  LAYER
    NAME "rural ward annotation"
    STATUS OFF
    DATA "r_ward_anno"
    TYPE ANNOTATION
    MINSCALE 1
    MAXSCALE 100000
    LABELITEM "STREETNAME"
    LABELANGLEITEM "ROTATION"
    LABELCACHE ON
    CLASS
      NAME "rural ward anno"
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        SIZE 9
        OFFSET 0 0
        COLOR 0 0 0
      END
    END
  END

  LAYER
    NAME "rural settlement annotations"
    STATUS OFF
    DATA "r_settle_anno"
    TYPE ANNOTATION
    MINSCALE 1
    MAXSCALE 100000
    LABELITEM "Label"
    LABELANGLEITEM "rotation"
    LABELCACHE ON
    CLASS
      NAME "rural settle annotations"
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        SIZE 9
        OFFSET 0 0
        COLOR 0 0 0
      END
    END
  END

  LAYER
    NAME "rural street annotation"
    STATUS OFF
    DATA "r_street_anno"
    TYPE ANNOTATION
    MINSCALE 1
    MAXSCALE 10000
    LABELITEM "Text"
    LABELANGLEITEM "Angle"
    LABELCACHE ON
    CLASS
      NAME "rural street annotation"
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        SIZE 9
        OFFSET 0 0
        COLOR 0 0 0
      END
    END
  END


Thanks for your help,
Doug





On 7/17/06, Julien-Samuel Lacroix <jlacroix at mapgears.com> wrote:
> Hi,
> Try changing the function like this in LayerManagerAction.widget.php.
> Let us know if it helps.
>
>
> function {$szJsFunctionName}(obj, szAction)
> {
>     var oElement = document.getElementById('LAYERMANAGER_ACTION');
>     oElement.value = szAction;
>     {$this->mszHTMLForm}.submit();
>
>     return;
> }
>
> Is the problem  is browser specific? Did you succesfully reproduce it on
> IE and Firefox?
>
> Julien
>
> Doug H wrote:
> > Hi
> > I have added a LayerManager widget to my map, which displays the popup
> > layer manager window, and sometimes it adds or subtracts the layers
> > from my map and sometimes it just stops working and I get an error
> > that reads:
> >
> > Line: 26
> > Char: 5
> > Error: Invalid Syntax
> > Code: 0
> > URL:
> > http://mapgis/chameleon/widgets/LayerManager/LayerManager.php?sid=44b6c8054bc8a
> >
> >
> > if I 'view source' and look at line 26 I see this:
> > document.forms[0].submit();
> > which is located within this function here:
> >
> > function clickLayerManagerAction(obj, szAction)
> > {
> >    document.forms[0]['LAYERMANAGER_ACTION'].value = szAction;
> >    document.forms[0].submit();
> >
> >    return;
> > }
> >
> > I found this functions origin in LayerManagerAction.widget.php and it
> > looks like this:
> >
> > function {$szJsFunctionName}(obj, szAction)
> > {
> >    {$this->mszHTMLForm}['LAYERMANAGER_ACTION'].value = szAction;
> >    {$this->mszHTMLForm}.submit();
> >
> >    return;
> > }
> >
> > and finally.. my widget looks like this:
> >
> >      <CWC2 TYPE="layermanager"
> >                   VISIBLE="TRUE"
> >                  ENABLED="TRUE"
> >                  POPUPWIDTH="475"
> >                  POPUPHEIGHT="700"
> >                  label="Layer Manager"
> >                  STYLERESOURCE="TextButtons"
> >                  TOOLBAR="TRUE"
> >                  MENUBAR="TRUE"
> >                  STATUS="TRUE" >
> >
> >                   <IMAGE STATE="normal"/>
> >                   <IMAGE STATE="hover"/>
> >                   <IMAGE STATE="selected"/>
> >
> >         </CWC2>
> >
> > Like I said before, sometimes it works and sometimes it doesnt. It
> > never really seems to add annotations but I know it has done it at
> > least once. Does anyone have any suggestions as to what the problem
> > might be?
> > Thanks in advance,
> > Doug
> > _______________________________________________
> > 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