Select to view content in your preferred language

can't add dynamic map service layer in arcgis javascript

2633
6
Jump to solution
10-26-2015 06:03 AM
SadanandacharB1
Occasional Contributor

Hi All

DynamicLayer.jpg

I am adding one arcgis dynamic map service layer on the base map using dojo module in javscript, But it is not loading.

I can't figure out why it is not loading, Please help me on this issue, I am stucked here.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Sadanandachar,

   The map dot addLayer method is not wanting an array it is expecting a single layer. So remove the square brackets and it will work fine.

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Sadanandachar,

   The map dot addLayer method is not wanting an array it is expecting a single layer. So remove the square brackets and it will work fine.

TracySchloss
Honored Contributor

It's easy to get confused between addLayer, which handles just one layer at a time, and addLayers, which expects an array as the input parameter.  When I know I will be adding more layers later, I'll go ahead and use addLayers, even if I only have an array with one element in it to start.  Then I'm set with the syntax for multiple layers at a later time.

this.map.addLayers([layer1]);

TimWitt2
MVP Alum

I agree, I do the same.

0 Kudos
SadanandacharB1
Occasional Contributor

Thank you so much it helped me a lot

0 Kudos
SadanandacharB1
Occasional Contributor

Thank you so much it helped me a lot

0 Kudos
SadanandacharB1
Occasional Contributor

Thank you so much it helped me a lot

0 Kudos