Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I just started using ArcGIS JS APIs. In my app, I want to combine a few ESRI basemaps with my own basemap service. I am using basemapGallery dijit to change basemaps. By default, basemapGallery shows the imagery map. I want to show OpenStreetMap as the default. How can I make this happen?

The code in my app is simple and directly borrowed from ArcGIS samples. So I did not put it here.


share|improve this question

2 Answers 2

up vote 3 down vote accepted

I think that you'll be best served to create a manual list of the basemaps, including the order, that you want displayed within the gallery.

This ArcGIS thread gives quite a bit of detail into what you might be looking for and some code in how to do it.

share|improve this answer

You also have the option of moving the div which contains your custom basemap using JavaScript. The following code moves the basemap div to the top of the gallery:

on(gallery, "load", function() {
    var nd = document.getElementById("galleryNode_myBasemap");
    nd.parentElement.insertBefore(nd, nd.parentElement.firstElementChild);

Where "myBasemap" is the ID of the basemap layer and gallery is a reference to the Basemap Gallery.

This will work in IE9+, if you need to support IE7+, change .firstElementChild to .firstChild (although I haven't tested it).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.