AnsweredAssumed Answered

Limiting layers on a map

Question asked by ngudur on Feb 26, 2016
Latest reply on Feb 29, 2016 by kenbuja

I am using the FEMA flood base map service located at

public/NFHL (MapServer)

 

This base map service has many layers. I am interested in layers 3,27 and 28.

 

I tried limiting the layers using the following code

 

var imageParameters = new ImageParameters();

imageParameters.layerIds = [3,27,28];

imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;

  imageParameters.transparent = false;

var dynamicMapServiceLayer = new EsriArcGISDynamicMapServiceLayer(oneLayer.url,{"ImageParameters": imageParameters});

map.addLayer(dynamicMapServiceLayer);

 

The request goes out to FEMA as below.

 

 

http://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/export?dpi=96&transparent=true&format=png8&bbox=1882592.243115291%2C536521.0518318419%2C1886196.1399064175%2C537555.9451516285&bboxSR=102008&imageSR=102008&size=1285%2C369&f=image

 

 

The correct request should be as below requesting only the layers needed

http://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/export?dpi=96&transparent=true&format=png32&layers=show:3,27,28&bbox=-7944379.251887456,5229071.73982415,-7941752.485181711,5231734.451758499&bboxSR=102100&imageSR=102100&size=950,963&f=image

 

Do I need to modify add something to my code snippet in order to request the only the layers that I need/

 

Any help is appreciated.

 

Thanks

Neema

Outcomes