Select to view content in your preferred language

BasemapGallery with DynamicMapService

630
1
07-24-2013 10:31 AM
by Anonymous User
Not applicable
I am using a dynamic map service as my operational layer which is in a UTM (meters) projection. I am trying to implement the BasemapGallery. A couple issues:

1.) The initial basemap (topo) does not appear when loading the application.

2.) When choosing a difference basemap, the operational layer disappears and the basemap does not appear...blank screen. Code snippet is below.

Any ideas?

Thanks in advance,

rGibson

map = new esri.Map("map",{
     infoWindow:popup,
     basemap: "topo",
     logo: false,
     extent: new esri.geometry.Extent({xmin:705766,ymin:4341305,xmax:706059,ymax:4341504,spatialReference:{wkid:26914}}),
     sliderStyle:"small"
        });

var basemapGallery = new esri.dijit.BasemapGallery({
          showArcGISBasemaps: true,
          map: map
        }, "basemapGallery");
        basemapGallery.startup();       
        dojo.connect(basemapGallery, "onError", function(msg) {console.log(msg)});


layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://myDirectory/rest/services/myService/MapServer", {"imageParameters":imageParameters, id:"dynamicLayer"});

map.addLayer(layer);
0 Kudos
1 Reply
ZhiqiangLiu
Emerging Contributor
I think this may be the problem, I read this from esri sample:

You can add additional basemaps to the gallery, however all basemaps added to the BasemapGallery need to be in the same projection. If you are displaying basemaps from ArcGIS.com by setting showArcGISBasemaps = true then the additional basemaps must be in the Web Mercator projection.

So try to change the projection of your map service to "Web Mercator".
0 Kudos