Select to view content in your preferred language

labeling Operational Layer

729
4
08-09-2013 06:20 AM
BillShockley
Deactivated User
I am using a template with An ArcGIS rest service.  The layer that I want to use says 'Has Labels: true'  Now I want the label to show up in my ESRI JSapi web application.  the Template I am using has the following code
 operationalLayers: [{
   type: "feature",
   url: "http://.....6080/arcgis/rest/services/........../MapServer/5",
   title: "Tanks - Scada Sites",
   options: {
    id: "tanks",
    opacity: 1.0,
    visible: true,
    outFields: ["*"],
    infoTemplate: new InfoTemplate("tank name", "${*}"),
    mode: 0
   },


My question is....Is there an option that I need to add that makes the labels appear...because they are not on.  Does this make sense? 
Thanks in Advance.
0 Kudos
4 Replies
JasonZou
Frequent Contributor
infoTemplate is not used to set the label, but to set the content of infoWindow when clicking on the features.
0 Kudos
BillShockley
Deactivated User
OK....then where or how do I add the labels for this layer?
0 Kudos
JasonZou
Frequent Contributor
I don't believe ESRI JS API provides a way to add labels for graphics. Currently you can only add labels for feature layers published along with the map services.
0 Kudos
BillShockley
Deactivated User
I am using a template with An ArcGIS rest service.  The layer that I want to use says 'Has Labels: true'  Now I want the label to show up in my ESRI JSapi web application.  the Template I am using has the following code
 operationalLayers: [{
   type: "feature",
   url: "http://.....6080/arcgis/rest/services/........../MapServer/5",
   title: "Tanks - Scada Sites",
   options: {
    id: "tanks",
    opacity: 1.0,
    visible: true,
    outFields: ["*"],
    infoTemplate: new InfoTemplate("tank name", "${*}"),
    mode: 0
   },


My question is....Is there an option that I need to add that makes the labels appear...because they are not on.  Does this make sense? 
Thanks in Advance.


is it possible with the code provided above, to add the labels that are at my rest service layer?  Maybe I'm not describing this correctly.  I just want the labels to appear.
Thanks,
0 Kudos