Select to view content in your preferred language

CompositeSymbol that includes TextSymbols and SimpleFillSymbol does not draw.

567
0
07-04-2012 10:08 PM
omega_cancer
Frequent Contributor
Following is the code snippet that 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.

Any help would be highly appreciated.
Thanks
Tags (2)
0 Kudos
0 Replies