FeatureLayer labels won't appear

655
2
Jump to solution
11-01-2012 09:40 AM
SteveCole
Frequent Contributor
I have a polygon SDE dataset that I have added to my webmap as a feature layer. The layer is a dynamic map service and in the MXD/MSD, I have labeling turned on (standard- not Maplex).

If I go to my REST Services directory and click on the "View in Javascript Viewer", the resulting window displays my features and the auto-labels just fine. In my webmap, however, the features will draw but no labels.

What could possibly prevent the labels from appearing within my webmap?

Steve
0 Kudos
1 Solution

Accepted Solutions
derekswingley1
Frequent Contributor
When you look at a map service with JS via the services directory, you're looking at the entire service. Which is to say you're looking at generated images of the data (for dynamic services, this is one image generated on they fly, for tiled services, it's a set of pre-rendered images).

Feature Layers, on the other hand, bring a single layer from a map service to a client. A Feature Layer does not use images but sends vectors to the client. You get geometry and attributes, but not labels. If you require labels, use a dynamic or tiled map service.

View solution in original post

0 Kudos
2 Replies
derekswingley1
Frequent Contributor
When you look at a map service with JS via the services directory, you're looking at the entire service. Which is to say you're looking at generated images of the data (for dynamic services, this is one image generated on they fly, for tiled services, it's a set of pre-rendered images).

Feature Layers, on the other hand, bring a single layer from a map service to a client. A Feature Layer does not use images but sends vectors to the client. You get geometry and attributes, but not labels. If you require labels, use a dynamic or tiled map service.
0 Kudos
SteveCole
Frequent Contributor
Right you are again, Derek.

I've defaulted to using featureLayers due to my need for popup content but this particular layer I'm dealing with would be fine as a dynamicMapService. Thanks for setting me straight!

Steve
0 Kudos