Multiple basemaps and dynamic map services

1067
1
05-21-2010 02:44 AM
AndyBurns
Occasional Contributor
Hi

We have two basemaps we would like to use.

1. Background
2. Aerial

Both are cached.

We also have a dynamic map service with about 7 layers on that we would like to use. When i follow the instructions on adding multiple basemaps i can see the background (which is the first map background). It also has the dynamic layer data ontop however if i swop to aerial, the dynamic service disappears when the aerial is turned on. Is there a call to keep my dynamic service on continuously?

thanks
0 Kudos
1 Reply
KeithSandell
New Contributor III
Andy,

Edited to add: Make sure the order of your map.addlayers are correct. First In, Last out.

map.AddLayer(Base Map)
map.AddLayer(Aerial Map)
map.AddLayer(Dynamic Map)

They draw based on order of listing order: Base and Aerial will always be under the Dynamic Map.

That proposition is not very difficult. I just started Javascripting and working with the API last week and have had some good success using the samples.

Basically you are going to need to merge the contents of a number of samples, depending on the overall functionality you are looking for.

To get started I would look at the following:

One solution for visibility control for cached maps (Google like buttons):
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples/map_agol.html

Another solution for visibility control for dynamic maps:
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples/map_explicitla...

Incoroporating multiple cached map services at different scales:
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples/map_switch_lay...

Incorporating multiple dynamic map services:
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples/map_twodynamic...

This is really an over simplification of what is necessary. It takes some finessing of the parts and pieces and functions.

The app I created over the past week has three different cached maps and three dynamic maps, but the dynamic maps make up about 25 layers that need to be individually controlled, etc.

It can be done without too much heartache.

I would highly recommend Aptana Studio and Firefox/Firbug for coding/debugging. I'm new to using these together, but have found them very, very useful and funtional.
0 Kudos