0

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:

  1. 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 ?

  • i find that if i use services.arcgisonline.com/arcgis/rest/services/… and modify the mapOptions into : mapOptions: { basemap: new Basemap({ id: 'mymap', layers: [new BasemapLayer({ url: 'services.arcgisonline.com/arcgis/rest/services/…' })] }), center: [0,0], zoom: 5, sliderStyle: 'small', showAttribution: true } It works. So, what kind of map service will work in this mapOptions ? – padjee Jan 14 at 8:52
  • This question seems to be about Beta software: gis.meta.stackexchange.com/q/909/115 – PolyGeo Jan 15 at 11:19
  • The earlier version works like this too. I just tested using 2 different map svc hosted offline : cached and not cached. Only The cached worked... – padjee Jan 15 at 12:16
  • 1
    In that case I think you should edit your question to focus it on the earlier version. – PolyGeo Jan 15 at 18:37
  • Please do not comment on you own question. Instead, Edit the question to integrate the ne information. – Vince Jan 16 at 0:50

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.

Browse other questions tagged or ask your own question.