AnsweredAssumed Answered

Dynamic Maplayer in ESRI Leaflet

Question asked by brian.behling_IHS on Mar 24, 2017
Latest reply on Mar 24, 2017 by brian.behling_IHS

I'm trying to to load a dynamic map service into leaflet in an angular app, and the library is throwing an error.

 

Any ideas what could be going on?

 

TypeError: Cannot read property 'call' of undefined
    at e.whenReady (leaflet.js:6)
    at e.addLayer (leaflet.js:6)
    at e.addTo (esri-leaflet.js:20)
    at mapController.$onInit (MapComponent.js:34)
    at angular.js:9599
    at q (angular.js:365)
    at n (angular.js:9588)
    at angular.js:9980
    at angular.js:16648
    at m.$eval (angular.js:17972)

 

var map = L.map("map").setView([46.0, -99.0], 4);  
L.esri.basemapLayer("Gray").addTo(map);  
L.esri.dynamicMapLayer({                
url: https://services.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer",
opacity: 1,
useCors: false }).addTo(map);

Outcomes