1

Following is the code snippet that does not draw both TextSymbols.

private function MapClick(evt:MapMouseEvent):void
        {
            var cs:CompositeSymbol = new CompositeSymbol();
            var textSymbol1:TextSymbol = new TextSymbol("hello");
            textSymbol1.textFormat= new TextFormat("Arial",5);
            var textSymbol2:TextSymbol = new TextSymbol("hello 123");
            textSymbol1.textFormat= new TextFormat("Arial",10);

            var myPolygon:Polygon = new Polygon(
                [[
                    evt.mapPoint,
                    new MapPoint(evt.mapPoint.x+5, evt.mapPoint.y+8),
                    new MapPoint(evt.mapPoint.x+10, evt.mapPoint.y+12)
                ]], new SpatialReference(4326));
            cs.symbols= [textSymbol1, textSymbol2, new SimpleFillSymbol(SimpleFillSymbol.STYLE_BACKWARD_DIAGONAL,0xFF00FF,1)];
            var m_graphic:Graphic = new Graphic(myPolygon , cs );
            gLayer.add( m_graphic );
        }

TextSymbols accept point geometry and I am assigning them with multipoint geometry I think that is where problem lies. I need to draw TextSymbols all around the polygon so how can I accomplish it. I am using FlexViewer 2.5.

Any help would be highly appreciated. Thanks

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.