zhang23796

TextSymbol  error

Discussion created by zhang23796 on May 30, 2013
Latest reply on May 31, 2013 by zhang23796
I want to mark many images on the map, I use PictureMarkerSymbol to draw image, that is OK. But when I use TextSnymbol to draw many texts,there is error. Then map is very slowly.Here is the code. What is the matter?

for (int i = 0; i < cjsyjbxx.size(); i++) {
    Geometry geometry = new Point(Double.valueOf(cjsyjbxx.get(i).getGIS_X()), Double.valueOf(cjsyjbxx.get(i).getGIS_Y()));
    TextSymbol ts = new TextSymbol(15f, cjsyjbxx.get(i).getSYMC(), Color.BLACK);
    ts.setHorizontalAlignment(HorizontalAlignment.center);
    ts.setOffsetY(15);
   
   
      Map<String,Object> attributes=new HashMap<String, Object>();
      attributes.put("ID", cjsyjbxx.get(i).ID);
      attributes.put("table", 2);
      attributes.put("type", 2); 
     
      Graphic gXFSs = new Graphic(geometry,imageXFS_WSPSymbol,attributes,null);     
      graphics.add(gXFSs);
     
      Graphic gXFSText = new Graphic(geometry, ts, attributes, null);
      graphics.add(gXFSText);
     }

Outcomes