ArcGISDynamicMapServiceLayer: option for visible layers?

859
2
Jump to solution
07-16-2013 11:00 AM
RobertMartin2
Occasional Contributor II
I'm trying to reverse engineer a JavaScript viewer that consumes a dynamic map service. I know it's getting tiles from a URL like this:

http://domain/ArcGIS/rest/services/D_LEGENDLAYERS/MapServer/export?layers=show%3A0%2C10%2C22%2C53%2C...

The 'layers' parameter decoded is:
show:0,10,22,53,63,73,125,96,108,83,93

If I wanted to rewrite the constructor for this layer, how would I pass it those IDs? I don't see anything like that in the options.


Thank you!
Robert
0 Kudos
1 Solution

Accepted Solutions
bobcarr
New Contributor III
I'm trying to reverse engineer a JavaScript viewer that consumes a dynamic map service. I know it's getting tiles from a URL like this:

http://domain/ArcGIS/rest/services/D_LEGENDLAYERS/MapServer/export?layers=show%3A0%2C10%2C22%2C53%2C...

The 'layers' parameter decoded is:
show:0,10,22,53,63,73,125,96,108,83,93

If I wanted to rewrite the constructor for this layer, how would I pass it those IDs? I don't see anything like that in the options.


Thank you!
Robert


Check the API documentation for the ImageParameters class.  An example  below uses layerIds 0 and 1.

var layerParams = new esri.layers.ImageParameters(); var layerDefs = []; layerDefs[0] = "REGION='09'"; layerDefs[1] = "REGION='09'"; layerParams.layerDefinitions = layerDefs; layerParams.layerIds = [0,1]; layerParams.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW; layerParams.transparent = true; var FSRegions = new esri.layers.ArcGISDynamicMapServiceLayer     ("http://apps.fs.fed.us/ArcN/rest/services/EDW/EDW_RegionBoundaries_02/MapServer",        {"opacity":0.9,           "imageParameters":layerParams         });

View solution in original post

0 Kudos
2 Replies
bobcarr
New Contributor III
I'm trying to reverse engineer a JavaScript viewer that consumes a dynamic map service. I know it's getting tiles from a URL like this:

http://domain/ArcGIS/rest/services/D_LEGENDLAYERS/MapServer/export?layers=show%3A0%2C10%2C22%2C53%2C...

The 'layers' parameter decoded is:
show:0,10,22,53,63,73,125,96,108,83,93

If I wanted to rewrite the constructor for this layer, how would I pass it those IDs? I don't see anything like that in the options.


Thank you!
Robert


Check the API documentation for the ImageParameters class.  An example  below uses layerIds 0 and 1.

var layerParams = new esri.layers.ImageParameters(); var layerDefs = []; layerDefs[0] = "REGION='09'"; layerDefs[1] = "REGION='09'"; layerParams.layerDefinitions = layerDefs; layerParams.layerIds = [0,1]; layerParams.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW; layerParams.transparent = true; var FSRegions = new esri.layers.ArcGISDynamicMapServiceLayer     ("http://apps.fs.fed.us/ArcN/rest/services/EDW/EDW_RegionBoundaries_02/MapServer",        {"opacity":0.9,           "imageParameters":layerParams         });
0 Kudos
RobertMartin2
Occasional Contributor II
Just what I was looking for - thanks Bob!!
0 Kudos