4

I'm creating json to create a custom printout using the Export Web Map task on an ArcGIS server (v10.2).

Everything works as expected apart from labels are not showing in the generated printout. The layer is a feature layer and the shapes in the layer appear fine but the labels don't.

The labels do appear in our web map application so it looks like there's no problem with the labels themselves. The values and styles are all as expected.

I've tried to find another feature layer on the web and use it to see if the issue is with our MXD but the labels don't appear in the output from the "export web map" either.

To demonstrate, I've used the Hurricance layer from this ArcGIS web map application:

I've used this json to demonstrate that the layer is rendered but the labels are missing in the printout:

{
  "mapOptions": {
    "showAttribution": true,
    "extent": {
      "xmin": 9407172,
      "ymin": 2006620,
      "xmax": 11117172,
      "ymax": 3596620,
      "spatialReference": {
        "wkid": 3857,
        "latestWkid": 3857
      }
    },
    "spatialReference": {
      "wkid": 3857,
      "latestWkid": 3857
    },
    "scale": 4000000
  },
  "operationalLayers": [
    {
      "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
      "title": "Base Map",
      "opacity": 1
    },
    {
      "url": "https://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/Hurricane_Active/MapServer/0",
      "title": "Active Hurricanes",
      "opacity": 1
    }
    ,
    {
      "opacity": 1
    }
  ],
  "baseMap": [
      ],
  "exportOptions": {
    "dpi": 96
  }
}

(It may be necessary to update the extent to locate an active hurricane)

My question is why do the labels not appear when printing?

In the ExportWebMap specification there isn't the option to define labelingInfo for Feature Layers so is this something that's just not supported or is it a bug with the task?

The other thing I noticed is that there is no labeling info defined for the layer when you look at the DrawingInfo in the Hurricane sample layer but that does not seem to make a difference as I can define styles in the MXD and when published I can see the labels appear in the web map with the correct style. - Just printing fails to show them.

  • 10.3 may have some fix for this. I know 10.2 doesn't support maplex web labeling (even though it does work). I have seen this type of lag in the implementation of print applications. Especially the support for maplex labeling. Does your MXD have standard label or maplex enabled? Go to the dataframe properties and look at the general tab> label engine setting. – Brad Nesom Jul 29 '15 at 15:26
  • Tried it on 10.3 and it's not working. maplex is not enabled - using standard labelling – Catch22 Jul 30 '15 at 8:22
2

The problem here is that Active Huricanes layer is added as a feature layer rather than a dynamic map service. Difference is that dynamic map service serves rendered images and rendering is done on server so everything is rendered as specified in MXD.

However, the feature layer serves the actual geometry (vertices) and symbology used. Rendering is then done client side. In general symbology can be applied (it might be simplified in some cases) but labels are not supported.

So the correct JSON to print out given two layers with labels is below. Note the change in the url for 'Active Huricanes' layer and additional property 'visibleLayers':

{
  "mapOptions": {
    "showAttribution": true,
    "extent": {
      "xmin": 9407172,
      "ymin": 2006620,
      "xmax": 11117172,
      "ymax": 3596620,
      "spatialReference": {
        "wkid": 3857,
        "latestWkid": 3857
      }
    },
    "spatialReference": {
      "wkid": 3857,
      "latestWkid": 3857
    },
    "scale": 4000000
  },
  "operationalLayers": [
    {
      "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
      "title": "Base Map",
      "opacity": 1
    },
    {
      "url": "https://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/Hurricane_Active/MapServer",
      "title": "Active Hurricanes",
      "opacity": 1,
      "visibleLayers": [0]
    }
    ,
    {
      "opacity": 1
    }
  ],
  "baseMap": [
      ],
  "exportOptions": {
    "dpi": 96
  }
}
  • This is the solution. We figured it out ourselves but forgot to post the solution. Thanks. – Catch22 Aug 10 '15 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.