Is it possible to use a "Custom TiledMapServiceLayer" as a Basemap? Is it possible to show a "Custom TiledMapServiceLayer" in BasemapGallery?

Yes definitely, your basemaps.js file would look something like the following:

define([
    'esri/dijit/Basemap',
    'esri/dijit/BasemapLayer',
    'esri/layers/osm'
], function ( Basemap, BasemapLayer, osm ) {
    return {
        map: true, // needs a reference to the map
        mode: 'custom', //must be either 'agol' or 'custom'
        title: 'Basemaps', // title for widget
        mapStartBasemap: 'topo', // must match one of the basemap keys below
        //basemaps to show in menu. define in basemaps object below and reference by name here
        // TODO Is this array necessary when the same keys are explicitly included/excluded below?
        basemapsToShow: ['topo', 'aerial'],

        // define all valid custom basemaps here. Object of Basemap objects. For custom basemaps, the key name and basemap id must match.
        basemaps: { // agol basemaps
            topo: {
                title: 'Map',
                basemap: new Basemap({
                    id: 'topo',
                    layers: [new BasemapLayer({
                        url: 'http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer',
                        opacity: 0.5
                    })]
                })
            },

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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