0

I have created a web map application (Javascript API) :

require([
 "esri/map",
 "esri/dijit/InfoWindowLite",
 "esri/InfoTemplate",
 "esri/layers/FeatureLayer",
 "dojo/dom-construct",
 "dojo/domReady!"],
function(
 Map,
 InfoWindowLite,
 InfoTemplate,
 FeatureLayer,
 domConstruct
){
 map = new Map("map", {
 basemap: "topo",
 center: [-85.416, 49.781],
 zoom: 5,
 logo: false});
 TestLayer = new esri.layers.ArcGISDynamicMapServiceLayer(
 "http://Myserver/arcgis/rest/services/TestMAP/MapServer");
 query = new esri.tasks.Query();
 query.returnGeometry = true;
 query.outFields = ["CCSNAME", "DAUID20111" ,"DAUID201_5" ,"DAUID201_9" , "DAUID20_14", "DAUID20_19", "NAME" , "CITY", "POST_CODE", "HRUID2007.csv.GPF", "HRUID2007.csv.GPE", "HRUID2007.csv.SPECF", "HRUID2007.csv.SPECE" ];
 symbol = new esri.symbol.SimpleFillSymbol(
 esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(
 esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([0,255,0]), 2),new dojo.Color([0,255,0,0]));
 map.addLayer(TestLayer);

In the default zoom level set, 3 map layers from **http://Myserver/arcgis/rest/services/TestMAP/MapServer** are showing up.

How can I change my code so that in the default zoom level I get another 3 layers from this url:

"http://Myserver/arcgis/rest/services/TestMAP2/MapServer"

and then when I zoom in I get the current ones.

BradHards
13k2 gold badges40 silver badges74 bronze badges
asked Nov 11, 2013 at 15:28

1 Answer 1

1

The solution is to add another dynamicMapServiceLayer to the map and declare the levels of the detail (LODs) at which map services in your map will be shown.

Check about this sample on esri Javascript resource page: https://developers.arcgis.com/en/javascript/jssamples/map_switch_layer_on_zoom.html

answered Nov 11, 2013 at 16:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.