Thanks for the reply. It seems the only substantial changes you suggested were to start the layers visible and to load them separately with addLayer() instead of loading an array of layers with addLayers(). The program does load the OSM layer first in the OSM_HIS mode. I've expanded the program (attached) to allow testing separate or array loads and found no difference.When OSM is loaded first, and the extent for Oahu based on the dynamic HIS layer is set, the OSM layer shows Africa with Oahu from the dynamic layer on top (which disappears if panned or zoomed). If it were projected on the fly, as you suggest it should be and I had hoped it would be, the dynamic Oahu should not have shown in Africa. If I instead use an extent for Oahu on OSM, the OSM Oahu shows, but the dynamic Oahu is not there, again indicating the on-the-fly projecting is not taking place.I wonder if I need some addtional setting/step to make the on-the-fly projection work.Is on-the-fly projection of non-first layers expected to work only for tile layers? The OSM layer class is a subclass of the tile class.
require(["esri/map", "esri/layers/osm", "esri/layers/agsdynamic"], function() { var map, osmLayer, url, HISlayer; map = new esri.Map("map"); osmLayer = new esri.layers.OpenStreetMapLayer({ id: "OSM" }); var url = "http://mapsLiveCB.hawaiiinformation.com/ArcGIS/rest/services/HIS_BASE_Standard/MapServer"; HISlayer = new esri.layers.ArcGISDynamicMapServiceLayer(url, { id: "standard" }); map.addLayer(osmLayer); map.addLayer(HISlayer); });
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.