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);
Solved! Go to Solution.
If using esri-leaflet 1.x, this doesn't work. Need to use 2.x with the latest version of Leaflet.
Error Loading Dynamic Map Layer in an Angular App · Issue #940 · Esri/esri-leaflet · GitHub
If using esri-leaflet 1.x, this doesn't work. Need to use 2.x with the latest version of Leaflet.
Error Loading Dynamic Map Layer in an Angular App · Issue #940 · Esri/esri-leaflet · GitHub