Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

esriLoader.require()'s promise resolve an array failed #334

Closed
Donny2333 opened this issue Apr 5, 2017 · 1 comment
Closed

esriLoader.require()'s promise resolve an array failed #334

Donny2333 opened this issue Apr 5, 2017 · 1 comment

Comments

@Donny2333
Copy link

Donny2333 commented Apr 5, 2017

I want to load some modules to see my map but it shows nothing. Here is my code:

html:

<!-- import angular.js and angular-esri-map.js -->
<esri-map-view map="vm.map" view-options="vm.options"></esri-map-view>

js:

// My controller
var vm = $scope.vm = {
    options: {
        zoom: 4
    }
};

esriLoader.require(['esri/Map', 'esri/layers/MapImageLayer']).then(function (modules) {
    var Map = modules[0];
    var MapImageLayer = modules[1];

    var layer = new MapImageLayer({
        url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer"
    });

    vm.map = new Map({
        layers: [layer]
    });
});
@Donny2333
Copy link
Author

I move angular.js and angular-esri-map.js to the head of the html. It works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant