show you how to use a code sample from the ArcGIS API for JavaScript Resource Center to combine two cached map services into a single application. Replace the cached basemap service The following steps demonstrate how to change the cached basemap service and add an additional dynamic operational service. When using services from your own GIS server, use your own Services Directory in the instructions below rather than the Services Directory for Esri Sample Server 1. 1. Change the cached basemap service. Under Services Directory, click the link for Sample Server 1. Using the skills gained from the article, "Add a Map to a Web Page in Three Simple Steps— Getting started with the ArcGIS API for JavaScript" replace the Esri Street map base data with the WaterTemplate/ LocalGovernmentInfrastructureBasemap (MapServer) cached map service at http://sampleserver1.arcgisonline.com/ ArcGIS/rest/services/WaterTemplate/ LocalGovernmentInfrastructureBasemap/ MapServer 2. Add a new reference to an optimized dynamic service: Repeat the process in the previous step to add the dynamic operational layer. Activate the text document containing the application code and locate the lines of JavaScript beginning at line 18, as shown in Listing 1. 3. Replace the Portland_Esri_Neighborhoods_ AGO service with the WaterTemplate/ WaterDistributionOperations (MapServer) service http://sampleserver1.arcgisonline.com/ ArcGIS/rest/services/WaterTemplate/ WaterDistributionOperations/MapServer. The WaterTemplate/Water Distribution Operations (MapServer) service is a dynamic map service created from an MSD. Change the reference to a cached map service to a reference to a dynamic map service by deleting the text var Portland = new esri.layers.ArcGISTiledMapServiceLayer ("http:// sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ Portland_Esri_Neighborhoods_AGO/MapServer"); myMap.addLayer(Portland); Listing 1 var WaterDynamic = new esri.layers.ArcGISDynamicMapServiceLayer("htt p://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/ WaterDistributionOperations/MapServer"); myMap.addLayer(WaterDynamic); Listing 2 ArcGISTiledMapServiceLayer located at line 18 to ArcGISDynamicMapServiceLayer. Finally, change the name of the variable referencing the service to WaterDynamic. The code referencing the dynamic operational layer should look like Listing 2. Save and close the HTML file. Test this updated HTML page locally by opening it in a browser. Keeping Web mapping applications performing well An important part of creating highperformance Web mapping applications is to monitor the performance of map services and stay in tune with the needs of the application users. For more information on monitoring performance, see the ArcGIS Server help Course Introduction to ArcGIS Server topic "Administering the server" under Tuning and configuring ArcGIS Server > Monitoring performance. Learn more Esri offers both instructor-led and online courses on ArcGIS Server, optimizing Web map performance, and using ArcGIS APIs in addition to a three-day Esri instructor-led course ArcGIS Server: Web Administration Using the Microsoft .NET Framework which covers many aspects of ArcGIS Server administration, including monitoring and tuning the server. Visit the Esri Mapping Center at mappingcenter.esri.com for more resources on creating effective maps. Type Instructor-Led Course Instructor-Led Course ArcGIS Server: Web Administration Using the Microsoft .NET Framework Implementing and Optimizing ArcGIS Server Map Caches Building Mashups Using the ArcGIS API for JavaScript Building Rich Internet Applications with ArcGIS API for Flex Building Web Maps Using the ArcGIS API for JavaScript Authoring and Deploying Fast Web Maps Educational resources available from Esri Free Web Training Seminar Free Web Training Seminar Free Web Training Seminar Instructor-Led Course Free Web Training Seminar w www.esri.com www.esri.com ArcUser Summer 2009 49 r Summer 2009 u