[Chameleon] ROIArea widget

Julien-Samuel Lacroix jlacroix at mapgears.com
Mon Mar 30 12:55:44 EST 2009


Hi,

There's a small bug in the ROIArea widget. Go in the following file 
around line 316:
chameleon/htdocs/widgets/ROIArea/ROIArea.widget.php

Add opening and closing parenthesis to updateArea there to have the 
following line in the end:
     goCWCROIManager.RegisterEvent(ROI_CHANGED, "updateArea()");

Julien

Tony Baylis wrote:
> Hi all,
> 
> I'm not sure where I've gone wrong but I cannot get the ROIArea widget 
> to display the area of any of the ROI objects drawn.  Below is the 
> relevant code.
> 
> Cheers for your help,
> Tony
> 
>           <CWC2 TYPE="ROIManager"
>                 MODE="ADD"
>                 EDGECOLOR="CC0033"
>                 EDGEWIDTH="2"
>                 FILLCOLOR="FF6666"
>                 FILLOPACITY="30"
>                 FILLROI="TRUE"
>                 ONROICHANGED="updateArea" />
>          
>           <CWC2 TYPE="ROIManagerMode"
>                 MODE="ADD"
>                 IMAGETIP="Add mode"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_mode_add_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_mode_add_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_mode_add_3.png" />
>          
>           </CWC2>
>          
>           <br>
>          
>           <CWC2 TYPE="ROIManagerMode"
>                 MODE="REPLACE"
>                 IMAGETIP="Replace mode"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_mode_replace_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_mode_replace_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_mode_replace_3.png" />
>          
>           </CWC2>
>          
>           <br>
>          
>           <CWC2 TYPE="ROIRectangleTool"
>                 IMAGETIP="Draw a rectangle on the map"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_rectangle_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_rectangle_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_rectangle_3.png" />
>         
>           </CWC2>
>          
>           <br>
>          
>           <CWC2 TYPE="ROIPolygonTool"
>                 NUMBEROFPOINTS="200"
>                 POINTSPACING="5"
>                 IMAGETIP="Draw a polygon on the map"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_polygon_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_polygon_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_polygon_3.png" />
>         
>           </CWC2>
>          
>           <br>
>          
>           <CWC2 TYPE="ROICircleTool"
>                 IMAGETIP="Draw a circle on the map"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_ellipse_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_ellipse_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_ellipse_3.png" />
>          
>           <br>
>          
>           <CWC2 TYPE="ROIRemoveLast"
>                 IMAGETIP="Remove the added ROI object"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_undo_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_undo_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_undo_3.png" />
>          
>           </CWC2>
>                
>           <br>
>          
>           <CWC2 TYPE="ROIRemoveAll"
>                 IMAGETIP="Remove all ROI objects"
>                 IMAGEWIDTH="24"
>                 IMAGEHEIGHT="24">
>                 <IMAGE STATE="normal"
>                 IMAGE="buttons/button_roi_clear_1.png" />
>                 <IMAGE STATE="hover"
>                  IMAGE="buttons/button_roi_clear_2.png" />
>                 <IMAGE STATE="selected"
>                  IMAGE="buttons/button_roi_clear_3.png" />
>          
>           </CWC2>
> 
>           <CWC2 TYPE="ROIArea"
>                 UNITS="KILOMETERS"
>                 LABEL="Area (sq km):"
>                 WIDGETCLASS="inputBox" />
> 

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/


More information about the Chameleon mailing list