Select to view content in your preferred language

Viewer 2.0 Beta bug?

398
1
07-05-2010 06:50 AM
ChenJuequan
Deactivated User
1. It seems that when I set the widgets loading mode to 'float' the widget manager won't recognize the 'left | top | right | buttom ' parameters set to the widget. Am I missing something or it is a bug?

2. I think the function below (which is in QueryWidget.mxml) needs some modifications because the path count of one specific polyline is not always bigger than 2, 'const pathIndex:int     = int(pathCount / 2) - 1;' may raises an error.
private function getGeomCenter(gra:Graphic):MapPoint
            {
                var pt:MapPoint;
                switch (gra.geometry.type)
                {
                    case Geometry.MAPPOINT:
                        pt = gra.geometry as MapPoint;
                        break;
                    case Geometry.MULTIPOINT:
                        const multipoint:Multipoint = gra.geometry as Multipoint;
                        pt = multipoint.points[0] as MapPoint;
                        break;
                    case Geometry.POLYLINE:
                        const pl:Polyline       = gra.geometry as Polyline;
                        const pathCount:Number  = pl.paths.length;
                        const pathIndex:int     = int(pathCount / 2) - 1;
                        const midPath:Array     = pl.paths[pathIndex];
                        const ptCount:Number    = midPath.length;
                        const ptIndex:int       = int(ptCount / 2) - 1;
                        pt = pl.getPoint(pathIndex, ptIndex);
                        break;
                    case Geometry.POLYGON:
                        const poly:Polygon = gra.geometry as Polygon;
                        pt = poly.extent.center;
                        break;
                }
                return pt;
            }
Tags (2)
0 Kudos
1 Reply
BjornSvensson
Esri Regular Contributor
1. It seems that when I set the widgets loading mode to 'float' the widget manager won't recognize the 'left | top | right | buttom ' parameters set to the widget. Am I missing something or it is a bug?


#1. This is a bug.  As a temporary workaround, you can use x/y instead of left/top.
0 Kudos