AnsweredAssumed Answered

No basemap causing error

Question asked by ConroyByron on Jan 19, 2016
Latest reply on Feb 17, 2016 by Michael.Matuszak

I am trying to create a web based map viewer which consists of a single Map Service with no base map layer.

 

I have managed to do this with the 3.15 API by specifying no base map, however when I try to do this with the 4.0 API beta the layer is displayed but I get the following error on load:

Uncaught TypeError: a.constrain is not a function

Additionally when I try to zoom or pan the map I get the following error:

Uncaught TypeError: this.constraints.constrain is not a function

Here is my javascript code:

var map;
var layer ;
var view;
require(
                [
                    "esri/Map",
                    "esri/views/MapView",
                    "esri/layers/ArcGISDynamicLayer"
                ],
                function(
                        Map,
                        MapView,
                        ArcGISDynamicLayer,
                ){

                    layer = new ArcGISDynamicLayer({
                        url: "http://my.service.url"
                    });

                    map = new Map({
                        layers: [layer]
                    });

                    view = new MapView({
                        container: "map",
                        map: map,
                        ui: {
                            components: ["compass"]
                        }
                    });
                }
);

 

Also if I put in a basemap everything works correctly.

Outcomes