Select to view content in your preferred language

ArcGIS Online Labels

22512
42
11-20-2013 05:10 AM
DonPritt
Frequent Contributor
So I'm looking through the gallery of arcgis online water utility maps from other organizations...
How do you do labeling like this for your maps to post online?
I would like to label my water mains, streets and whatever like this, can anyone give me a clue or where to look? I'm working with a file geodatabase and not a server if that make a difference.
It would be greatly appreciated...
Tags (2)
42 Replies
MatthewKing
Frequent Contributor

I like your idea better, I was just going to duplicate them but basically make the symbol so small that it's not really noticeable.  With your idea the legend wouldn't change.

Thanks!

Matt

0 Kudos
EmmaStrong
Deactivated User

The labels from my published MXD files show up just fine on most of my map services, but they do not seem show up on my feature services and/or when the labels themselves have scale ranges.  I have a street service that has 3 different street layers to display the features and labels by class at different scales (including standard highway and interstate symbology), and the labels do not show up in AGOL at all.  The option to create labels is available, but a lot of time was spent on the MXD to get the labels just right.  The labels seem to be fine in the rest services, but I just cannot figure out how to get my web map to pick up on that!  Is there some check box or setting somewhere that will allow these labels to display?

0 Kudos
AdamInglis
Deactivated User

Hi Emma,

As far as I can tell you need to set the label display in AGOL, they won't translate from your ArcMap MXD settings.  I'm hoping that ArcGIS Pro will be able to import these type of MXDs and publish them online with the proper label settings so we don't have to spend all that time setting them for individual webmap.

-Adam

0 Kudos
EmmaStrong
Deactivated User

The way I got around it was to add both the map AND feature services to the map, which hopefully will be fixed for Pro.  I need the feature services for searching, but only the map services will display the labels properly.  Another annoying thing about the labels of map services is that they are at the whim of the same transparency label of the layer itself!  I hope this changes with Pro as well.

0 Kudos
MikeMinami
Esri Notable Contributor

Feature layers don't support labeling. To understand why, you need to understand how these different layer types work.

Map Services - Layers based on map services are drawn by the server and return an image to client applications, like arcgis.com, to display. ArcGIS.com gets the image, with all the labeling. Basically the server has all the power to draw, just like ArcMap does. The complex labeling of ArcMap is essentially part of the image that gets returned.

Feature Services - layers based on feature services are drawn by client applications. A client, like ArcGIS.com sends a request to the server and instead of getting a nicely drawn image back, the server returns lists of coordinates and attributes for each feature, with some drawing instructions. No labeling. It's up to the client to draw the layer as best as it can. Clients like web browsers have very primitive drawing abilities. This is also why complex point, line and polygon symbology is not available to layers based on feature services.

Hope this helps,

Mike

0 Kudos
EmmaStrong
Deactivated User

This does help, thank you!  I did not realize there was a difference in where/how the data are being retrieved, so that makes more sense.  Thanks again!

0 Kudos
SamanthaEdwards
Deactivated User

According to this help page "You can create labels for features in hosted feature layers"

Create labels—Help | ArcGIS

Yet, when I create the labels in AGOL for my features they do not show up in my application.

JssrRR
by
Frequent Contributor

Hi Mike,

I have published a feature service and I am using the REST point URL for that service in my JavaScript application. I am now I am trying to add labels, but once I add label layer and create a text symbol, the feature layer itself is not showing up. Here is my application in JSfiddle, if you can take a look at it and tell me what is missing or what needs to be corrected that be a great help.

http://jsfiddle.net/ynhw88er/7/

Thanks!!

0 Kudos
KellyHutchins
Esri Frequent Contributor

Hi Saloni,

In the future questions that are unrelated to the discussion should probably go in a separate discussion in the ArcGIS API for JavaScript‌ place. 

In your fiddle there are a few typos that are causing the features and labels not to show.  At line 229 you try to set a renderer on a variable called NF. That variable does not exist so the value should probably be featureLayer. The second issue is that you set the outFields to labelFields and that value is an empty string so no out fields are specified. Here's an updated version of your fiddle showing the fixes. Label Nursing Facilities with Facility ID - JSFiddle

JssrRR
by
Frequent Contributor

Thanks, Kelly for a such a quick response and for fixing the errors.

Works fine now!!

0 Kudos