I download the sample from github. Then I tried to add a custom basemap at the mapOption section. I have followed the instruction given in here. Also, I followed this post as well. But none worked, no map comes out. I only see empty map grid with "esri" logo at the bottom right corner. What have I done wrong ? How can I show a custom (non-cached) basemap in the mapOptions section.
Update : I find out that if i use cached basemap (like http://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer), it works. I have no luck with non-cached basemap. Then I tried to an older version (1.3.4) too. And its exactly the same, it woks only on a cached basemap.
Here is what I have done using non-cached map service:
- Edit viewer.js to add the "Define" keyword and add "mapOptions"
define([ ... 'esri/geometry/Point', 'esri/dijit/Basemap', 'esri/dijit/BasemapLayer' ],
function (units, Extent, esriConfig, /*urlUtils,*/ GeometryService, ImageParameters,GoogleMapsLoader,i18n, topic, has, Point, Basemap, BasemapLayer)
mapOptions:{ // tiled layer basemap: **new Basemap({ id: 'soco', layers: [new BasemapLayer({ url: 'http://gis-webpub.sonoma-county.org/arcgis/rest/services/BaseMap/SonomaCountyBaseMap/MapServer/' })] }), center: new Point({ x: 6356023.515330248, y: 1917313.443425702, spatialReference: { wkid: 102642 } }), zoom: 5 }**,
Am I missing something ?