Dynamic Maplayer in ESRI Leaflet

1753
1
Jump to solution
03-24-2017 01:56 PM
BrianBehling1
New Contributor II

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);
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
BrianBehling1
New Contributor II

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 

View solution in original post

0 Kudos
1 Reply
BrianBehling1
New Contributor II

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 

0 Kudos