Select to view content in your preferred language

Silverlight 2.1 API legend control does not refresh with 10SP1 Services

3133
15
03-08-2011 12:22 PM
SloaneWalker
Emerging Contributor
I am using silverlight 2.1 API, Visual Studio 2010, ArcGIS 10.0 SP1 and my legend control will not refresh.  The Service can be turned on and off, but not the sub layers.  If I switch over to my 10 Services on my Production Server, it works. Has anyone else had this problem?
0 Kudos
15 Replies
DominiqueBroux
Esri Frequent Contributor
Is your service cached?

If cached, it's not possible to change the sublayer visibilities (since the exported images are generated from the cache).
0 Kudos
SloaneWalker
Emerging Contributor
No, the services are not cached.  There is no difference in the service configuration between the services running with ArcGIS Server 10 and ArcGIS Server 10SP1.  The legend works with the 10 services but not the 10SP1 Services.

Thanks for your help.  I am stumped on this one, I have tried all the obviouse things.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I perhaps misunderstood your issue.

Do you mean that you don't get any legend infos (no sublayers, no swatches) for your 10SP1 service?

If it's the case, could you test your legend rest end point?  (something like : http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Age/MapServer/legend)
0 Kudos
SloaneWalker
Emerging Contributor
No, I get sub layers and swatches, what does not work is the check boxes to turn the layers on and off.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Could you share the result of this kind of request on your service : http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Age/MapServer?f=pjson ?
(or share just the URL if your service is public).

Also check that your REST end point is able to manage sublayer visibilities:
- make a request on your map server (like http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Age/MapServer)
- click ExportMap
- test with various Layers (such as 1 or 2 or 3...) and check that the sublayer visibilities are taken into account
0 Kudos
SloaneWalker
Emerging Contributor
AAhh, yes, I see that sublayers are null.  Why would htat be and how to creect it?

Thanks!  Here is my URL

http://buster/ArcGIS/rest/services/theMAPex/theMAPexOCP/MapServer?f=pjson
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I can't access 'buster'. Please share the result of the request.
0 Kudos
SloaneWalker
Emerging Contributor
this is what I get:

{
  "currentVersion" : 10.01,
  "serviceDescription" : "",
  "mapName" : "Layers",
  "description" : "",
  "copyrightText" : "",
  "layers" : [
    {
      "id" : 0,
      "name" : "Address Labels",
      "parentLayerId" : -1,
      "defaultVisibility" : false,
      "subLayerIds" : null,
      "minScale" : 24000,
      "maxScale" : 0
    },
    {
      "id" : 1,
      "name" : "Address Points",
      "parentLayerId" : -1,
      "defaultVisibility" : false,
      "subLayerIds" : null,
      "minScale" : 24000,
      "maxScale" : 0
    },
    {
      "id" : 2,
      "name" : "Main Highways",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 499999,
      "maxScale" : 0
    },
    {
      "id" : 3,
      "name" : "Roads",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 250000,
      "maxScale" : 0
    }
  ],
  "tables" : [
   
  ],
  "spatialReference" : {
    "wkt" : "PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",1000000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-126.0],PARAMETER[\"Standard_Parallel_1\",50.0],PARAMETER[\"Standard_Parallel_2\",58.5],PARAMETER[\"Latitude_Of_Origin\",45.0],UNIT[\"Meter\",1.0]]"
  },
  "singleFusedMapCache" : false,
  "initialExtent" : {
    "xmin" : 1019955.64170795,
    "ymin" : 742772.396613911,
    "xmax" : 1612458.69674248,
    "ymax" : 1269733.07830392,
    "spatialReference" : {
      "wkt" : "PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",1000000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-126.0],PARAMETER[\"Standard_Parallel_1\",50.0],PARAMETER[\"Standard_Parallel_2\",58.5],PARAMETER[\"Latitude_Of_Origin\",45.0],UNIT[\"Meter\",1.0]]"
    }
  },
  "fullExtent" : {
    "xmin" : 1019955.64170795,
    "ymin" : 791474.377414865,
    "xmax" : 1612458.69674248,
    "ymax" : 1255113.13164212,
    "spatialReference" : {
      "wkt" : "PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",1000000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-126.0],PARAMETER[\"Standard_Parallel_1\",50.0],PARAMETER[\"Standard_Parallel_2\",58.5],PARAMETER[\"Latitude_Of_Origin\",45.0],UNIT[\"Meter\",1.0]]"
    }
  },
  "units" : "esriMeters",
  "supportedImageFormatTypes" : "PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP",
  "documentInfo" : {
    "Title" : "fc",
    "Author" : "CMckee",
    "Comments" : "",
    "Subject" : "",
    "Category" : "",
    "Keywords" : "",
    "AntialiasingMode" : "None",
    "TextAntialiasingMode" : "Force"
  },
  "capabilities" : "Map,Query,Data"
}


Thanks so much for your help.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
The only thing I noticed is that lot of your layers have relatively low MinScale (24000).

If you are using the legend template of the interactive SDK:
 
 
 <CheckBox Content="{Binding Label}"
                  IsChecked="{Binding IsEnabled, Mode=TwoWay}"
                  IsEnabled="{Binding IsInScaleRange}" >
                            </CheckBox>

you will notice that the checbox is not enabled while the map is not in the scale range of the layer, i.e. in your case, you need to zoom in a lot.

Not sure it's your issue, but it's worth the try to test after removing that 'IsEnabled="{Binding IsInScaleRange}" '
0 Kudos