Select to view content in your preferred language

label graphics (2.0 Beta)

569
3
05-28-2010 05:34 AM
xiaomingqin
Emerging Contributor
I have a query to get features and draw them as polygons on graphic layer. The number of graphics can be in a range from 10 up to 2000. Now I need to label these graphics, I can think of two options here:
1. turn the map service on, using definition query and setting visible layers to just show the labels for those graphics. the problem is that the labels are beneath the graphics and that could cause them hard to read.
2. using GeometryService's labelPoints to return the label position for each graphic and then draw text using one of graphic's attribute at that position. I am not sure how the performance will be. Also, if I send all graphics together to the geometry service, are the returned label points in order? Or I have to do some work on client side to find which point belongs to which graphic? Another problem of this approach is it's hard to determine the text size at various scale.
3. I'd love to know if it's possible to do all the work on the client side. Finding the center point of the graphic and then just draw the text.

Has anybody done similar work before and want to share the experience? All suggestion are highly appreciated.

thanks
xiaoming

Prince William County, VA
Tags (2)
0 Kudos
3 Replies
DasaPaddock
Esri Regular Contributor
For option 1, have you tried putting your ArcGISDynamicMapServiceLayer over your GraphicsLayer? This should work.
0 Kudos
xiaomingqin
Emerging Contributor
thanks, Dasa. It works fine.

xiaoming
0 Kudos
WilliamBailey
Emerging Contributor
This was easy in previous API... geometryservice used to return a graphic with attributes as well as the geom.  Has anyone figured out how to get attributes since this (imho:  a step backward) change?
0 Kudos