1

I have a problem in configuring basemap in viewer.js. I want to use a completely offline basemap for my app. I have read the instruction here but can't make it work.

Here is what i have tried :

  1. Modifying the viewer.js in the define section
define([
     'esri/dijit/Basemap',
           'esri/dijit/BasemapLayer',
           'esri/geometry/Point',
           'esri/units',
           'esri/geometry/Extent',
           'esri/config',
           'esri/tasks/GeometryService',
           'esri/layers/ImageParameters'
        ], function (Basemap, BasemapLayer, Point, units, Extent, 
         esriConfig, GeometryService, ImageParameters)
  1. Adding the custom basemap in viewer.js
mapOptions: {
       basemap: new Basemap({
            id: 'mymap',
            layers: [new BasemapLayer({
            url: 'http://10.255.1.99/arcgis/rest/services/mymap/MapServer/'
            })]
        }),
        center: new Point({  
            x: 90.0148634,
            y: -9.5489264,
            spatialReference: {
                wkid: 32750
            }
        }),
        zoom: 5,
        sliderStyle: 'small',
        showAttribution: true
    },

Nothing is displayed. How can I correct this ? Am i missing something ?

Note : i am using CMV ver 1.3.4, Chrome.

0

The X and Y coordinates of your center point look odd for the wkid 32750 that you used. Did you use LAT/LNG instead of X/Y coordinates?

You can use the Esri Sample code here to test your mapOptions.

  • I fix the xy to the correct one. Still it gives me error. The error occurs in Controller.JS (line 207) : "if (this.config.mapOptions.basemap)". It says : Uncaught TypeError: Cannot read property 'basemap' of undefined. The js script api is hosted online. – padjee Jan 11 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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