Adding layers ArcGISDynamicMapServiceLayer and DynamicMapServiceLayer to a map

1330
5
03-21-2013 01:46 AM
CristinaJacome
New Contributor
Hello

I have an application where the user can show/hide a number of layers.

 streets = new esri.layers.ArcGISDynamicMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", { "opacity": 0.5, "imageParameters": imageParameters });
            satellite = new esri.layers.ArcGISDynamicMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", { "opacity": 0.5, "imageParameters": imageParameters });


etc....

And can also activate other WMS layer like this example http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/demos/layers/layers_custom_wm....


My problem is that when the first active layer is wms (DynamicMapServiceLayer) and then layer ArcGISDynamicMapServiceLayer, I see both correctly. But if the first active layer is ArcGISDynamicMapServiceLayer and then layer DynamicMapServiceLayer I can not see the latter on the map.

//This way don't work
map.addLayer(streets);
map.addLayer(new WMSLayer());


I have to change the order of layers?
I can solve the problem in another way?

Sorry for my english.

Thanks.
0 Kudos
5 Replies
AaronConnolly
Occasional Contributor
Hi,

It looks like your base map layers "streets" and "satellites" should be of type ArcGISTiledMapServiceLayer, rather than ArcGISDynamicMapServiceLayer. That could be part of your problem. Try changing the base map imagery to use this type of object first and see if you notice a difference.

- Aaron
0 Kudos
KenBuja
MVP Esteemed Contributor
Does the DynamicMapServiceLayer have the same projection as the ArcGISDynamicMapServiceLayer?
0 Kudos
CristinaJacome
New Contributor
OH!

If I create my layers like ArcGISTiledMapServiceLayer types, its work, but only if I active first this:
hybrid = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");

If I active first this:
streets = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); //, { "opacity": 0.5, "imageParameters": imageParameters });

don't work.

It is because the projection are different!!!! jeje

Hybrid has projection 4326, but streets has 102100 and my layer wms has 4326 projection.


Thank you AMmiconnol, thank you kenbuja!!

Now I need change the projection of streets layer (if this can)....
0 Kudos
KenBuja
MVP Esteemed Contributor
You should note that the Hybrid layer is out of date. This note is in the map service.

This map is in Extended Support and is no longer updated. Esri recommends that you use World_Imagery instead (ArcGIS 9.3 or higher is required).


Virtually all of the Esri base maps have been moved to the 102100 projection to match them with the existing Google/Bing maps, so it might be difficult to find a street basemap with the old 4326 projection. Can your wms layer be updated to the 102100 projection?
0 Kudos
CristinaJacome
New Contributor
No, mi wms don't support 102100, but I am trying to convert 102100 to 4326 before calling for wms service.
At the moment is very disjointed :mad:


[ATTACH=CONFIG]22870[/ATTACH]
0 Kudos