Map service labels not displayed in flex viewer 3.0

3626
6
Jump to solution
09-04-2012 10:39 AM
KurtTowler
New Contributor III
I am hoping someone has run into this kind of weird issue.  I have tried a number of ideas but the web service will not display labels in the ArcGIS Viewer for Flex 3.0.

Javascript viewer:  Labels are visible.
ArcMap:  Labels are visible.
Dynamic service from shapefile in flex viewer:  Not visible.
Dynamic service from SDE:  Not visible.
New webservice hitting different data:  Still not visible.
Flex popups work and attribute data can be seen there.
Chrome/IE - Not visible.
Created Flex App from both Server 2008 R2 and from WinXP - no difference.

Other steps taken:
Reinstalled ArcGIS Server
Reinstalled Adobe Air and ArcGIS Viewer from Flex
Versions 10.1 and Adobe Air 3.4
Most installation steps are the default settings.

Is there something I'm missing?

Thanks for any ideas you might have.
Kurt
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Kurt,

   Here is your issue... A layer of type="feature" does not support labels or annotation. The type needs to be dynamic

<layer type="dynamic" label="Control Devices"  url="http://vmarcserver03:6080/arcgis/rest/services/ControlDevices/MapServer"  visible="true"> <sublayer id="0" popupconfig="popups/PopUp_1.xml" /> </layer>

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Kurt,

   What does your config.xml look like?
0 Kudos
KurtTowler
New Contributor III
This is really out of the box except for adding the operational layer and setting a basemap.


<?xml version="1.0" ?>
<configuration>
    <title>ArcGIS Viewer for Flex</title>
    <logo>assets/images/logo.png</logo>
    <style>
        <colors>0xffffff,0x333333,0x101010,0x0,0xffd700</colors>
        <alpha>0.8</alpha>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" useproxy="false"/>
    <widgetcontainer layout="float">
        <widget icon="assets/images/i_target.png" label="Find an address" config="widgets/Locate/LocateWidget.xml" url="widgets/Locate/LocateWidget.swf"/>
        <widget icon="assets/images/i_draw2.png" label="Draw and Measure" config="widgets/Draw/DrawWidget.xml" url="widgets/Draw/DrawWidget.swf"/>
        <widget icon="assets/images/i_print.png" label="Print" config="widgets/Print/PrintWidget.xml" url="widgets/Print/PrintWidget.swf"/>
    </widgetcontainer>
    <widget url="widgets/Navigation/NavigationWidget.swf" config="widgets/Navigation/NavigationWidget.xml" left="10" top="50"/>
    <widget url="widgets/OverviewMap/OverviewMapWidget.swf" config="widgets/OverviewMap/OverviewMapWidget.xml" right="-2" bottom="-2"/>
    <widget url="widgets/MapSwitcher/MapSwitcherWidget.swf" config="widgets/MapSwitcher/MapSwitcherWidget.xml" right="20" top="55"/>
    <widget url="widgets/HeaderController/HeaderControllerWidget.swf" config="widgets/HeaderController/HeaderControllerWidget.xml" left="0" top="0"/>
    <map esrilogovisible="true" openhandcursorvisible="true" scalebarvisible="true" zoomslidervisible="false" wraparound180="true" addarcgisbasemaps="true" initialextent="-12366641.798980577 3680519.9029480857 -12107673.147150526 3827278.997255554" wkid="102100" top="40">
        <basemaps>
            <layer type="tiled" label="Streets" icon="https://www.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thumbnail/te..." url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="true"/>
        </basemaps>
        <operationallayers>
            <layer type="feature" label="Control Devices" url="http://vmarcserver03:6080/arcgis/rest/services/ControlDevices/MapServer/0" popupconfig="popups/PopUp_1.xml" mode="snapshot" visible="true"/>
        </operationallayers>
    </map>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kurt,

   Here is your issue... A layer of type="feature" does not support labels or annotation. The type needs to be dynamic

<layer type="dynamic" label="Control Devices"  url="http://vmarcserver03:6080/arcgis/rest/services/ControlDevices/MapServer"  visible="true"> <sublayer id="0" popupconfig="popups/PopUp_1.xml" /> </layer>
0 Kudos
KurtTowler
New Contributor III
That was it!  I have looked for different examples of tag formatting on the layer but not found anything that specific. 

It is weirdly frustrating when an out of the box experience doesn't document a very basic idea.  The application builder automatically makes that a feature layer type without telling the user so it's unclear how my choice limited my application.  "I created a map service with labels, ergo if I choose that map service then I would expect to see labels as part of the application."  Perhaps a future ESRI version would ask the user about labeling and change the tag accordingly, or just respect the service properties.

I will have to delve more deeply into the documentation.

Thank you, Robert.
Kurt
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kurt,

   In Application Builder if you do not choose a layer from the map service (just the map service) than it will add it as dynamic instead of feature.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos
StephanieLong
New Contributor II
THANK YOU!
0 Kudos